File tree Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Expand file tree Collapse file tree 3 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ import App from '@/App';
99
1010import 'moment/locale/de' ;
1111import 'moment/locale/en-gb' ;
12+ import 'moment/locale/fr' ;
13+ import 'moment/locale/it' ;
1214import 'react-native-get-random-values' ;
1315import 'react-native-url-polyfill/auto' ;
1416import '@/utils/rsplit' ;
Original file line number Diff line number Diff line change @@ -273,10 +273,19 @@ const _App: FC = () => {
273273 setI18nLanguageMatchesSettings ( false ) ;
274274 i18n . changeLanguage ( language ) ;
275275
276- if ( language === 'en' ) {
277- moment . locale ( 'en-gb' ) ;
278- } else {
279- moment . locale ( language ) ;
276+ let momentLocale = '' ;
277+
278+ switch ( language ) {
279+ case 'en' :
280+ momentLocale = 'en-gb' ;
281+ break ;
282+ default :
283+ momentLocale = language ;
284+ break ;
285+ }
286+
287+ if ( moment . locales ( ) . includes ( momentLocale ) ) {
288+ moment . locale ( momentLocale ) ;
280289 }
281290 } , [ i18n , language ] ) ;
282291
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ if (!i18n.isInitialized) {
4444 debug : __DEV__ ,
4545 nonExplicitSupportedLngs : true ,
4646 supportedLngs : supportedLanguages ,
47+ returnEmptyString : false ,
4748 } ) ;
4849}
4950
You can’t perform that action at this time.
0 commit comments