File tree Expand file tree Collapse file tree 2 files changed +8
-15
lines changed Expand file tree Collapse file tree 2 files changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,7 @@ import { FlatList } from 'react-native';
55import type { GetText } from '../types' ;
66import { TranslationContext } from '../boot/TranslationProvider' ;
77import { OptionDivider } from '../common' ;
8- import languages from './languages' ;
9- import type { Language } from './languages' ;
8+ import { type Language , languageData } from '../i18n/language_list' ;
109import LanguagePickerItem from './LanguagePickerItem' ;
1110
1211type Props = $ReadOnly < { |
@@ -15,6 +14,13 @@ type Props = $ReadOnly<{|
1514 filter : string ,
1615| } > ;
1716
17+ const sortForDisplay = ( arr : $ReadOnlyArray < Language > ) : $ReadOnlyArray < Language > =>
18+ [ ...arr ] . sort ( ( a , b ) =>
19+ a . locale === 'en' ? - 1 : b . locale === 'en' ? + 1 : a . name < b . name ? - 1 : + 1 ,
20+ ) ;
21+
22+ const languages : $ReadOnlyArray < Language > = sortForDisplay(languageData);
23+
1824export default class LanguagePicker extends PureComponent< Props > {
1925 static contextType = TranslationContext ;
2026 context : GetText ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments