|
|
|
@ -21,7 +21,7 @@ Meteor.startup(() => { |
|
|
|
|
const regex = /([a-z]{2,3})-([a-z]{2,4})/; |
|
|
|
|
const matches = regex.exec(language); |
|
|
|
|
if (matches) { |
|
|
|
|
return `${ matches[1] }-${ matches[2].toUpperCase() }`; |
|
|
|
|
return `${ matches[1] }-${ matches[2].toLowerCase() }`; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return language; |
|
|
|
@ -56,8 +56,9 @@ Meteor.startup(() => { |
|
|
|
|
if (!language) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
document.documentElement.classList[isRtl(language) ? 'add' : 'remove']('rtl'); |
|
|
|
|
document.querySelector('html').lang = language; |
|
|
|
|
|
|
|
|
|
TAPi18n.setLanguage(language); |
|
|
|
|
loadMomentLocale(language) |
|
|
|
|
.then((locale) => moment.locale(locale)) |
|
|
|
|