From 3a76f9e79f325fefed6bfeef29ad3ff131b877b3 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Wed, 27 Aug 2014 20:56:56 +0530 Subject: [PATCH] FIX: allow localization in timestamp --- app/assets/javascripts/discourse/lib/formatter.js | 4 ++-- config/locales/client.en.yml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/formatter.js b/app/assets/javascripts/discourse/lib/formatter.js index f2688a2e4..3885eeabc 100644 --- a/app/assets/javascripts/discourse/lib/formatter.js +++ b/app/assets/javascripts/discourse/lib/formatter.js @@ -80,9 +80,9 @@ longDateNoYear = function(dt) { if (!dt) return; if ((new Date()).getFullYear() !== dt.getFullYear()) { - return moment(dt).format("MMM D, 'YY LT"); + return moment(dt).format(I18n.t("dates.long_date_with_year")); } else { - return moment(dt).format("MMM D, LT"); + return moment(dt).format(I18n.t("dates.long_date_without_year")); } }; diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index ce7a7811b..7fe3c5299 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -35,6 +35,8 @@ en: long_no_year_no_time: "MMM D" long_with_year: "MMM D, YYYY h:mm a" long_with_year_no_time: "MMM D, YYYY" + long_date_with_year: "MMM D, 'YY LT" + long_date_without_year: "MMM D, LT" tiny: half_a_minute: "< 1m" less_than_x_seconds: