This commit is contained in:
Tom Moor
2022-04-09 20:25:54 -07:00
parent 48fad5cfa0
commit 9281287dba
15 changed files with 56 additions and 38 deletions

View File

@@ -1,3 +1,5 @@
import { i18n } from "i18next";
export function detectLanguage() {
const [ln, r] = navigator.language.split("-");
const region = (r || ln).toUpperCase();
@@ -6,7 +8,7 @@ export function detectLanguage() {
export function changeLanguage(
toLanguageString: string | null | undefined,
i18n: any
i18n: i18n
) {
if (toLanguageString && i18n.language !== toLanguageString) {
// Languages are stored in en_US format in the database, however the