Skip to content

Commit d359687

Browse files
authored
Merge pull request #1642 from gluneau/localization/core-screens
feat: localization of core/screens
2 parents ea6f45a + fd9369f commit d359687

6 files changed

Lines changed: 284 additions & 29 deletions

File tree

lib/core/screens/logs_viewer_screen.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:bb_mobile/core/utils/build_context_x.dart';
12
import 'package:bb_mobile/core/widgets/log_viewer_widget.dart';
23
import 'package:flutter/material.dart';
34

@@ -9,7 +10,7 @@ class LogsViewerScreen extends StatelessWidget {
910
@override
1011
Widget build(BuildContext context) {
1112
return Scaffold(
12-
appBar: AppBar(title: const Text('Logs')),
13+
appBar: AppBar(title: Text(context.loc.coreScreensLogsTitle)),
1314
body: LogsViewerWidget(logs: logs),
1415
);
1516
}

lib/core/screens/route_error_screen.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
// core/router/error_screen.dart
2+
import 'package:bb_mobile/core/utils/build_context_x.dart';
23
import 'package:flutter/material.dart';
34

45
class RouteErrorScreen extends StatelessWidget {
56
const RouteErrorScreen({super.key});
67

78
@override
89
Widget build(BuildContext context) {
9-
return const Scaffold(
10+
return Scaffold(
1011
body: Center(
11-
child: Text('Page not found'),
12+
child: Text(context.loc.coreScreensPageNotFound),
1213
),
1314
);
1415
}

lib/core/screens/send_confirm_screen.dart

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'package:bb_mobile/core/errors/send_errors.dart';
22
import 'package:bb_mobile/core/swaps/domain/entity/swap.dart';
33
import 'package:bb_mobile/core/themes/app_theme.dart';
4+
import 'package:bb_mobile/core/utils/build_context_x.dart';
45
import 'package:bb_mobile/core/utils/string_formatting.dart';
56
import 'package:bb_mobile/core/widgets/buttons/button.dart';
67
import 'package:bb_mobile/core/widgets/text/text.dart';
@@ -49,13 +50,13 @@ class CommonSendConfirmTopArea extends StatelessWidget {
4950
),
5051
const Gap(16),
5152
if (_sendType == SendType.send)
52-
BBText('Confirm Send', style: context.font.bodyMedium)
53+
BBText(context.loc.coreScreensConfirmSend, style: context.font.bodyMedium)
5354
else if (_sendToExternal == true)
54-
BBText('External Transfer', style: context.font.bodyMedium)
55+
BBText(context.loc.coreScreensExternalTransfer, style: context.font.bodyMedium)
5556
else if (_sendToExternal == false)
56-
BBText('Internal Transfer', style: context.font.bodyMedium)
57+
BBText(context.loc.coreScreensInternalTransfer, style: context.font.bodyMedium)
5758
else
58-
BBText('Confirm Transfer', style: context.font.bodyMedium),
59+
BBText(context.loc.coreScreensConfirmTransfer, style: context.font.bodyMedium),
5960
const Gap(4),
6061
BBText(
6162
_formattedConfirmedAmountBitcoin,
@@ -124,7 +125,7 @@ class CommonOnchainSendInfoSection extends StatelessWidget {
124125
crossAxisAlignment: .stretch,
125126
children: [
126127
CommonInfoRow(
127-
title: 'From',
128+
title: context.loc.coreScreensFromLabel,
128129
details: BBText(
129130
_sendWalletLabel,
130131
style: context.font.bodyLarge,
@@ -133,7 +134,7 @@ class CommonOnchainSendInfoSection extends StatelessWidget {
133134
),
134135
_divider(context),
135136
CommonInfoRow(
136-
title: 'To',
137+
title: context.loc.coreScreensToLabel,
137138
details: Row(
138139
mainAxisAlignment: .end,
139140
mainAxisSize: .min,
@@ -164,7 +165,7 @@ class CommonOnchainSendInfoSection extends StatelessWidget {
164165
),
165166
_divider(context),
166167
CommonInfoRow(
167-
title: 'Amount',
168+
title: context.loc.coreScreensAmountLabel,
168169
details: Column(
169170
crossAxisAlignment: .end,
170171
children: [
@@ -179,7 +180,7 @@ class CommonOnchainSendInfoSection extends StatelessWidget {
179180
),
180181
_divider(context),
181182
CommonInfoRow(
182-
title: 'Network fees',
183+
title: context.loc.coreScreensNetworkFeesLabel,
183184
details: BBText(
184185
"$_absoluteFees sats",
185186
style: context.font.bodyLarge,
@@ -188,7 +189,7 @@ class CommonOnchainSendInfoSection extends StatelessWidget {
188189
),
189190
_divider(context),
190191
CommonInfoRow(
191-
title: 'Fee Priority',
192+
title: context.loc.coreScreensFeePriorityLabel,
192193
details: InkWell(
193194
child: Row(
194195
mainAxisAlignment: .end,
@@ -249,7 +250,7 @@ class CommonLnSwapSendInfoSection extends StatelessWidget {
249250
crossAxisAlignment: .stretch,
250251
children: [
251252
CommonInfoRow(
252-
title: 'From',
253+
title: context.loc.coreScreensFromLabel,
253254
details: BBText(
254255
_sendWalletLabel,
255256
style: context.font.bodyLarge,
@@ -258,7 +259,7 @@ class CommonLnSwapSendInfoSection extends StatelessWidget {
258259
),
259260
_divider(context),
260261
CommonInfoRow(
261-
title: 'To',
262+
title: context.loc.coreScreensToLabel,
262263
details: Row(
263264
mainAxisAlignment: .end,
264265
mainAxisSize: .min,
@@ -294,7 +295,7 @@ class CommonLnSwapSendInfoSection extends StatelessWidget {
294295
),
295296
_divider(context),
296297
CommonInfoRow(
297-
title: 'Transfer ID',
298+
title: context.loc.coreScreensTransferIdLabel,
298299
details: BBText(
299300
_swapId,
300301
style: context.font.bodyLarge,
@@ -303,7 +304,7 @@ class CommonLnSwapSendInfoSection extends StatelessWidget {
303304
),
304305
_divider(context),
305306
CommonInfoRow(
306-
title: 'Amount',
307+
title: context.loc.coreScreensAmountLabel,
307308
details: Column(
308309
crossAxisAlignment: .end,
309310
children: [
@@ -318,7 +319,7 @@ class CommonLnSwapSendInfoSection extends StatelessWidget {
318319
),
319320
_divider(context),
320321
CommonInfoRow(
321-
title: 'Total fees',
322+
title: context.loc.coreScreensTotalFeesLabel,
322323
details: BBText(
323324
"$_totalSwapFees sats",
324325
style: context.font.bodyLarge,
@@ -386,7 +387,7 @@ class _SwapFeeBreakdownState extends State<_SwapFeeBreakdown> {
386387
child: Row(
387388
children: [
388389
BBText(
389-
'Transfer Fee',
390+
context.loc.coreScreensTransferFeeLabel,
390391
style: context.font.bodySmall,
391392
color: context.appColors.surfaceContainer,
392393
),
@@ -415,20 +416,20 @@ class _SwapFeeBreakdownState extends State<_SwapFeeBreakdown> {
415416
Padding(
416417
padding: const EdgeInsets.only(bottom: 8),
417418
child: BBText(
418-
'This is the total fee deducted from the amount sent',
419+
context.loc.coreScreensFeeDeductionExplanation,
419420
style: context.font.labelSmall,
420421
color: context.appColors.surfaceContainer,
421422
),
422423
),
423424
if (fees.claimFee != null)
424-
_feeRow(context, 'Receive Network Fee', fees.claimFee!),
425+
_feeRow(context, context.loc.coreScreensReceiveNetworkFeeLabel, fees.claimFee!),
425426
if (fees.serverNetworkFees != null)
426427
_feeRow(
427428
context,
428-
'Server Network Fees',
429+
context.loc.coreScreensServerNetworkFeesLabel,
429430
fees.serverNetworkFees!,
430431
),
431-
_feeRow(context, 'Transfer Fee', fees.boltzFee ?? 0),
432+
_feeRow(context, context.loc.coreScreensTransferFeeLabel, fees.boltzFee ?? 0),
432433
const Gap(4),
433434
],
434435
),
@@ -468,7 +469,7 @@ class CommonChainSwapSendInfoSection extends StatelessWidget {
468469
crossAxisAlignment: .stretch,
469470
children: [
470471
CommonInfoRow(
471-
title: 'From',
472+
title: context.loc.coreScreensFromLabel,
472473
details: BBText(
473474
sendWalletLabel,
474475
style: context.font.bodyLarge,
@@ -477,7 +478,7 @@ class CommonChainSwapSendInfoSection extends StatelessWidget {
477478
),
478479
_divider(context),
479480
CommonInfoRow(
480-
title: 'To',
481+
title: context.loc.coreScreensToLabel,
481482
details: Row(
482483
mainAxisAlignment: .end,
483484
mainAxisSize: .min,
@@ -519,7 +520,7 @@ class CommonChainSwapSendInfoSection extends StatelessWidget {
519520
),
520521
_divider(context),
521522
CommonInfoRow(
522-
title: 'Transfer ID',
523+
title: context.loc.coreScreensTransferIdLabel,
523524
details: Row(
524525
mainAxisAlignment: .end,
525526
mainAxisSize: .min,
@@ -545,7 +546,7 @@ class CommonChainSwapSendInfoSection extends StatelessWidget {
545546
),
546547
_divider(context),
547548
CommonInfoRow(
548-
title: 'Send Amount',
549+
title: context.loc.coreScreensSendAmountLabel,
549550
details: Column(
550551
crossAxisAlignment: .end,
551552
children: [
@@ -569,7 +570,7 @@ class CommonChainSwapSendInfoSection extends StatelessWidget {
569570
_divider(context),
570571
if (swap.receieveAmount != null)
571572
CommonInfoRow(
572-
title: 'Receive Amount',
573+
title: context.loc.coreScreensReceiveAmountLabel,
573574
details: Column(
574575
crossAxisAlignment: .end,
575576
children: [
@@ -584,7 +585,7 @@ class CommonChainSwapSendInfoSection extends StatelessWidget {
584585
if (swap.receieveAmount != null) _divider(context),
585586
if (swap.fees?.lockupFee != null)
586587
CommonInfoRow(
587-
title: 'Send Network Fee',
588+
title: context.loc.coreScreensSendNetworkFeeLabel,
588589
details: Column(
589590
crossAxisAlignment: .end,
590591
children: [
@@ -676,7 +677,7 @@ class CommonConfirmSendButton extends StatelessWidget {
676677
@override
677678
Widget build(BuildContext context) {
678679
return BBButton.big(
679-
label: 'Confirm',
680+
label: context.loc.coreScreensConfirmButton,
680681
onPressed: () {
681682
_onPressed();
682683
},

localization/app_en.arb

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11619,6 +11619,90 @@
1161911619
"@withdrawOrderAlreadyConfirmedError": {
1162011620
"description": "Error message for already confirmed withdrawal order"
1162111621
},
11622+
"coreScreensPageNotFound": "Page not found",
11623+
"@coreScreensPageNotFound": {
11624+
"description": "Error message shown when a page/route is not found"
11625+
},
11626+
"coreScreensLogsTitle": "Logs",
11627+
"@coreScreensLogsTitle": {
11628+
"description": "AppBar title for logs viewer screen"
11629+
},
11630+
"coreScreensConfirmSend": "Confirm Send",
11631+
"@coreScreensConfirmSend": {
11632+
"description": "Title for confirm send action"
11633+
},
11634+
"coreScreensExternalTransfer": "External Transfer",
11635+
"@coreScreensExternalTransfer": {
11636+
"description": "Title for external transfer action"
11637+
},
11638+
"coreScreensInternalTransfer": "Internal Transfer",
11639+
"@coreScreensInternalTransfer": {
11640+
"description": "Title for internal transfer action"
11641+
},
11642+
"coreScreensConfirmTransfer": "Confirm Transfer",
11643+
"@coreScreensConfirmTransfer": {
11644+
"description": "Title for confirm transfer action"
11645+
},
11646+
"coreScreensFromLabel": "From",
11647+
"@coreScreensFromLabel": {
11648+
"description": "Label for source/sender field"
11649+
},
11650+
"coreScreensToLabel": "To",
11651+
"@coreScreensToLabel": {
11652+
"description": "Label for destination/receiver field"
11653+
},
11654+
"coreScreensAmountLabel": "Amount",
11655+
"@coreScreensAmountLabel": {
11656+
"description": "Label for amount field"
11657+
},
11658+
"coreScreensNetworkFeesLabel": "Network fees",
11659+
"@coreScreensNetworkFeesLabel": {
11660+
"description": "Label for network fees field"
11661+
},
11662+
"coreScreensFeePriorityLabel": "Fee Priority",
11663+
"@coreScreensFeePriorityLabel": {
11664+
"description": "Label for fee priority field"
11665+
},
11666+
"coreScreensTransferIdLabel": "Transfer ID",
11667+
"@coreScreensTransferIdLabel": {
11668+
"description": "Label for transfer ID field"
11669+
},
11670+
"coreScreensTotalFeesLabel": "Total fees",
11671+
"@coreScreensTotalFeesLabel": {
11672+
"description": "Label for total fees field"
11673+
},
11674+
"coreScreensTransferFeeLabel": "Transfer Fee",
11675+
"@coreScreensTransferFeeLabel": {
11676+
"description": "Label for transfer fee field"
11677+
},
11678+
"coreScreensFeeDeductionExplanation": "This is the total fee deducted from the amount sent",
11679+
"@coreScreensFeeDeductionExplanation": {
11680+
"description": "Explanation text for fee deduction"
11681+
},
11682+
"coreScreensReceiveNetworkFeeLabel": "Receive Network Fee",
11683+
"@coreScreensReceiveNetworkFeeLabel": {
11684+
"description": "Label for receive network fee field"
11685+
},
11686+
"coreScreensServerNetworkFeesLabel": "Server Network Fees",
11687+
"@coreScreensServerNetworkFeesLabel": {
11688+
"description": "Label for server network fees field"
11689+
},
11690+
"coreScreensSendAmountLabel": "Send Amount",
11691+
"@coreScreensSendAmountLabel": {
11692+
"description": "Label for send amount field"
11693+
},
11694+
"coreScreensReceiveAmountLabel": "Receive Amount",
11695+
"@coreScreensReceiveAmountLabel": {
11696+
"description": "Label for receive amount field"
11697+
},
11698+
"coreScreensSendNetworkFeeLabel": "Send Network Fee",
11699+
"@coreScreensSendNetworkFeeLabel": {
11700+
"description": "Label for send network fee field"
11701+
},
11702+
"coreScreensConfirmButton": "Confirm",
11703+
"@coreScreensConfirmButton": {
11704+
"description": "Text for confirm button"
11705+
},
1162211706
"recoverbullErrorRejected": "Rejected by the Key Server",
1162311707
"@recoverbullErrorRejected": {
1162411708
"description": "Error message when request is rejected by the key server"

0 commit comments

Comments
 (0)