about summary refs log tree commit diff
path: root/src/locale/helpers.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/locale/helpers.ts')
-rw-r--r--src/locale/helpers.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/locale/helpers.ts b/src/locale/helpers.ts
index 65db32f2f..4d01459ab 100644
--- a/src/locale/helpers.ts
+++ b/src/locale/helpers.ts
@@ -84,3 +84,15 @@ export function getTranslatorLink(text: string, lang: string): string {
     text,
   )}`
 }
+
+export function sanitizeAppLanguageSetting(appLanguage: string) {
+  const langs = appLanguage.split(',').filter(Boolean)
+
+  for (const lang of langs) {
+    if (['en', 'hi'].includes(lang)) {
+      return lang
+    }
+  }
+
+  return 'en'
+}