An ATproto social media client -- with an independent Appview.
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Override legacy language codes for indonesian, hebrew, and yiddish (#4461)

* Manually override incorrect 'in' to 'id' lang code

* Fix additional legacy language code issues

authored by

Paul Frazee and committed by
GitHub
59f49bef 620ab887

+20 -2
+18 -1
src/locale/helpers.ts
··· 116 116 const langs = appLanguage.split(',').filter(Boolean) 117 117 118 118 for (const lang of langs) { 119 - switch (lang) { 119 + switch (fixLegacyLanguageCode(lang)) { 120 120 case 'en': 121 121 return AppLanguage.en 122 122 case 'ca': ··· 157 157 } 158 158 return AppLanguage.en 159 159 } 160 + 161 + export function fixLegacyLanguageCode(code: string | null): string | null { 162 + // handle some legacy code conversions, see https://xml.coverpages.org/iso639a.html 163 + if (code === 'in') { 164 + // indonesian 165 + return 'id' 166 + } 167 + if (code === 'iw') { 168 + // hebrew 169 + return 'he' 170 + } 171 + if (code === 'ji') { 172 + // yiddish 173 + return 'yi' 174 + } 175 + return code 176 + }
+2 -1
src/platform/detection.ts
··· 2 2 import {isReducedMotion} from 'react-native-reanimated' 3 3 import {getLocales} from 'expo-localization' 4 4 5 + import {fixLegacyLanguageCode} from '#/locale/helpers' 5 6 import {dedupArray} from 'lib/functions' 6 7 7 8 export const isIOS = Platform.OS === 'ios' ··· 17 18 18 19 export const deviceLocales = dedupArray( 19 20 getLocales?.() 20 - .map?.(locale => locale.languageCode) 21 + .map?.(locale => fixLegacyLanguageCode(locale.languageCode)) 21 22 .filter(code => typeof code === 'string'), 22 23 ) as string[] 23 24