Handle language selector
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user