-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement the capability to change the language between tests (#873)
* pipe language through to xcrun launch * Revert "pipe language through to xcrun launch" This reverts commit 797a3dd. * pipe the thing through for real this time * pass the other arg * remove console.logs * pass language prop to android * remove a newline * fix unit tests * add a unit test * re-apply changes and fix unit tests * add a locale option * update unit test * 100% test coverage * temp rename unneeded test files * temp use iphone 6 * install and link react-native-device-info * add boilerplate for a language screen * render current country and locale in test app * add e2e test * add language UI to language screen * update e2e * Revert "install and link react-native-device-info" This reverts commit 9ee6c55. * e2e test is passing * clean up language screen * temp switch emulator * add language support to test app for android * Revert "add language support to test app for android" This reverts commit 6b1b446. * add android support to language screen * update android API * Revert "temp switch emulator" This reverts commit 971fb09. * Revert "temp use iphone 6" This reverts commit c11308d. * Revert "temp rename unneeded test files" This reverts commit 9de21e5. * uncomment some tests * comment out the not cross-plat test * update docs
- Loading branch information
1 parent
ebec396
commit 50ee994
Showing
12 changed files
with
163 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React, { Component } from 'react'; | ||
import { Text, View, NativeModules, Platform } from 'react-native'; | ||
import _ from 'lodash'; | ||
|
||
export default class LanguageScreen extends Component { | ||
render() { | ||
|
||
const locale = Platform.select({ | ||
ios: () => NativeModules.SettingsManager.settings.AppleLocale, | ||
android: () => NativeModules.I18nManager.localeIdentifier | ||
})(); | ||
|
||
const language = Platform.select({ | ||
ios: () => _.take(NativeModules.SettingsManager.settings.AppleLanguages, 1), | ||
android: () => 'Unavailable' | ||
})(); | ||
|
||
return ( | ||
<View style={{ flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center' }}> | ||
<Text style={{ fontSize: 25, marginBottom: 30 }}>Current locale: {locale}</Text> | ||
<Text style={{ fontSize: 25, marginBottom: 30 }}> | ||
Current language: {language} | ||
</Text> | ||
</View> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters