Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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