Override legacy language codes for indonesian, hebrew, and yiddish (#4461)
* Manually override incorrect 'in' to 'id' lang code * Fix additional legacy language code issues
This commit is contained in:
parent
620ab88713
commit
59f49bef68
2 changed files with 20 additions and 2 deletions
|
@ -2,6 +2,7 @@ import {Platform} from 'react-native'
|
|||
import {isReducedMotion} from 'react-native-reanimated'
|
||||
import {getLocales} from 'expo-localization'
|
||||
|
||||
import {fixLegacyLanguageCode} from '#/locale/helpers'
|
||||
import {dedupArray} from 'lib/functions'
|
||||
|
||||
export const isIOS = Platform.OS === 'ios'
|
||||
|
@ -17,7 +18,7 @@ export const isMobileWeb =
|
|||
|
||||
export const deviceLocales = dedupArray(
|
||||
getLocales?.()
|
||||
.map?.(locale => locale.languageCode)
|
||||
.map?.(locale => fixLegacyLanguageCode(locale.languageCode))
|
||||
.filter(code => typeof code === 'string'),
|
||||
) as string[]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue