fix: n.languages is undefined (type seems incorrect here?)

This commit is contained in:
Tom Moor
2023-05-17 22:50:47 -04:00
parent a19c19985e
commit ce87624289

View File

@@ -16,7 +16,7 @@ export function changeLanguage(
? unicodeCLDRtoBCP47(toLanguageString)
: undefined;
if (locale && i18n.languages[0] !== locale) {
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
i18n.changeLanguage(locale);