From c6b2652c013b7a331f077f34e222b6d6df6bf042 Mon Sep 17 00:00:00 2001 From: phellmes Date: Sun, 11 Feb 2018 16:08:34 +0100 Subject: add flexibility to prefix/suffix string translations for jquery.timeago In addition to use the defaults or any other translated strings this allows now to force an empty string by setting the translation to NONE. Translators can choose to either use prefixes only, suffixes only, none of them or both of them - whatever sounds best in their language. --- include/js_strings.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/include/js_strings.php b/include/js_strings.php index 1b4668061..936594291 100644 --- a/include/js_strings.php +++ b/include/js_strings.php @@ -24,10 +24,16 @@ function js_strings() { '$leavethispage' => t('Unsaved changes. Are you sure you wish to leave this page?'), '$location' => t('Location'), - '$t01' => ((t('timeago.prefixAgo') != 'timeago.prefixAgo') ? t('timeago.prefixAgo') : ''), - '$t02' => ((t('timeago.prefixFromNow') != 'timeago.prefixFromNow') ? t('timeago.prefixFromNow') : ''), - '$t03' => t('ago'), - '$t04' => t('from now'), + // translatable prefix and suffix strings for jquery.timeago - + // using the defaults set below if left untranslated, empty strings if + // translated to "NONE" and the corresponding language strings + // if translated to anything else + '$t01' => ((t('timeago.prefixAgo') == 'timeago.prefixAgo') ? '' : ((t('timeago.prefixAgo') == 'NONE') ? '' : t('timeago.prefixAgo'))), + '$t02' => ((t('timeago.prefixFromNow') == 'timeago.prefixFromNow') ? '' : ((t('timeago.prefixFromNow') == 'NONE') ? '' : t('timeago.prefixFromNow'))), + '$t03' => ((t('timeago.suffixAgo') == 'timeago.suffixAgo') ? 'ago' : ((t('timeago.suffixAgo') == 'NONE') ? '' : t('timeago.suffixAgo'))), + '$t04' => ((t('timeago.suffixFromNow') == 'timeago.suffixFromNow') ? 'from now' : ((t('timeago.suffixFromNow') == 'NONE') ? '' : t('timeago.suffixFromNow'))), + + // translatable main strings for jquery.timeago '$t05' => t('less than a minute'), '$t06' => t('about a minute'), '$t07' => t('%d minutes'), -- cgit v1.2.3 From 1a9c1ecfb16def11e63514abb7264ce4e95dae4f Mon Sep 17 00:00:00 2001 From: phellmes Date: Sun, 11 Feb 2018 17:01:47 +0100 Subject: update DE translation strings for new relative date/time options temporary manual string update in relation to last commit until changes reach Transifex and can be updated there --- view/de-de/hmessages.po | 30 +++++++++++++++--------------- view/de-de/hstrings.php | 30 +++++++++++++++--------------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/view/de-de/hmessages.po b/view/de-de/hmessages.po index e7c962bbd..f68a96c22 100644 --- a/view/de-de/hmessages.po +++ b/view/de-de/hmessages.po @@ -12377,27 +12377,27 @@ msgstr "Ungespeicherte Änderungen. Bist Du sicher, dass Du diese Seite verlasse #: ../../include/js_strings.php:27 msgid "timeago.prefixAgo" -msgstr "timeago.prefixAgo" +msgstr "vor" #: ../../include/js_strings.php:28 msgid "timeago.prefixFromNow" -msgstr " " +msgstr "in" #: ../../include/js_strings.php:29 -msgid "ago" -msgstr "her" +msgid "timeago.suffixAgo" +msgstr "NONE" #: ../../include/js_strings.php:30 -msgid "from now" -msgstr "von jetzt" +msgid "timeago.suffixFromNow" +msgstr "NONE" #: ../../include/js_strings.php:31 msgid "less than a minute" -msgstr "weniger als eine Minute" +msgstr "weniger als einer Minute" #: ../../include/js_strings.php:32 msgid "about a minute" -msgstr "ungefähr eine Minute" +msgstr "ungefähr einer Minute" #: ../../include/js_strings.php:33 #, php-format @@ -12406,7 +12406,7 @@ msgstr "%d Minuten" #: ../../include/js_strings.php:34 msgid "about an hour" -msgstr "ungefähr eine Stunde" +msgstr "ungefähr einer Stunde" #: ../../include/js_strings.php:35 #, php-format @@ -12415,30 +12415,30 @@ msgstr "ungefähr %d Stunden" #: ../../include/js_strings.php:36 msgid "a day" -msgstr "ein Tag" +msgstr "einem Tag" #: ../../include/js_strings.php:37 #, php-format msgid "%d days" -msgstr "%d Tage" +msgstr "%d Tagen" #: ../../include/js_strings.php:38 msgid "about a month" -msgstr "ungefähr einen Monat" +msgstr "ungefähr einem Monat" #: ../../include/js_strings.php:39 #, php-format msgid "%d months" -msgstr "%d Monate" +msgstr "%d Monaten" #: ../../include/js_strings.php:40 msgid "about a year" -msgstr "ungefähr ein Jahr" +msgstr "ungefähr einem Jahr" #: ../../include/js_strings.php:41 #, php-format msgid "%d years" -msgstr "%d Jahre" +msgstr "%d Jahren" #: ../../include/js_strings.php:42 msgid " " diff --git a/view/de-de/hstrings.php b/view/de-de/hstrings.php index 61db3fb5d..e87f660f0 100644 --- a/view/de-de/hstrings.php +++ b/view/de-de/hstrings.php @@ -1,7 +1,7 @@