From 726420ac0aa63390b40711610ead6103270e3d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vojt=C4=9Bch=20Sajdl?= Date: Sun, 7 Jan 2018 20:55:17 +0100 Subject: [PATCH] Fix #4 - added timeago translations --- locale/cs_CZ/jquery.timeago.js | 34 ++++++++++++++++++++++++++++++++++ locale/en_GB/jquery.timeago.js | 30 ++++++++++++++++++++++++++++++ template.php | 1 + 3 files changed, 65 insertions(+) create mode 100644 locale/cs_CZ/jquery.timeago.js create mode 100644 locale/en_GB/jquery.timeago.js diff --git a/locale/cs_CZ/jquery.timeago.js b/locale/cs_CZ/jquery.timeago.js new file mode 100644 index 0000000..b940f69 --- /dev/null +++ b/locale/cs_CZ/jquery.timeago.js @@ -0,0 +1,34 @@ +(function (factory) { + if (typeof define === 'function' && define.amd) { + define(['jquery'], factory); + } else if (typeof module === 'object' && typeof module.exports === 'object') { + factory(require('jquery')); + } else { + factory(jQuery); + } +}(function (jQuery) { + // Czech + (function() { + function f(n, d, a) { + return a[d>=0 ? 0 : a.length===2 || n<5 ? 1 : 2]; + } + + jQuery.timeago.settings.strings = { + prefixAgo: 'před', + prefixFromNow: 'za', + suffixAgo: null, + suffixFromNow: null, + seconds: function(n, d) {return f(n, d, ['méně než minutou', 'méně než minutu']);}, + minute: function(n, d) {return f(n, d, ['minutou', 'minutu']);}, + minutes: function(n, d) {return f(n, d, ['%d minutami', '%d minuty', '%d minut']);}, + hour: function(n, d) {return f(n, d, ['hodinou', 'hodinu']);}, + hours: function(n, d) {return f(n, d, ['%d hodinami', '%d hodiny', '%d hodin']);}, + day: function(n, d) {return f(n, d, ['%d dnem', '%d den']);}, + days: function(n, d) {return f(n, d, ['%d dny', '%d dny', '%d dní']);}, + month: function(n, d) {return f(n, d, ['%d měsícem', '%d měsíc']);}, + months: function(n, d) {return f(n, d, ['%d měsíci', '%d měsíce', '%d měsíců']);}, + year: function(n, d) {return f(n, d, ['%d rokem', '%d rok']);}, + years: function(n, d) {return f(n, d, ['%d lety', '%d roky', '%d let']);} + }; + })(); +})); diff --git a/locale/en_GB/jquery.timeago.js b/locale/en_GB/jquery.timeago.js new file mode 100644 index 0000000..8ca50af --- /dev/null +++ b/locale/en_GB/jquery.timeago.js @@ -0,0 +1,30 @@ +(function (factory) { + if (typeof define === 'function' && define.amd) { + define(['jquery'], factory); + } else if (typeof module === 'object' && typeof module.exports === 'object') { + factory(require('jquery')); + } else { + factory(jQuery); + } +}(function (jQuery) { + // English (Template) + jQuery.timeago.settings.strings = { + prefixAgo: null, + prefixFromNow: null, + suffixAgo: "ago", + suffixFromNow: "from now", + seconds: "less than a minute", + minute: "about a minute", + minutes: "%d minutes", + hour: "about an hour", + hours: "about %d hours", + day: "a day", + days: "%d days", + month: "about a month", + months: "%d months", + year: "about a year", + years: "%d years", + wordSeparator: " ", + numbers: [] + }; +})); diff --git a/template.php b/template.php index e419921..077e9f1 100644 --- a/template.php +++ b/template.php @@ -123,6 +123,7 @@ class Template{ +