Initial commit
This commit is contained in:
9
src/utils/changeLanguage.ts
Normal file
9
src/utils/changeLanguage.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import AsyncStorage from '@react-native-async-storage/async-storage';
|
||||
import i18n from 'i18n/i18n';
|
||||
|
||||
export const changeLanguage = async (lang: string) => {
|
||||
try {
|
||||
await AsyncStorage.setItem('language', lang);
|
||||
await i18n.changeLanguage(lang);
|
||||
} catch (error) {}
|
||||
};
|
||||
Reference in New Issue
Block a user