Skip to content

Commit a043417

Browse files
committed
refactor: merge explainer i18n keys with inline link tag
1 parent d89c2bb commit a043417

33 files changed

Lines changed: 78 additions & 98 deletions

File tree

__tests__/screens/account-migration/to-non-custodial/explainer-screen.spec.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ jest.mock("@react-navigation/native", () => ({
1616
}),
1717
}))
1818

19+
jest.mock("@app/utils/external", () => ({
20+
openExternalUrl: jest.fn(),
21+
}))
22+
23+
jest.mock("@app/config/feature-flags-context", () => ({
24+
useRemoteConfig: () => ({
25+
sparkCompatibleWalletsUrl: "https://docs.spark.money/wallets/overview",
26+
}),
27+
}))
28+
1929
jest.mock("@app/components/icon-hero", () => ({
2030
IconHero: ({ title }: { title: string }) => {
2131
const { Text } = jest.requireActual("react-native")
@@ -61,6 +71,21 @@ describe("SparkMigrationExplainerScreen", () => {
6171
expect(screen.getByText("learn more here")).toBeTruthy()
6272
})
6373

74+
it("opens external URL when learn more is pressed", () => {
75+
const { openExternalUrl } = jest.requireMock("@app/utils/external")
76+
77+
render(
78+
<ContextForScreen>
79+
<SparkMigrationExplainerScreen />
80+
</ContextForScreen>,
81+
)
82+
83+
fireEvent.press(screen.getByText("learn more here"))
84+
expect(openExternalUrl).toHaveBeenCalledWith(
85+
"https://docs.spark.money/wallets/overview",
86+
)
87+
})
88+
6489
it("renders Let's move button", () => {
6590
render(
6691
<ContextForScreen>

app/i18n/en/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3636,8 +3636,7 @@ const en: BaseTranslation = {
36363636
moveToNonCustodial: "Move to non-custodial",
36373637
explainerTitle: "What does it mean to move to non-custodial?",
36383638
explainerStep1:
3639-
"You will create a non-custodial account on the Spark protocol, ",
3640-
explainerStep1Link: "learn more here",
3639+
"You will create a non-custodial account on the Spark protocol, <link>learn more here</link>",
36413640
explainerStep2:
36423641
"We transfer your funds into your new non-custodial account, and your current account will be deleted",
36433642
explainerStep3: "Continue using Blink as usual",

app/i18n/i18n-types.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11508,13 +11508,9 @@ type RootTranslation = {
1150811508
*/
1150911509
explainerTitle: string
1151011510
/**
11511-
* Y​o​u​ ​w​i​l​l​ ​c​r​e​a​t​e​ ​a​ ​n​o​n​-​c​u​s​t​o​d​i​a​l​ ​a​c​c​o​u​n​t​ ​o​n​ ​t​h​e​ ​S​p​a​r​k​ ​p​r​o​t​o​c​o​l​,​
11511+
* Y​o​u​ ​w​i​l​l​ ​c​r​e​a​t​e​ ​a​ ​n​o​n​-​c​u​s​t​o​d​i​a​l​ ​a​c​c​o​u​n​t​ ​o​n​ ​t​h​e​ ​S​p​a​r​k​ ​p​r​o​t​o​c​o​l​,​ ​<​l​i​n​k​>​l​e​a​r​n​ ​m​o​r​e​ ​h​e​r​e​<​/​l​i​n​k​>
1151211512
*/
1151311513
explainerStep1: string
11514-
/**
11515-
* l​e​a​r​n​ ​m​o​r​e​ ​h​e​r​e
11516-
*/
11517-
explainerStep1Link: string
1151811514
/**
1151911515
* W​e​ ​t​r​a​n​s​f​e​r​ ​y​o​u​r​ ​f​u​n​d​s​ ​i​n​t​o​ ​y​o​u​r​ ​n​e​w​ ​n​o​n​-​c​u​s​t​o​d​i​a​l​ ​a​c​c​o​u​n​t​,​ ​a​n​d​ ​y​o​u​r​ ​c​u​r​r​e​n​t​ ​a​c​c​o​u​n​t​ ​w​i​l​l​ ​b​e​ ​d​e​l​e​t​e​d
1152011516
*/
@@ -22890,13 +22886,9 @@ export type TranslationFunctions = {
2289022886
*/
2289122887
explainerTitle: () => LocalizedString
2289222888
/**
22893-
* You will create a non-custodial account on the Spark protocol,
22889+
* You will create a non-custodial account on the Spark protocol, <link>learn more here</link>
2289422890
*/
2289522891
explainerStep1: () => LocalizedString
22896-
/**
22897-
* learn more here
22898-
*/
22899-
explainerStep1Link: () => LocalizedString
2290022892
/**
2290122893
* We transfer your funds into your new non-custodial account, and your current account will be deleted
2290222894
*/

app/i18n/raw-i18n/source/en.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3487,8 +3487,7 @@
34873487
"AccountMigration": {
34883488
"moveToNonCustodial": "Move to non-custodial",
34893489
"explainerTitle": "What does it mean to move to non-custodial?",
3490-
"explainerStep1": "You will create a non-custodial account on the Spark protocol, ",
3491-
"explainerStep1Link": "learn more here",
3490+
"explainerStep1": "You will create a non-custodial account on the Spark protocol, <link>learn more here</link>",
34923491
"explainerStep2": "We transfer your funds into your new non-custodial account, and your current account will be deleted",
34933492
"explainerStep3": "Continue using Blink as usual",
34943493
"letsMove": "Let's move",

app/i18n/raw-i18n/translations/af.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3538,8 +3538,7 @@
35383538
"AccountMigration": {
35393539
"moveToNonCustodial": "Skuif na nie-bewaarde",
35403540
"explainerTitle": "Wat beteken dit om na nie-bewaarde te skuif?",
3541-
"explainerStep1": "Jy sal 'n nie-bewaarde rekening op die Spark-protokol skep, ",
3542-
"explainerStep1Link": "leer meer hier",
3541+
"explainerStep1": "Jy sal 'n nie-bewaarde rekening op die Spark-protokol skep, <link>leer meer hier</link>",
35433542
"explainerStep2": "Ons dra jou fondse oor na jou nuwe nie-bewaarde rekening en jou huidige rekening sal verwyder word",
35443543
"explainerStep3": "Gebruik Blink voort soos gewoonlik",
35453544
"letsMove": "Kom ons gaan",

app/i18n/raw-i18n/translations/ar.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3535,8 +3535,7 @@
35353535
"AccountMigration": {
35363536
"moveToNonCustodial": "الانتقال إلى غير حفظي",
35373537
"explainerTitle": "ماذا يعني الانتقال إلى غير حفظي؟",
3538-
"explainerStep1": "ستقوم بإنشاء حساب غير حفظي على بروتوكول Spark، ",
3539-
"explainerStep1Link": "اعرف المزيد هنا",
3538+
"explainerStep1": "ستقوم بإنشاء حساب غير حفظي على بروتوكول Spark، <link>اعرف المزيد هنا</link>",
35403539
"explainerStep2": "سننقل أموالك إلى حسابك الجديد غير الحفظي وسيتم حذف حسابك الحالي",
35413540
"explainerStep3": "استمر في استخدام Blink كالمعتاد",
35423541
"letsMove": "هيا بنا",

app/i18n/raw-i18n/translations/ca.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3497,8 +3497,7 @@
34973497
"AccountMigration": {
34983498
"moveToNonCustodial": "Passa a no custodial",
34993499
"explainerTitle": "Què significa passar a no custodial?",
3500-
"explainerStep1": "Crearàs un compte no custodial al protocol Spark, ",
3501-
"explainerStep1Link": "més informació aquí",
3500+
"explainerStep1": "Crearàs un compte no custodial al protocol Spark, <link>més informació aquí</link>",
35023501
"explainerStep2": "Transferirem els teus fons al teu nou compte no custodial i el teu compte actual serà eliminat",
35033502
"explainerStep3": "Continua fent servir Blink com sempre",
35043503
"letsMove": "Anem-hi",

app/i18n/raw-i18n/translations/cs.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3538,8 +3538,7 @@
35383538
"AccountMigration": {
35393539
"moveToNonCustodial": "Přejít na non-custodial",
35403540
"explainerTitle": "Co znamená přejít na non-custodial?",
3541-
"explainerStep1": "Vytvoříte non-custodial účet na protokolu Spark, ",
3542-
"explainerStep1Link": "zjistit více zde",
3541+
"explainerStep1": "Vytvoříte non-custodial účet na protokolu Spark, <link>zjistit více zde</link>",
35433542
"explainerStep2": "Převedeme vaše prostředky na váš nový non-custodial účet a váš stávající účet bude smazán",
35443543
"explainerStep3": "Pokračujte v používání Blink jako obvykle",
35453544
"letsMove": "Pojďme na to",

app/i18n/raw-i18n/translations/da.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3515,8 +3515,7 @@
35153515
"AccountMigration": {
35163516
"moveToNonCustodial": "Flyt til non-custodial",
35173517
"explainerTitle": "Hvad betyder det at flytte til non-custodial?",
3518-
"explainerStep1": "Du opretter en non-custodial konto på Spark-protokollen, ",
3519-
"explainerStep1Link": "lær mere her",
3518+
"explainerStep1": "Du opretter en non-custodial konto på Spark-protokollen, <link>lær mere her</link>",
35203519
"explainerStep2": "Vi overfører dine midler til din nye non-custodial konto, og din nuværende konto vil blive slettet",
35213520
"explainerStep3": "Fortsæt med at bruge Blink som normalt",
35223521
"letsMove": "Lad os gå",

app/i18n/raw-i18n/translations/de.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3485,8 +3485,7 @@
34853485
"AccountMigration": {
34863486
"moveToNonCustodial": "Zu Non-Custodial wechseln",
34873487
"explainerTitle": "Was bedeutet es, zu Non-Custodial zu wechseln?",
3488-
"explainerStep1": "Du erstellst ein Non-Custodial-Konto auf dem Spark-Protokoll, ",
3489-
"explainerStep1Link": "hier mehr erfahren",
3488+
"explainerStep1": "Du erstellst ein Non-Custodial-Konto auf dem Spark-Protokoll, <link>hier mehr erfahren</link>",
34903489
"explainerStep2": "Wir übertragen deine Guthaben auf dein neues Non-Custodial-Konto und dein aktuelles Konto wird gelöscht",
34913490
"explainerStep3": "Nutze Blink weiterhin wie gewohnt",
34923491
"letsMove": "Los geht's",

0 commit comments

Comments
 (0)