feat: Auto detect language on login page access (#2338)
* feat: Auto detect language on login page access * fix: Apply tommoor suggested changes * fix: QOL improvements for translators * fix: consistency fix provider -> authProviderName Co-authored-by: Tom Moor <tom.moor@gmail.com>
This commit is contained in:
@ -5,3 +5,11 @@ export function detectLanguage() {
|
||||
const region = (r || ln).toUpperCase();
|
||||
return `${ln}_${region}`;
|
||||
}
|
||||
|
||||
export function changeLanguage(toLanguageString, i18n) {
|
||||
if (toLanguageString && i18n.language !== toLanguageString) {
|
||||
// Languages are stored in en_US format in the database, however the
|
||||
// frontend translation framework (i18next) expects en-US
|
||||
i18n.changeLanguage(toLanguageString.replace("_", "-"));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user