From 6b91ae73cdf096e15a3235ae76276f9d7fb12f7b Mon Sep 17 00:00:00 2001 From: Andrew Coates <30809111+acoates-ms@users.noreply.github.com> Date: Wed, 26 May 2021 00:03:02 -0700 Subject: [PATCH] localeIdentifier missing from flow type of I18nManager (#31589) Summary: https://github.com/facebook/react-native/commit/23d9bf1a24f80003a8a3c0b82e9b5691e4e6544e looks like it accidently removed `localeIdentifier` from I18nManager. ## Changelog [General] [Fixed] - Re-added localeIdentifier to I18nManager constants Pull Request resolved: https://github.com/facebook/react-native/pull/31589 Reviewed By: GijsWeterings Differential Revision: D28690202 Pulled By: fkgozali fbshipit-source-id: 543a491f89789bca5629e1251c94fd055ec4a801 --- Libraries/ReactNative/I18nManager.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Libraries/ReactNative/I18nManager.js b/Libraries/ReactNative/I18nManager.js index 9fa21e78dacc22..1095ab81cdb3ee 100644 --- a/Libraries/ReactNative/I18nManager.js +++ b/Libraries/ReactNative/I18nManager.js @@ -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 { @@ -28,7 +33,11 @@ function getI18nManagerConstants() { } module.exports = { - getConstants: (): {|doLeftAndRightSwapInRTL: boolean, isRTL: boolean|} => { + getConstants: (): {| + doLeftAndRightSwapInRTL: boolean, + isRTL: boolean, + localeIdentifier: ?string, + |} => { return i18nConstants; },