cleanup
This commit is contained in:
@@ -12,13 +12,13 @@ export async function changeLanguage(
|
||||
toLanguageString: string | null | undefined,
|
||||
i18n: i18n
|
||||
) {
|
||||
// Languages are stored in en_US format in the database, however the
|
||||
// frontend translation framework (i18next) expects en-US
|
||||
const locale = toLanguageString
|
||||
? unicodeCLDRtoBCP47(toLanguageString)
|
||||
: undefined;
|
||||
|
||||
if (locale && i18n.languages?.[0] !== locale) {
|
||||
// Languages are stored in en_US format in the database, however the
|
||||
// frontend translation framework (i18next) expects en-US
|
||||
await i18n.changeLanguage(locale);
|
||||
await Desktop.bridge?.setSpellCheckerLanguages(["en-US", locale]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user