File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import type TranslateOptions from 'i18next';
22import i18n from 'i18next' ;
33import memoize from 'lodash.memoize' ;
44import { useCallback } from 'react' ;
5- import { I18nManager , NativeModules } from 'react-native' ;
5+ import { I18nManager , NativeModules , Platform } from 'react-native' ;
66import { useMMKVString } from 'react-native-mmkv' ;
77import RNRestart from 'react-native-restart' ;
88
@@ -31,8 +31,12 @@ export const changeLanguage = (lang: Language) => {
3131 } else {
3232 I18nManager . forceRTL ( false ) ;
3333 }
34- if ( __DEV__ ) NativeModules . DevSettings . reload ( ) ;
35- else RNRestart . restart ( ) ;
34+ if ( Platform . OS === 'ios' || Platform . OS === 'android' ) {
35+ if ( __DEV__ ) NativeModules . DevSettings . reload ( ) ;
36+ else RNRestart . restart ( ) ;
37+ } else if ( Platform . OS === 'web' ) {
38+ window . location . reload ( ) ;
39+ }
3640} ;
3741
3842export const useSelectedLanguage = ( ) => {
You can’t perform that action at this time.
0 commit comments