aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphellmes <development@suschka.de>2018-02-11 16:08:34 +0100
committerphellmes <development@suschka.de>2018-02-11 16:08:34 +0100
commitc6b2652c013b7a331f077f34e222b6d6df6bf042 (patch)
treee29298eff3a513016a45d55a8aec818062fa123c
parent6cc32943954124739023751eb377d398a54772d9 (diff)
downloadvolse-hubzilla-c6b2652c013b7a331f077f34e222b6d6df6bf042.tar.gz
volse-hubzilla-c6b2652c013b7a331f077f34e222b6d6df6bf042.tar.bz2
volse-hubzilla-c6b2652c013b7a331f077f34e222b6d6df6bf042.zip
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.
-rw-r--r--include/js_strings.php14
1 files 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'),