From 2430b970f3cf6e947df7c1132777e688b0fd6fd9 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Sat, 29 Mar 2014 17:44:13 -0400 Subject: [PATCH] fixed issue where timeago strings were not rendering in the correct language on cold loads --- public/src/translator.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/src/translator.js b/public/src/translator.js index a190500ee6..c64775f9fa 100644 --- a/public/src/translator.js +++ b/public/src/translator.js @@ -57,7 +57,9 @@ break; } - $.getScript(RELATIVE_PATH + '/vendor/jquery/timeago/locales/jquery.timeago.' + languageCode + '.js').fail(function() { + $.getScript(RELATIVE_PATH + '/vendor/jquery/timeago/locales/jquery.timeago.' + languageCode + '.js').success(function() { + $('span.timeago').timeago(); + }).fail(function() { $.getScript(RELATIVE_PATH + '/vendor/jquery/timeago/locales/jquery.timeago.en.js'); });