Patch bad migration, sanitize bad value (#2179)
This commit is contained in:
parent
3592f6f50b
commit
bae63f9bf0
4 changed files with 18 additions and 3 deletions
|
@ -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'
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue