From 7713dfb8b0a62f643847f5b73e4573848c1b16fd Mon Sep 17 00:00:00 2001 From: Harry Seo <harry@kakao.com> Date: Tue, 7 Jan 2014 21:32:33 +0900 Subject: [PATCH 1/2] internationalize Discourse.Formatter.tinyDateYear --- app/assets/javascripts/discourse/lib/formatter.js | 2 +- config/locales/client.cs.yml | 1 + config/locales/client.de.yml | 1 + config/locales/client.en.yml | 1 + config/locales/client.es.yml | 1 + config/locales/client.fr.yml | 1 + config/locales/client.it.yml | 1 + config/locales/client.ja.yml | 1 + config/locales/client.ko.yml | 1 + config/locales/client.nl.yml | 1 + config/locales/client.ru.yml | 1 + config/locales/client.sv.yml | 3 ++- 12 files changed, 13 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/formatter.js b/app/assets/javascripts/discourse/lib/formatter.js index 996cefcf4..27c937466 100644 --- a/app/assets/javascripts/discourse/lib/formatter.js +++ b/app/assets/javascripts/discourse/lib/formatter.js @@ -100,7 +100,7 @@ Discourse.Formatter = (function(){ }; tinyDateYear = function(date) { - return moment(date).format("D MMM 'YY"); + return moment(date).format(I18n.t("dates.tiny.date_year")); }; // http://stackoverflow.com/questions/196972/convert-string-to-title-case-with-javascript diff --git a/config/locales/client.cs.yml b/config/locales/client.cs.yml index 32ea58fa7..d89c9addc 100644 --- a/config/locales/client.cs.yml +++ b/config/locales/client.cs.yml @@ -59,6 +59,7 @@ cs: one: "1r" few: "%{count}r" other: "%{count}let" + date_year: "D MMM 'YY" medium: x_minutes: one: "1 minuta" diff --git a/config/locales/client.de.yml b/config/locales/client.de.yml index fb1442f55..3d78ff6c8 100644 --- a/config/locales/client.de.yml +++ b/config/locales/client.de.yml @@ -49,6 +49,7 @@ de: almost_x_years: one: "1J" other: "%{count}J" + date_year: "D MMM 'YY" medium: x_minutes: one: "1 Minute" diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index c8f00032f..f752ca7ff 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -49,6 +49,7 @@ en: almost_x_years: one: "1y" other: "%{count}y" + date_year: "D MMM 'YY" medium: x_minutes: one: "1 min" diff --git a/config/locales/client.es.yml b/config/locales/client.es.yml index e311fc372..7b4279bba 100644 --- a/config/locales/client.es.yml +++ b/config/locales/client.es.yml @@ -51,6 +51,7 @@ es: almost_x_years: one: "1a" other: "%{count}a" + date_year: "D MMM 'YY" medium: x_minutes: one: "1 minuto" diff --git a/config/locales/client.fr.yml b/config/locales/client.fr.yml index e53a3981a..2ad7ccfa8 100644 --- a/config/locales/client.fr.yml +++ b/config/locales/client.fr.yml @@ -53,6 +53,7 @@ fr: almost_x_years: one: "1y" other: "%{count}a" + date_year: "D MMM 'YY" medium: x_minutes: one: "1 min" diff --git a/config/locales/client.it.yml b/config/locales/client.it.yml index 6d3df9c71..d6e555b65 100644 --- a/config/locales/client.it.yml +++ b/config/locales/client.it.yml @@ -49,6 +49,7 @@ it: almost_x_years: one: "1a" other: "%{count}a" + date_year: "D MMM 'YY" medium: x_minutes: one: "1 minuto" diff --git a/config/locales/client.ja.yml b/config/locales/client.ja.yml index fb7c62c44..145f9cac8 100644 --- a/config/locales/client.ja.yml +++ b/config/locales/client.ja.yml @@ -49,6 +49,7 @@ ja: almost_x_years: one: "1y" other: "%{count}y" + date_year: "D MMM 'YY" medium: x_minutes: one: "1分" diff --git a/config/locales/client.ko.yml b/config/locales/client.ko.yml index 3bf306d8a..27dd7e015 100644 --- a/config/locales/client.ko.yml +++ b/config/locales/client.ko.yml @@ -49,6 +49,7 @@ ko: almost_x_years: one: "거의 1년" other: "거의 %{count}년" + date_year: "'YY M/D" medium: x_minutes: one: "1분" diff --git a/config/locales/client.nl.yml b/config/locales/client.nl.yml index 4d6733d57..d89b8ad60 100644 --- a/config/locales/client.nl.yml +++ b/config/locales/client.nl.yml @@ -53,6 +53,7 @@ nl: almost_x_years: one: 1j other: "%{count}j" + date_year: "D MMM 'YY" medium: x_minutes: one: 1 min diff --git a/config/locales/client.ru.yml b/config/locales/client.ru.yml index 0eedf4182..4da6d9fa8 100644 --- a/config/locales/client.ru.yml +++ b/config/locales/client.ru.yml @@ -72,6 +72,7 @@ ru: other: '%{count}лет' few: '%{count}лет' many: '%{count}лет' + date_year: "D MMM 'YY" medium: x_minutes: one: '1 минута' diff --git a/config/locales/client.sv.yml b/config/locales/client.sv.yml index edc7e1f5f..abb806f8d 100644 --- a/config/locales/client.sv.yml +++ b/config/locales/client.sv.yml @@ -49,6 +49,7 @@ sv: almost_x_years: one: "1y" other: "%{count}y" + date_year: "D MMM 'YY" medium: x_minutes: one: "1 min" @@ -1456,4 +1457,4 @@ sv: uncategorized: 'Okategoriserat' lightbox: - download: "ladda ned" \ No newline at end of file + download: "ladda ned" From bb54de1e9669d1e2eeb9e71ea1b913fbd3487df3 Mon Sep 17 00:00:00 2001 From: Harry Seo <harry@kakao.com> Date: Wed, 8 Jan 2014 14:46:50 +0900 Subject: [PATCH 2/2] internationalize Discourse.Formatter.tinyDateYear missed client.??_??.yml --- config/locales/client.pt_BR.yml | 1 + config/locales/client.zh_CN.yml | 1 + config/locales/client.zh_TW.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/config/locales/client.pt_BR.yml b/config/locales/client.pt_BR.yml index 1ccd7dcd2..4daa44c74 100644 --- a/config/locales/client.pt_BR.yml +++ b/config/locales/client.pt_BR.yml @@ -49,6 +49,7 @@ pt_BR: almost_x_years: one: "1y" other: "%{count}y" + date_year: "D MMM 'YY" medium: x_minutes: one: "1 minuto" diff --git a/config/locales/client.zh_CN.yml b/config/locales/client.zh_CN.yml index 11c66f6c1..9cbae1d53 100644 --- a/config/locales/client.zh_CN.yml +++ b/config/locales/client.zh_CN.yml @@ -49,6 +49,7 @@ zh_CN: almost_x_years: one: "1年" other: "%{count}年" + date_year: "D MMM 'YY" medium: x_minutes: one: "1分钟" diff --git a/config/locales/client.zh_TW.yml b/config/locales/client.zh_TW.yml index fe354cec2..438c40019 100644 --- a/config/locales/client.zh_TW.yml +++ b/config/locales/client.zh_TW.yml @@ -49,6 +49,7 @@ zh_TW: almost_x_years: one: "1年" other: "%{count}年" + date_year: "D MMM 'YY" medium: x_minutes: one: "1 分鐘"