diff --git a/app/i18n/index.js b/app/i18n/index.js index 4a2404c3f..1fe215879 100644 --- a/app/i18n/index.js +++ b/app/i18n/index.js @@ -108,10 +108,21 @@ function loadTranslation(locale) { } } +let momentLocale = DEFAULT_LOCALE; + +function setMomentLocale(locale) { + if (momentLocale !== locale) { + momentLocale = moment.locale(locale); + } +} + export function getTranslations(locale) { if (!TRANSLATIONS[locale]) { loadTranslation(locale); } + + setMomentLocale(locale.toLowerCase()); + return TRANSLATIONS[locale] || TRANSLATIONS[DEFAULT_LOCALE]; }