diff --git a/__mocks__/react-native-localize.ts b/__mocks__/react-native-localize.ts index cf4145ad0014..017e08b2e08a 100644 --- a/__mocks__/react-native-localize.ts +++ b/__mocks__/react-native-localize.ts @@ -1,8 +1,8 @@ // use a provided translation, or return undefined to test your fallback -const findBestAvailableLanguage = () => ({ +const findBestLanguageTag = () => ({ languageTag: 'en', isRTL: false, }); // eslint-disable-next-line import/prefer-default-export -export {findBestAvailableLanguage}; +export {findBestLanguageTag}; diff --git a/ios/Podfile.lock b/ios/Podfile.lock index a9f5e52072fd..8d995e70cb16 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -2857,8 +2857,30 @@ PODS: - ReactCommon/turbomodule/core - RNReanimated/worklets - Yoga - - RNLocalize (2.2.6): + - RNLocalize (3.5.4): + - DoubleConversion + - glog + - hermes-engine + - RCT-Folly (= 2024.11.18.00) + - RCTRequired + - RCTTypeSafety - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-hermes + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - Yoga - rnmapbox-maps (10.1.44): - MapboxMaps (~> 10.19.0) - React @@ -3812,7 +3834,7 @@ SPEC CHECKSUMS: React-microtasksnativemodule: 8fc1bfccd27980ed6cfec1f52ffcd6af336f48f7 react-native-advanced-input-mask: e5fa44f25ae16ab5b8da75b5aed4236a5400a770 react-native-airship: ff2599900d29e0e64ff2b2dd9f897c0c220a9163 - react-native-app-logs: 45d7515e7a92e61be56dffb10f315b578dedee01 + react-native-app-logs: 6540c5f6f66f33cb52d0bb62f0a10131ff3a9589 react-native-blob-util: a013bd1bb12de304a726c2308cc0e219f34ab66c react-native-cameraroll: d98f8a64b53620754864c33a034e054ca4a3b360 react-native-config: ab9f9cc16883aed5355ca43478fe39e6aec5ebb9 @@ -3877,7 +3899,7 @@ SPEC CHECKSUMS: RNGestureHandler: 61d3e94abb866ee955563ddf073e405e3f541359 RNGoogleSignin: ccaa4a81582cf713eea562c5dd9dc1961a715fd0 RNLiveMarkdown: 6a36c82776afa8fd2c41c2c6e299c6dd77f249ce - RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81 + RNLocalize: e3a384870bd61fccfcc46de28089371907ed2e14 rnmapbox-maps: f3875edd847c82d770d1b57852b36d45b3ea8a01 RNNitroSQLite: e36968e81bbcab6c9e97a35e74ae34c7420d734c RNPermissions: fd6b2676e74ecb6d2dec0a6168502ab7af733e34 diff --git a/package-lock.json b/package-lock.json index eee6aa3eced6..dca3f581e1a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -114,7 +114,7 @@ "react-native-key-command": "1.0.14", "react-native-keyboard-controller": "1.18.5", "react-native-launch-arguments": "^4.0.2", - "react-native-localize": "^2.2.6", + "react-native-localize": "^3.5.4", "react-native-nitro-modules": "0.29.4", "react-native-nitro-sqlite": "9.1.11", "react-native-onyx": "3.0.6", @@ -32161,19 +32161,21 @@ } }, "node_modules/react-native-localize": { - "version": "2.2.6", + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/react-native-localize/-/react-native-localize-3.5.4.tgz", + "integrity": "sha512-Sr0XMSh76vFxZtRznD5FE8ZZtA4Srr7+Ix4WePhoQdeiJzuJEFbiQ2Lk3JJhsTMZdsZKn3j1KUwpV3hhnm2BqA==", "license": "MIT", "peerDependencies": { - "react": ">=16.8.6", - "react-native": ">=0.60.0", - "react-native-macos": ">=0.64.0", - "react-native-windows": ">=0.62.0" + "@expo/config-plugins": "^9.0.0 || ^10.0.0", + "react": "*", + "react-native": "*", + "react-native-macos": "*" }, "peerDependenciesMeta": { - "react-native-macos": { + "@expo/config-plugins": { "optional": true }, - "react-native-windows": { + "react-native-macos": { "optional": true } } diff --git a/package.json b/package.json index ed4ca3c45f57..b677c4da3c71 100644 --- a/package.json +++ b/package.json @@ -185,7 +185,7 @@ "react-native-key-command": "1.0.14", "react-native-keyboard-controller": "1.18.5", "react-native-launch-arguments": "^4.0.2", - "react-native-localize": "^2.2.6", + "react-native-localize": "^3.5.4", "react-native-nitro-modules": "0.29.4", "react-native-nitro-sqlite": "9.1.11", "react-native-onyx": "3.0.6", diff --git a/src/libs/Localize/index.ts b/src/libs/Localize/index.ts index 1c47327eee16..f76055f17612 100644 --- a/src/libs/Localize/index.ts +++ b/src/libs/Localize/index.ts @@ -195,7 +195,7 @@ function formatMessageElementList(elements: readon * Returns the user device's preferred language. */ function getDevicePreferredLocale(): Locale { - return RNLocalize.findBestAvailableLanguage(Object.values(CONST.LOCALES))?.languageTag ?? CONST.LOCALES.DEFAULT; + return RNLocalize.findBestLanguageTag(Object.values(CONST.LOCALES))?.languageTag ?? CONST.LOCALES.DEFAULT; } // eslint-disable-next-line @typescript-eslint/no-deprecated