Handle language selector

This commit is contained in:
Eric Bailey
2023-12-12 09:08:13 -06:00
parent d82b1a1047
commit 36e351e965
+2 -1
View File
@@ -21,6 +21,7 @@ import {useModalControls} from '#/state/modals'
import {useLanguagePrefs, useLanguagePrefsApi} from '#/state/preferences' import {useLanguagePrefs, useLanguagePrefsApi} from '#/state/preferences'
import {Trans, msg} from '@lingui/macro' import {Trans, msg} from '@lingui/macro'
import {useLingui} from '@lingui/react' import {useLingui} from '@lingui/react'
import {sanitizeAppLanguageSetting} from '#/locale/helpers'
type Props = NativeStackScreenProps<CommonNavigatorParams, 'LanguageSettings'> type Props = NativeStackScreenProps<CommonNavigatorParams, 'LanguageSettings'>
@@ -103,7 +104,7 @@ export function LanguageSettingsScreen(_props: Props) {
<View style={{position: 'relative'}}> <View style={{position: 'relative'}}>
<RNPickerSelect <RNPickerSelect
placeholder={{}} placeholder={{}}
value={langPrefs.appLanguage} value={sanitizeAppLanguageSetting(langPrefs.appLanguage)}
onValueChange={onChangeAppLanguage} onValueChange={onChangeAppLanguage}
items={APP_LANGUAGES.filter(l => Boolean(l.code2)).map(l => ({ items={APP_LANGUAGES.filter(l => Boolean(l.code2)).map(l => ({
label: l.name, label: l.name,