Skip to content

Commit c598cf0

Browse files
renovate[bot]satish-ravivalora-bot
authored
fix(deps): update dependency react-native-localize to v3 (#5310)
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [react-native-localize](https://togithub.com/zoontek/react-native-localize) | [`^2.2.6` -> `^3.1.0`](https://renovatebot.com/diffs/npm/react-native-localize/2.2.6/3.1.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/react-native-localize/3.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/react-native-localize/3.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/react-native-localize/2.2.6/3.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/react-native-localize/2.2.6/3.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>zoontek/react-native-localize (react-native-localize)</summary> ### [`v3.1.0`](https://togithub.com/zoontek/react-native-localize/releases/tag/3.1.0) [Compare Source](https://togithub.com/zoontek/react-native-localize/compare/3.0.6...3.1.0) - Add visionOS support by [@&#8203;Saadnajmi](https://togithub.com/Saadnajmi) in [https://github.com/zoontek/react-native-localize/pull/253](https://togithub.com/zoontek/react-native-localize/pull/253) ### [`v3.0.6`](https://togithub.com/zoontek/react-native-localize/releases/tag/3.0.6) [Compare Source](https://togithub.com/zoontek/react-native-localize/compare/3.0.5...3.0.6) - Update mock and testing instructions ### [`v3.0.5`](https://togithub.com/zoontek/react-native-localize/releases/tag/3.0.5) [Compare Source](https://togithub.com/zoontek/react-native-localize/compare/3.0.4...3.0.5) - Add Android Gradle plugin 8 compatibility - Fix `AndroidManifest.xml` namespace deprecation warning ### [`v3.0.4`](https://togithub.com/zoontek/react-native-localize/releases/tag/3.0.4) [Compare Source](https://togithub.com/zoontek/react-native-localize/compare/3.0.3...3.0.4) - Remove duplicate `RNLocalizeSpec.h` import when new architecture is enabled (fix [#&#8203;238](https://togithub.com/zoontek/react-native-localize/issues/238)) ### [`v3.0.3`](https://togithub.com/zoontek/react-native-localize/releases/tag/3.0.3) [Compare Source](https://togithub.com/zoontek/react-native-localize/compare/3.0.2...3.0.3) - Use [`LocaleListCompat.getDefault()`](https://developer.android.com/reference/androidx/core/os/LocaleListCompat#getDefault\(\)) to fix preferred languages list order in some rare cases (fix [#&#8203;236](https://togithub.com/zoontek/react-native-localize/issues/236)) ### [`v3.0.2`](https://togithub.com/zoontek/react-native-localize/releases/tag/3.0.2) [Compare Source](https://togithub.com/zoontek/react-native-localize/compare/3.0.1...3.0.2) - Use gradle `namespace` conditionally in order to improve old react native version compatibility. *⚠️ Note that this library officially now follows the React Native [releases support policy](https://togithub.com/reactwg/react-native-releases#releases-support-policy). If you have been impacted by this bug, that means you are using an unsupported react native version and should upgrade to the latest.* ### [`v3.0.1`](https://togithub.com/zoontek/react-native-localize/releases/tag/3.0.1) [Compare Source](https://togithub.com/zoontek/react-native-localize/compare/3.0.0...3.0.1) - Add gradle `namespace` for react native 0.73 compatibility ### [`v3.0.0`](https://togithub.com/zoontek/react-native-localize/releases/tag/3.0.0) [Compare Source](https://togithub.com/zoontek/react-native-localize/compare/2.2.6...3.0.0) #### 3.0.0: New architecture support 🎉 This release come with a huge change underneath: Instead of constants, the library now perform synchronous methods calls (on both old and new architecture), which means the returned informations will always be up-to-date (fixes [https://github.com/zoontek/react-native-localize/issues/186](https://togithub.com/zoontek/react-native-localize/issues/186)). This also means that remote debugging (e.g. with Chrome) is no longer possible and that you should switch to [Flipper 🐬](https://fbflipper.com) (an acceptable trade-off as remote debugging isn't possible with the new architecture anyway) ##### Other changes: - Drop support for: - `react-native-windows` (temporarily) - `react-native`, `react-native-macos` < 0.70 - `react-native-web` < 0.18 - Android < 5 - iOS and tvOS < 12.4 - Remove `addEventListener` as you can now safely rely on [`AppState` ](https://reactnative.dev/docs/appstate)and get the possible new value when app become `active` (fixes [https://github.com/zoontek/react-native-localize/issues/91](https://togithub.com/zoontek/react-native-localize/issues/91)) - `getCalendar` can now return all supported macOS calendars (`buddhist`, `coptic`, `ethiopic`, `hebrew`…) - `findBestAvailableLanguage` has been renamed `findBestLanguageTag` - Package default export has been removed. If you really want to import everything, use `import * as Localize from "react-native-localize"` instead </details> --- ### Configuration 📅 **Schedule**: Branch creation - "after 5pm,every weekend" in timezone America/Los_Angeles, Automerge - "after 5pm,every weekend" in timezone America/Los_Angeles. 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/valora-inc/wallet). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMTMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjMxMy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJucG0iLCJyZW5vdmF0ZSJdfQ==--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Satish Ravi <[email protected]> Co-authored-by: valora-bot <[email protected]>
1 parent 950fa63 commit c598cf0

File tree

8 files changed

+25
-35
lines changed

8 files changed

+25
-35
lines changed

__mocks__/react-native-localize.ts

+11-19
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
1-
import { NativeModules } from 'react-native'
2-
3-
NativeModules.RNLocalize = {
4-
initialConstants: {
5-
locales: [
6-
{
7-
languageCode: 'en',
8-
countryCode: 'US',
9-
languageTag: 'en-US',
10-
isRTL: false,
11-
},
12-
],
13-
currencies: ['MXN', 'USD'],
14-
country: 'US',
15-
},
16-
}
17-
181
module.exports = {
19-
...jest.requireActual('react-native-localize'),
202
getNumberFormatSettings: jest.fn(() => ({
213
decimalSeparator: '.',
224
groupingSeparator: ',',
235
})),
246
getTimeZone: jest.fn(() => 'America/New_York'),
25-
findBestAvailableLanguage: jest.fn(() => ({ languageTag: 'en-US', isRTL: true })),
7+
findBestLanguageTag: jest.fn(() => ({ languageTag: 'en-US', isRTL: true })),
8+
getCountry: jest.fn(() => 'US'),
9+
getCurrencies: jest.fn(() => ['MXN', 'USD']),
10+
getLocales: jest.fn(() => [
11+
{
12+
languageCode: 'en',
13+
countryCode: 'US',
14+
languageTag: 'en-US',
15+
isRTL: false,
16+
},
17+
]),
2618
}

ios/Podfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ PODS:
713713
- TOCropViewController
714714
- RNKeychain (8.1.3):
715715
- React-Core
716-
- RNLocalize (2.2.6):
716+
- RNLocalize (3.1.0):
717717
- React-Core
718718
- RNPermissions (4.1.5):
719719
- React-Core
@@ -1249,7 +1249,7 @@ SPEC CHECKSUMS:
12491249
RNGestureHandler: 69d0a928253547ef857a7be4f453220b9c472e07
12501250
RNImageCropPicker: e7ab6fb43d2fc3e84651e786ef4a080d63b0ed3d
12511251
RNKeychain: f1b48665a4646f61191eb048c4c05c58d9a7596f
1252-
RNLocalize: d4b8af4e442d4bcca54e68fc687a2129b4d71a81
1252+
RNLocalize: e8694475db034bf601e17bd3dfa8986565e769eb
12531253
RNPermissions: da2a4ded375aa8292d85ed93676e102c203d4717
12541254
RNPersonaInquiry2: 3ab52078e891a5d2fa39bf7cc9119ca27f0337fd
12551255
RNReactNativeHapticFeedback: ec56a5f81c3941206fd85625fa669ffc7b4545f9

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
"react-native-keychain": "^8.1.3",
166166
"react-native-launch-arguments": "^4.0.2",
167167
"react-native-linear-gradient": "^2.8.3",
168-
"react-native-localize": "^2.2.6",
168+
"react-native-localize": "^3.1.0",
169169
"react-native-modal": "^13.0.1",
170170
"react-native-permissions": "^4.1.5",
171171
"react-native-persona": "^2.2.23",

src/app/AppInitGate.test.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ describe('AppInitGate', () => {
8181

8282
it('should update the language if none was set', async () => {
8383
jest
84-
.spyOn(RNLocalize, 'findBestAvailableLanguage')
84+
.spyOn(RNLocalize, 'findBestLanguageTag')
8585
.mockReturnValue({ languageTag: 'de-DE', isRTL: true })
8686

8787
const { getByText, store } = renderAppInitGate(null)

src/app/AppInitGate.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import locales from 'locales'
22
import React, { useEffect } from 'react'
33
import { useAsync } from 'react-async-hook'
44
import { Dimensions } from 'react-native'
5-
import { findBestAvailableLanguage } from 'react-native-localize'
5+
import { findBestLanguageTag } from 'react-native-localize'
66
import { AppEvents } from 'src/analytics/Events'
77
import ValoraAnalytics from 'src/analytics/ValoraAnalytics'
88
import { appMounted, appUnmounted } from 'src/app/actions'
@@ -28,9 +28,7 @@ const AppInitGate = ({ appStartedMillis, reactLoadTime, children }: Props) => {
2828
const dispatch = useDispatch()
2929

3030
const language = useSelector(currentLanguageSelector)
31-
const bestLanguage = !isE2EEnv
32-
? findBestAvailableLanguage(Object.keys(locales))?.languageTag
33-
: 'en-US'
31+
const bestLanguage = !isE2EEnv ? findBestLanguageTag(Object.keys(locales))?.languageTag : 'en-US'
3432

3533
useEffect(() => {
3634
return () => {

src/app/saga.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ describe('appInit', () => {
731731

732732
it('should initialise with the best language', async () => {
733733
jest
734-
.spyOn(RNLocalize, 'findBestAvailableLanguage')
734+
.spyOn(RNLocalize, 'findBestLanguageTag')
735735
.mockReturnValue({ languageTag: 'de-DE', isRTL: true })
736736

737737
await expectSaga(appInit)
@@ -745,7 +745,7 @@ describe('appInit', () => {
745745
})
746746

747747
it('should initialise with the app fallback language', async () => {
748-
jest.spyOn(RNLocalize, 'findBestAvailableLanguage').mockReturnValue(undefined)
748+
jest.spyOn(RNLocalize, 'findBestLanguageTag').mockReturnValue(undefined)
749749

750750
await expectSaga(appInit)
751751
.provide([[select(currentLanguageSelector), null], ...defaultProviders])

src/app/saga.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { AppState, Platform } from 'react-native'
66
import DeviceInfo from 'react-native-device-info'
77
import InAppReview from 'react-native-in-app-review'
88
import * as Keychain from 'react-native-keychain'
9-
import { findBestAvailableLanguage } from 'react-native-localize'
9+
import { findBestLanguageTag } from 'react-native-localize'
1010
import { eventChannel } from 'redux-saga'
1111
import { e164NumberSelector } from 'src/account/selectors'
1212
import { AppEvents, InviteEvents } from 'src/analytics/Events'
@@ -121,7 +121,7 @@ export function* appInit() {
121121
const allowOtaTranslations = yield* select(allowOtaTranslationsSelector)
122122
const otaTranslationsAppVersion = yield* select(otaTranslationsAppVersionSelector)
123123
const language = yield* select(currentLanguageSelector)
124-
const bestLanguage = findBestAvailableLanguage(Object.keys(locales))?.languageTag
124+
const bestLanguage = findBestLanguageTag(Object.keys(locales))?.languageTag
125125

126126
yield* all([
127127
call(initializeSentry),

yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -15264,10 +15264,10 @@ react-native-linear-gradient@^2.8.3:
1526415264
resolved "https://registry.yarnpkg.com/react-native-linear-gradient/-/react-native-linear-gradient-2.8.3.tgz#9a116649f86d74747304ee13db325e20b21e564f"
1526515265
integrity sha512-KflAXZcEg54PXkLyflaSZQ3PJp4uC4whM7nT/Uot9m0e/qxFV3p6uor1983D1YOBJbJN7rrWdqIjq0T42jOJyA==
1526615266

15267-
react-native-localize@^2.2.6:
15268-
version "2.2.6"
15269-
resolved "https://registry.yarnpkg.com/react-native-localize/-/react-native-localize-2.2.6.tgz#484f8c700bc629f230066e819265f80f6dd3ef58"
15270-
integrity sha512-EZETlC1ZlW/4g6xfsNCwAkAw5BDL2A6zk/08JjFR/GRGxYuKRD7iP1hHn1+h6DEu+xROjPpoNeXfMER2vkTVIQ==
15267+
react-native-localize@^3.1.0:
15268+
version "3.1.0"
15269+
resolved "https://registry.yarnpkg.com/react-native-localize/-/react-native-localize-3.1.0.tgz#1b322c05af21fd3d78d44e9b747d872ab5155b10"
15270+
integrity sha512-A7Rrxl8vuAr5FAqtMFrM5ELLdmszohK6FoHL6qlgxx4HScyOnadoZksbvKHbn+zV5nE8kud2Z4kJM10cN120Zg==
1527115271

1527215272
react-native-modal@^13.0.1:
1527315273
version "13.0.1"

0 commit comments

Comments
 (0)