aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2018-10-13 18:16:56 +0000
committerMario <mario@mariovavti.com>2018-10-13 20:17:14 +0200
commiteaee27c9e4f7a533fea8e2cda7a0b2c7230a5dfb (patch)
treee86a90a27578d6dde289aa91ae5190b3e0024fef /view
parent5310f4e310f58e77cb3764c9174b627e406d7a66 (diff)
downloadvolse-hubzilla-eaee27c9e4f7a533fea8e2cda7a0b2c7230a5dfb.tar.gz
volse-hubzilla-eaee27c9e4f7a533fea8e2cda7a0b2c7230a5dfb.tar.bz2
volse-hubzilla-eaee27c9e4f7a533fea8e2cda7a0b2c7230a5dfb.zip
Merge branch 'patch-14' into 'dev'
Add date/time plurals translation in JavaScript See merge request hubzilla/core!1336 (cherry picked from commit a2575059e2a068a67cd984888422265c6888f261) 5c0d3187 Add date/time plurals translation in JavaScript 729d0d53 Update language.php f68674b3 Update js_strings.tpl 3ac4337a Update main.js e96e3dc6 Update po2php.php 54bdf59d Update js_strings.php
Diffstat (limited to 'view')
-rw-r--r--view/js/main.js40
-rwxr-xr-xview/tpl/js_strings.tpl2
2 files changed, 22 insertions, 20 deletions
diff --git a/view/js/main.js b/view/js/main.js
index 48277f5cc..0c16d0560 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -44,25 +44,27 @@ $(document).ready(function() {
$(document).on('click', '.conversation-settings-link', getConversationSettings);
$(document).on('click', '#settings_module_ajax_submit', postConversationSettings);
- jQuery.timeago.settings.strings = {
- prefixAgo : aStr['t01'],
- prefixFromNow : aStr['t02'],
- suffixAgo : aStr['t03'],
- suffixFromNow : aStr['t04'],
- seconds : aStr['t05'],
- minute : aStr['t06'],
- minutes : aStr['t07'],
- hour : aStr['t08'],
- hours : aStr['t09'],
- day : aStr['t10'],
- days : aStr['t11'],
- month : aStr['t12'],
- months : aStr['t13'],
- year : aStr['t14'],
- years : aStr['t15'],
- wordSeparator : aStr['t16'],
- numbers : aStr['t17'],
- };
+ var tf = new Function('n', aStr['plural_func']);
+
+ jQuery.timeago.settings.strings = {
+ prefixAgo : aStr['t01'],
+ prefixFromNow : aStr['t02'],
+ suffixAgo : aStr['t03'],
+ suffixFromNow : aStr['t04'],
+ seconds : aStr['t05'],
+ minute : aStr['t06'],
+ minutes : function(value){var str=aStr['t07'].split("/")[tf(value)]; return (str ? str : aStr['t07']);},
+ hour : aStr['t08'],
+ hours : function(value){var str=aStr['t09'].split("/")[tf(value)]; return (str ? str : aStr['t09']);},
+ day : aStr['t10'],
+ days : function(value){var str=aStr['t11'].split("/")[tf(value)]; return (str ? str : aStr['t11']);},
+ month : aStr['t12'],
+ months : function(value){var str=aStr['t13'].split("/")[tf(value)]; return (str ? str : aStr['t13']);},
+ year : aStr['t14'],
+ years : function(value){var str=aStr['t15'].split("/")[tf(value)]; return (str ? str : aStr['t15']);},
+ wordSeparator : aStr['t16'],
+ numbers : aStr['t17'],
+ };
//mod_mail only
$(".mail-conv-detail .autotime").timeago();
diff --git a/view/tpl/js_strings.tpl b/view/tpl/js_strings.tpl
index 01fc3f993..f7425ba98 100755
--- a/view/tpl/js_strings.tpl
+++ b/view/tpl/js_strings.tpl
@@ -34,7 +34,7 @@
'name_ok1' : "{{$name_ok1}}",
'name_ok2' : "{{$name_ok2}}",
-
+ 'plural_func' : "{{$plural_func}}",
't01' : "{{$t01}}",
't02' : "{{$t02}}",