forked from expo/expo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add additional config flag to allow forcing RTL on LTR locales (expo#…
…28129) # Why and how There's this issue that has been going on for some time 😅 expo#26532 It's due to two things: - first, the plugin on iOS still sets config keys even if there's no extra config – this is a bug that this PR fixes. - second, some apps are targeted for RTL markets and require an additional option to always force RTL, and our locale detection messes with that – I added a new field to the extra manifest field and config plugin options. New key is: ``` app.json > expo > extra > forcesRTL ``` # Test Plan Performed the following tests: | | prebuild app | expo go | |---------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ios | if none set:<br><br>LTR/RTL depend on calling I18nManager.(force/allow)RTL – built in react-native behavior<br><br>if extra.forcesRTL true:<br><br>app RTL, I18nManager.isRTL true<br><br>if extra.supportsRTL true:<br><br>LTR/RTL depend on locale | if none set:<br><br>app LTR, I18nManager.isRTL false<br><br>if extra.forcesRTL true:<br><br>app RTL, I18nManager.isRTL true<br><br>if extra.supportsRTL true:<br><br>LTR/RTL depend on locale | | android | if none set:<br><br>LTR/RTL depend on calling I18nManager.(force/allow)RTL – built in react-native behavior<br><br>if extra.forcesRTL true:<br><br>app RTL, I18nManager.isRTL true<br><br>if extra.supportsRTL true:<br><br>LTR/RTL depend on locale | if none set:<br><br>app LTR, I18nManager.isRTL false<br><br>if extra.forcesRTL true:<br><br>app RTL, I18nManager.isRTL true<br><br>if extra.supportsRTL true:<br><br>LTR/RTL depend on locale | # Checklist <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). --------- Co-authored-by: Expo Bot <[email protected]>
- Loading branch information
Showing
13 changed files
with
151 additions
and
49 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
1 change: 1 addition & 0 deletions
1
packages/expo-localization/android/src/main/res/values/strings.xml
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="ExpoLocalization_supportsRTL" translatable="false">unset</string> | ||
<string name="ExpoLocalization_forcesRTL" translatable="false">unset</string> | ||
</resources> |
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
1 change: 1 addition & 0 deletions
1
packages/expo-localization/plugin/build/withExpoLocalization.d.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
35 changes: 26 additions & 9 deletions
35
packages/expo-localization/plugin/build/withExpoLocalization.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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