From: Hypolite Petovan Date: Fri, 16 Mar 2018 07:56:11 +0000 (-0400) Subject: Merge pull request #548 from tobiasd/20180316-detrans X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=ebfd4defd3e9d65407df4f1f66ca74b31482292f;hp=1efd543aa8cf24014e0a26613441e7a88cc71467;p=friendica-addons.git Merge pull request #548 from tobiasd/20180316-detrans DE translation for mailstream and pageheader addon translated --- diff --git a/nsfw/lang/C/messages.po b/nsfw/lang/C/messages.po index 0fd1035c..96e2849c 100644 --- a/nsfw/lang/C/messages.po +++ b/nsfw/lang/C/messages.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-27 05:01-0500\n" +"POT-Creation-Date: 2018-03-15 17:54+0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,41 +17,39 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: nsfw.php:78 -msgid "Not Safe For Work (General Purpose Content Filter) settings" +#: nsfw.php:77 nsfw.php:81 +msgid "Content Filter (NSFW and more)" msgstr "" -#: nsfw.php:80 +#: nsfw.php:85 msgid "" -"This addon looks in posts for the words/text you specify below, and " -"collapses any content containing those keywords so it is not displayed at " -"inappropriate times, such as sexual innuendo that may be improper in a work " -"setting. It is polite and recommended to tag any content containing nudity " -"with #NSFW. This filter can also match any other word/text you specify, and " -"can thereby be used as a general purpose content filter." +"This addon searches for specified words/text in posts and collapses them. It " +"can be used to filter content tagged with for instance #NSFW that may be " +"deemed inappropriate at certain times or places, such as being at work. It " +"is also useful for hiding irrelevant or annoying content from direct view." msgstr "" -#: nsfw.php:81 +#: nsfw.php:86 msgid "Enable Content filter" msgstr "" -#: nsfw.php:84 +#: nsfw.php:89 msgid "Comma separated list of keywords to hide" msgstr "" -#: nsfw.php:88 -msgid "Submit" +#: nsfw.php:93 +msgid "Save Settings" msgstr "" -#: nsfw.php:89 +#: nsfw.php:94 msgid "Use /expression/ to provide regular expressions" msgstr "" -#: nsfw.php:105 +#: nsfw.php:109 msgid "NSFW Settings saved." msgstr "" -#: nsfw.php:157 +#: nsfw.php:167 #, php-format msgid "%s - Click to open/close" msgstr "" diff --git a/nsfw/nsfw.php b/nsfw/nsfw.php index 0782c092..836f6541 100644 --- a/nsfw/nsfw.php +++ b/nsfw/nsfw.php @@ -34,126 +34,125 @@ function nsfw_extract_photos($body) { $new_body = ''; - $img_start = strpos($body,'src="data:'); - $img_end = (($img_start !== false) ? strpos(substr($body,$img_start),'>') : false); + $img_start = strpos($body, 'src="data:'); + $img_end = (($img_start !== false) ? strpos(substr($body, $img_start), '>') : false); $cnt = 0; while($img_end !== false) { $img_end += $img_start; - $new_body = $new_body . substr($body,0,$img_start); + $new_body = $new_body . substr($body, 0, $img_start); $cnt ++; - $body = substr($body,0,$img_end); + $body = substr($body, 0, $img_end); - $img_start = strpos($body,'src="data:'); - $img_end = (($img_start !== false) ? strpos(substr($body,$img_start),'>') : false); + $img_start = strpos($body, 'src="data:'); + $img_end = (($img_start !== false) ? strpos(substr($body, $img_start), '>') : false); } - if(! $cnt) + if (!$cnt) { return $body; - + } return $new_body; } - - - -function nsfw_addon_settings(&$a,&$s) { - - - if(! local_user()) +function nsfw_addon_settings(&$a, &$s) +{ + if (!local_user()) { return; + } - /* Add our stylesheet to the page so we can make our settings look nice */ + /* Add our stylesheet to the page so we can make our settings look nice */ - $a->page['htmlhead'] .= '' . "\r\n"; + $a->page['htmlhead'] .= '' . "\r\n"; - $enable_checked = (intval(PConfig::get(local_user(),'nsfw','disable')) ? '' : ' checked="checked" '); - $words = PConfig::get(local_user(),'nsfw','words'); - if(! $words) + $enable_checked = (intval(PConfig::get(local_user(), 'nsfw', 'disable')) ? '' : ' checked="checked" '); + $words = PConfig::get(local_user(), 'nsfw', 'words'); + if (!$words) { $words = 'nsfw,'; + } - $s .= ''; - $s .= '

' . L10n::t('Not Safe For Work (General Purpose Content Filter)') . '

'; - $s .= '
'; - $s .= '