Skip to content

Commit

Permalink
localeIdentifier missing from flow type of I18nManager (#31589)
Browse files Browse the repository at this point in the history
Summary:
23d9bf1 looks like it accidently removed `localeIdentifier` from I18nManager.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General] [Fixed] - Re-added localeIdentifier to I18nManager constants

Pull Request resolved: #31589

Reviewed By: GijsWeterings

Differential Revision: D28690202

Pulled By: fkgozali

fbshipit-source-id: 543a491f89789bca5629e1251c94fd055ec4a801
  • Loading branch information
acoates-ms authored and tido64 committed Jun 8, 2021
1 parent f15cd42 commit 408265d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Libraries/ReactNative/I18nManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ import NativeI18nManager from './NativeI18nManager';
const i18nConstants: {|
doLeftAndRightSwapInRTL: boolean,
isRTL: boolean,
localeIdentifier?: ?string,
|} = getI18nManagerConstants();

function getI18nManagerConstants() {
if (NativeI18nManager) {
const {isRTL, doLeftAndRightSwapInRTL} = NativeI18nManager.getConstants();
return {isRTL, doLeftAndRightSwapInRTL};
const {
isRTL,
doLeftAndRightSwapInRTL,
localeIdentifier,
} = NativeI18nManager.getConstants();
return {isRTL, doLeftAndRightSwapInRTL, localeIdentifier};
}

return {
Expand All @@ -28,7 +33,11 @@ function getI18nManagerConstants() {
}

module.exports = {
getConstants: (): {|doLeftAndRightSwapInRTL: boolean, isRTL: boolean|} => {
getConstants: (): {|
doLeftAndRightSwapInRTL: boolean,
isRTL: boolean,
localeIdentifier: ?string,
|} => {
return i18nConstants;
},

Expand Down

0 comments on commit 408265d

Please sign in to comment.