From aba03ed5b0801ca38cdaccc9046f4c6436d1d75b Mon Sep 17 00:00:00 2001 From: zhitomirskiyi Date: Fri, 14 Jan 2011 11:46:38 -0800 Subject: [PATCH] added the locales for timeago --- app/views/layouts/application.html.haml | 2 ++ .../timeago_locale/jquery.timeago.cz.js | 18 ++++++++++ .../timeago_locale/jquery.timeago.da.js | 18 ++++++++++ .../timeago_locale/jquery.timeago.de.js | 19 +++++++++++ .../timeago_locale/jquery.timeago.el.js | 18 ++++++++++ .../timeago_locale/jquery.timeago.es.js | 18 ++++++++++ .../timeago_locale/jquery.timeago.fr.js | 17 ++++++++++ .../timeago_locale/jquery.timeago.he.js | 18 ++++++++++ .../timeago_locale/jquery.timeago.hu.js | 18 ++++++++++ .../timeago_locale/jquery.timeago.id.js | 18 ++++++++++ .../timeago_locale/jquery.timeago.it.js | 16 +++++++++ .../timeago_locale/jquery.timeago.ja.js | 18 ++++++++++ .../timeago_locale/jquery.timeago.ko.js | 16 +++++++++ .../timeago_locale/jquery.timeago.nl.js | 16 +++++++++ .../timeago_locale/jquery.timeago.pl.js | 31 +++++++++++++++++ .../timeago_locale/jquery.timeago.pt-PT.js | 16 +++++++++ .../timeago_locale/jquery.timeago.ro.js | 18 ++++++++++ .../timeago_locale/jquery.timeago.ru.js | 34 +++++++++++++++++++ .../timeago_locale/jquery.timeago.sv.js | 18 ++++++++++ .../timeago_locale/jquery.timeago.zh-CN.js | 19 +++++++++++ 20 files changed, 366 insertions(+) create mode 100644 public/javascripts/vendor/timeago_locale/jquery.timeago.cz.js create mode 100644 public/javascripts/vendor/timeago_locale/jquery.timeago.da.js create mode 100644 public/javascripts/vendor/timeago_locale/jquery.timeago.de.js create mode 100644 public/javascripts/vendor/timeago_locale/jquery.timeago.el.js create mode 100644 public/javascripts/vendor/timeago_locale/jquery.timeago.es.js create mode 100644 public/javascripts/vendor/timeago_locale/jquery.timeago.fr.js create mode 100644 public/javascripts/vendor/timeago_locale/jquery.timeago.he.js create mode 100644 public/javascripts/vendor/timeago_locale/jquery.timeago.hu.js create mode 100644 public/javascripts/vendor/timeago_locale/jquery.timeago.id.js create mode 100644 public/javascripts/vendor/timeago_locale/jquery.timeago.it.js create mode 100644 public/javascripts/vendor/timeago_locale/jquery.timeago.ja.js create mode 100644 public/javascripts/vendor/timeago_locale/jquery.timeago.ko.js create mode 100644 public/javascripts/vendor/timeago_locale/jquery.timeago.nl.js create mode 100644 public/javascripts/vendor/timeago_locale/jquery.timeago.pl.js create mode 100644 public/javascripts/vendor/timeago_locale/jquery.timeago.pt-PT.js create mode 100644 public/javascripts/vendor/timeago_locale/jquery.timeago.ro.js create mode 100644 public/javascripts/vendor/timeago_locale/jquery.timeago.ru.js create mode 100644 public/javascripts/vendor/timeago_locale/jquery.timeago.sv.js create mode 100644 public/javascripts/vendor/timeago_locale/jquery.timeago.zh-CN.js diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index ee7628b76..11e12af88 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -33,6 +33,8 @@ - unless @landing_page = include_javascripts :main + - if ["cz", "da", "de", "el", "es", "fr", "he", "hu", "id", "it", "ja", "ko", "nl", "pl", "pt", "ro", "ru", "sv", "zh-CN"].include?(I18n.locale.to_s) + = javascript_include_tag "vendor/timeago_locale/jquery.timeago.#{I18n.locale.to_s}.js" - if current_user = include_javascripts :flash_socket #unless modern_browser? diff --git a/public/javascripts/vendor/timeago_locale/jquery.timeago.cz.js b/public/javascripts/vendor/timeago_locale/jquery.timeago.cz.js new file mode 100644 index 000000000..0ed965013 --- /dev/null +++ b/public/javascripts/vendor/timeago_locale/jquery.timeago.cz.js @@ -0,0 +1,18 @@ +// Czech +jQuery.timeago.settings.strings = { + prefixAgo: "před", + prefixFromNow: null, + suffixAgo: null, + suffixFromNow: null, + seconds: "méně než minutou", + minute: "minutou", + minutes: "%d minutami", + hour: "hodinou", + hours: "%d hodinami", + day: "1 dnem", + days: "%d dny", + month: "1 měsícem", + months: "%d měsíci", + year: "1 rokem", + years: "%d roky" +}; diff --git a/public/javascripts/vendor/timeago_locale/jquery.timeago.da.js b/public/javascripts/vendor/timeago_locale/jquery.timeago.da.js new file mode 100644 index 000000000..ff50e873f --- /dev/null +++ b/public/javascripts/vendor/timeago_locale/jquery.timeago.da.js @@ -0,0 +1,18 @@ +// Danish +jQuery.timeago.settings.strings = { + prefixAgo: "for", + prefixFromNow: "om", + suffixAgo: "siden", + suffixFromNow: "", + seconds: "mindre end et minut", + minute: "ca. et minut", + minutes: "%d minutter", + hour: "ca. en time", + hours: "ca. %d timer", + day: "en dag", + days: "%d dage", + month: "ca. en måned", + months: "%d måneder", + year: "ca. et år", + years: "%d år" +}; \ No newline at end of file diff --git a/public/javascripts/vendor/timeago_locale/jquery.timeago.de.js b/public/javascripts/vendor/timeago_locale/jquery.timeago.de.js new file mode 100644 index 000000000..b4573e826 --- /dev/null +++ b/public/javascripts/vendor/timeago_locale/jquery.timeago.de.js @@ -0,0 +1,19 @@ +// German +jQuery.timeago.settings.strings = { + prefixAgo: "vor", + prefixFromNow: "in", + suffixAgo: "", + suffixFromNow: "", + seconds: "wenigen Sekunden", + minute: "etwa einer Minute", + minutes: "%d Minuten", + hour: "etwa einer Stunde", + hours: "%d Stunden", + day: "etwa einem Tag", + days: "%d Tagen", + month: "etwa einem Monat", + months: "%d Monaten", + year: "etwa einem Jahr", + years: "%d Jahren" +}; + diff --git a/public/javascripts/vendor/timeago_locale/jquery.timeago.el.js b/public/javascripts/vendor/timeago_locale/jquery.timeago.el.js new file mode 100644 index 000000000..61aaafe49 --- /dev/null +++ b/public/javascripts/vendor/timeago_locale/jquery.timeago.el.js @@ -0,0 +1,18 @@ +// Greek +jQuery.timeago.settings.strings = { + prefixAgo: "πριν", + prefixFromNow: "σε", + suffixAgo: "", + suffixFromNow: "", + seconds: "λιγότερο από ένα λεπτό", + minute: "περίπου ένα λεπτό", + minutes: "%d λεπτά", + hour: "περίπου μία ώρα", + hours: "περίπου %d ώρες", + day: "μία μέρα", + days: "%d μέρες", + month: "περίπου ένα μήνα", + months: "%d μήνες", + year: "περίπου ένα χρόνο", + years: "%d χρόνια" +}; \ No newline at end of file diff --git a/public/javascripts/vendor/timeago_locale/jquery.timeago.es.js b/public/javascripts/vendor/timeago_locale/jquery.timeago.es.js new file mode 100644 index 000000000..00c6d0a6c --- /dev/null +++ b/public/javascripts/vendor/timeago_locale/jquery.timeago.es.js @@ -0,0 +1,18 @@ +// Spanish +jQuery.timeago.settings.strings = { + prefixAgo: "hace", + prefixFromNow: "dentro de", + suffixAgo: "", + suffixFromNow: "", + seconds: "menos de un minuto", + minute: "un minuto", + minutes: "unos %d minutos", + hour: "una hora", + hours: "%d horas", + day: "un día", + days: "%d días", + month: "un mes", + months: "%d meses", + year: "un año", + years: "%d años" +}; \ No newline at end of file diff --git a/public/javascripts/vendor/timeago_locale/jquery.timeago.fr.js b/public/javascripts/vendor/timeago_locale/jquery.timeago.fr.js new file mode 100644 index 000000000..502834230 --- /dev/null +++ b/public/javascripts/vendor/timeago_locale/jquery.timeago.fr.js @@ -0,0 +1,17 @@ +// French +jQuery.timeago.settings.strings = { + // environ ~= about, it's optional + prefixAgo: "il y a", + prefixFromNow: "d'ici", + seconds: "moins d'une minute", + minute: "environ une minute", + minutes: "environ %d minutes", + hour: "environ une heure", + hours: "environ %d heures", + day: "environ un jour", + days: "environ %d jours", + month: "environ un mois", + months: "environ %d mois", + year: "un an", + years: "%d ans" +}; \ No newline at end of file diff --git a/public/javascripts/vendor/timeago_locale/jquery.timeago.he.js b/public/javascripts/vendor/timeago_locale/jquery.timeago.he.js new file mode 100644 index 000000000..9d5b6c6b0 --- /dev/null +++ b/public/javascripts/vendor/timeago_locale/jquery.timeago.he.js @@ -0,0 +1,18 @@ +// Hebrew +jQuery.timeago.settings.strings = { + prefixAgo: "לפני", + prefixFromNow: "מעכשיו", + suffixAgo: "", + suffixFromNow: "", + seconds: "פחות מדקה", + minute: "דקה", + minutes: "%d דקות", + hour: "שעה", + hours: "%d שעות", + day: "יום", + days: "%d ימים", + month: "חודש", + months: "%d חודשים", + year: "שנה", + years: "%d שנים" +}; \ No newline at end of file diff --git a/public/javascripts/vendor/timeago_locale/jquery.timeago.hu.js b/public/javascripts/vendor/timeago_locale/jquery.timeago.hu.js new file mode 100644 index 000000000..3079c22b7 --- /dev/null +++ b/public/javascripts/vendor/timeago_locale/jquery.timeago.hu.js @@ -0,0 +1,18 @@ +// Hungarian +jQuery.timeago.settings.strings = { + prefixAgo: null, + prefixFromNow: null, + suffixAgo: null, + suffixFromNow: null, + seconds: "kevesebb mint egy perce", + minute: "körülbelül egy perce", + minutes: "%d perce", + hour: "körülbelül egy órája", + hours: "körülbelül %d órája", + day: "körülbelül egy napja", + days: "%d napja", + month: "körülbelül egy hónapja", + months: "%d hónapja", + year: "körülbelül egy éve", + years: "%d éve" +}; \ No newline at end of file diff --git a/public/javascripts/vendor/timeago_locale/jquery.timeago.id.js b/public/javascripts/vendor/timeago_locale/jquery.timeago.id.js new file mode 100644 index 000000000..72c390971 --- /dev/null +++ b/public/javascripts/vendor/timeago_locale/jquery.timeago.id.js @@ -0,0 +1,18 @@ +// Indonesian +jQuery.timeago.settings.strings = { + prefixAgo: null, + prefixFromNow: null, + suffixAgo: "yang lalu", + suffixFromNow: "dari sekarang", + seconds: "kurang dari semenit", + minute: "sekitar satu menit", + minutes: "%d menit", + hour: "sekitar sejam", + hours: "sekitar %d jam", + day: "sehari", + days: "%d hari", + month: "sekitar sebulan", + months: "%d tahun", + year: "sekitar setahun", + years: "%d tahun" +}; \ No newline at end of file diff --git a/public/javascripts/vendor/timeago_locale/jquery.timeago.it.js b/public/javascripts/vendor/timeago_locale/jquery.timeago.it.js new file mode 100644 index 000000000..6308dd30c --- /dev/null +++ b/public/javascripts/vendor/timeago_locale/jquery.timeago.it.js @@ -0,0 +1,16 @@ +// Italian +jQuery.timeago.settings.strings = { + suffixAgo: "fa", + suffixFromNow: "da ora", + seconds: "meno di un minuto", + minute: "circa un minuto", + minutes: "%d minuti", + hour: "circa un'ora", + hours: "circa %d ore", + day: "un giorno", + days: "%d giorni", + month: "circa un mese", + months: "%d mesi", + year: "circa un anno", + years: "%d anni" +}; \ No newline at end of file diff --git a/public/javascripts/vendor/timeago_locale/jquery.timeago.ja.js b/public/javascripts/vendor/timeago_locale/jquery.timeago.ja.js new file mode 100644 index 000000000..cf7fd19fc --- /dev/null +++ b/public/javascripts/vendor/timeago_locale/jquery.timeago.ja.js @@ -0,0 +1,18 @@ +// Japanese +jQuery.timeago.settings.strings = { + prefixAgo: "", + prefixFromNow: "今から", + suffixAgo: "前", + suffixFromNow: "後", + seconds: "ほんの数秒", + minute: "約一分", + minutes: "%d 分", + hour: "大体一時間", + hours: "大体 %d 時間位", + day: "一日", + days: "%d 日ほど", + month: "大体一ヶ月", + months: "%d ヶ月ほど", + year: "丁度一年(虎舞流w)", + years: "%d 年" +}; \ No newline at end of file diff --git a/public/javascripts/vendor/timeago_locale/jquery.timeago.ko.js b/public/javascripts/vendor/timeago_locale/jquery.timeago.ko.js new file mode 100644 index 000000000..5c50ba7d5 --- /dev/null +++ b/public/javascripts/vendor/timeago_locale/jquery.timeago.ko.js @@ -0,0 +1,16 @@ +// Korean +jQuery.timeago.settings.strings = { + suffixAgo: "전", + suffixFromNow: "후", + seconds: "1분 이내", + minute: "1분", + minutes: "%d분", + hour: "1시간", + hours: "%d시간", + day: "하루", + days: "%d일", + month: "한달", + months: "%d달", + year: "1년", + years: "%d년" +}; \ No newline at end of file diff --git a/public/javascripts/vendor/timeago_locale/jquery.timeago.nl.js b/public/javascripts/vendor/timeago_locale/jquery.timeago.nl.js new file mode 100644 index 000000000..ca41bc5b7 --- /dev/null +++ b/public/javascripts/vendor/timeago_locale/jquery.timeago.nl.js @@ -0,0 +1,16 @@ +// Dutch +jQuery.timeago.settings.strings = { + suffixAgo: "geleden", + suffixFromNow: "vanaf nu", + seconds: "iets minder dan een minute", + minute: "ongeveer een minuut", + minutes: "%d minuten", + hour: "ongeveer een uur", + hours: "ongeveer %d uren", + day: "een dag", + days: "%d dagen", + month: "ongeveer een maand", + months: "%d maanden", + year: "ongeveer een jaar", + years: "%d jaar" +}; \ No newline at end of file diff --git a/public/javascripts/vendor/timeago_locale/jquery.timeago.pl.js b/public/javascripts/vendor/timeago_locale/jquery.timeago.pl.js new file mode 100644 index 000000000..21d26fc1c --- /dev/null +++ b/public/javascripts/vendor/timeago_locale/jquery.timeago.pl.js @@ -0,0 +1,31 @@ +// Polish +(function() { + function numpf(n, s, t) { + // s - 2-4, 22-24, 32-34 ... + // t - 5-21, 25-31, ... + var n10 = n % 10; + if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) { + return s; + } else { + return t; + } + } + + jQuery.timeago.settings.strings = { + prefixAgo: null, + prefixFromNow: "za", + suffixAgo: "temu", + suffixFromNow: null, + seconds: "mniej niż minutę", + minute: "minutę", + minutes: function(value) { return numpf(value, "%d minuty", "%d minut"); }, + hour: "godzinę", + hours: function(value) { return numpf(value, "%d godziny", "%d godzin"); }, + day: "dzień", + days: "%d dni", + month: "miesiąc", + months: function(value) { return numpf(value, "%d miesiące", "%d miesięcy"); }, + year: "rok", + years: function(value) { return numpf(value, "%d lata", "%d lat"); } + }; +})(); \ No newline at end of file diff --git a/public/javascripts/vendor/timeago_locale/jquery.timeago.pt-PT.js b/public/javascripts/vendor/timeago_locale/jquery.timeago.pt-PT.js new file mode 100644 index 000000000..416333c65 --- /dev/null +++ b/public/javascripts/vendor/timeago_locale/jquery.timeago.pt-PT.js @@ -0,0 +1,16 @@ +// Portuguese +jQuery.timeago.settings.strings = { + suffixAgo: "atrás", + suffixFromNow: "a partir de agora", + seconds: "menos de um minuto", + minute: "cerca de um minuto", + minutes: "%d minutos", + hour: "cerca de uma hora", + hours: "cerca de %d horas", + day: "um dia", + days: "%d dias", + month: "cerca de um mês", + months: "%d meses", + year: "cerca de um ano", + years: "%d anos" +}; \ No newline at end of file diff --git a/public/javascripts/vendor/timeago_locale/jquery.timeago.ro.js b/public/javascripts/vendor/timeago_locale/jquery.timeago.ro.js new file mode 100644 index 000000000..7d3773907 --- /dev/null +++ b/public/javascripts/vendor/timeago_locale/jquery.timeago.ro.js @@ -0,0 +1,18 @@ +// Romanian +$.timeago.settings.strings = { + prefixAgo: "acum", + prefixFromNow: "in timp de", + suffixAgo: "", + suffixFromNow: "", + seconds: "mai putin de un minut", + minute: "un minut", + minutes: "%d minute", + hour: "o ora", + hours: "%d ore", + day: "o zi", + days: "%d zile", + month: "o luna", + months: "%d luni", + year: "un an", + years: "%d ani" +}; diff --git a/public/javascripts/vendor/timeago_locale/jquery.timeago.ru.js b/public/javascripts/vendor/timeago_locale/jquery.timeago.ru.js new file mode 100644 index 000000000..a8177dd33 --- /dev/null +++ b/public/javascripts/vendor/timeago_locale/jquery.timeago.ru.js @@ -0,0 +1,34 @@ +// Russian +(function() { + function numpf(n, f, s, t) { + // f - 1, 21, 31, ... + // s - 2-4, 22-24, 32-34 ... + // t - 5-20, 25-30, ... + var n10 = n % 10; + if ( (n10 == 1) && ( (n == 1) || (n > 20) ) ) { + return f; + } else if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) { + return s; + } else { + return t; + } + } + + jQuery.timeago.settings.strings = { + prefixAgo: null, + prefixFromNow: "через", + suffixAgo: "назад", + suffixFromNow: null, + seconds: "меньше минуты", + minute: "минуту", + minutes: function(value) { return numpf(value, "%d минута", "%d минуты", "%d минут"); }, + hour: "час", + hours: function(value) { return numpf(value, "%d час", "%d часа", "%d часов"); }, + day: "день", + days: function(value) { return numpf(value, "%d день", "%d дня", "%d дней"); }, + month: "месяц", + months: function(value) { return numpf(value, "%d месяц", "%d месяца", "%d месяцев"); }, + year: "год", + years: function(value) { return numpf(value, "%d год", "%d года", "%d лет"); } + }; +})(); \ No newline at end of file diff --git a/public/javascripts/vendor/timeago_locale/jquery.timeago.sv.js b/public/javascripts/vendor/timeago_locale/jquery.timeago.sv.js new file mode 100644 index 000000000..b5c394717 --- /dev/null +++ b/public/javascripts/vendor/timeago_locale/jquery.timeago.sv.js @@ -0,0 +1,18 @@ +// Swedish +jQuery.timeago.settings.strings = { + prefixAgo: "för", + prefixFromNow: "om", + suffixAgo: "sedan", + suffixFromNow: "", + seconds: "mindre än en minut", + minute: "ungefär en minut", + minutes: "%d minuter", + hour: "ungefär en timme", + hours: "ungefär %d timmar", + day: "en dag", + days: "%d dagar", + month: "ungefär en månad", + months: "%d månader", + year: "ungefär ett år", + years: "%d år" +}; \ No newline at end of file diff --git a/public/javascripts/vendor/timeago_locale/jquery.timeago.zh-CN.js b/public/javascripts/vendor/timeago_locale/jquery.timeago.zh-CN.js new file mode 100644 index 000000000..5487d95b2 --- /dev/null +++ b/public/javascripts/vendor/timeago_locale/jquery.timeago.zh-CN.js @@ -0,0 +1,19 @@ +// Simplified Chinese +jQuery.timeago.settings.strings = { + prefixAgo: null, + prefixFromNow: "从现在开始", + suffixAgo: "之前", + suffixFromNow: null, + seconds: "不到 1 分钟", + minute: "大约 1 分钟", + minutes: "%d 分钟", + hour: "大约 1 小时", + hours: "大约 %d 小时", + day: "1 天", + days: "%d 天", + month: "大约 1 个月", + months: "%d 月", + year: "大约 1 年", + years: "%d 年", + numbers: [] +} \ No newline at end of file