Skip to content

Commit df0550a

Browse files
committed
feat(i18n): update intro and lock screen views to pull from localization files
1 parent f402e18 commit df0550a

File tree

7 files changed

+313
-15
lines changed

7 files changed

+313
-15
lines changed

lib/l10n/app_en.arb

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,5 +275,83 @@
275275
"privacyConscious": "Privacy conscious",
276276
"@privacyConscious": {
277277
"description": "Privacy conscious option label"
278+
},
279+
280+
"welcomeTagline": "An open-source, multicoin wallet for everyone",
281+
"@welcomeTagline": {
282+
"description": "Main tagline shown on welcome/intro screen"
283+
},
284+
"getStartedButton": "Get started",
285+
"@getStartedButton": {
286+
"description": "Button text for starting wallet setup on mobile"
287+
},
288+
"createNewWalletButton": "Create new {appPrefix}",
289+
"@createNewWalletButton": {
290+
"description": "Button text for creating new wallet on desktop",
291+
"placeholders": {
292+
"appPrefix": {
293+
"type": "String",
294+
"description": "Application prefix (e.g., Stack)"
295+
}
296+
}
297+
},
298+
"restoreFromBackupButton": "Restore from {appPrefix} backup",
299+
"@restoreFromBackupButton": {
300+
"description": "Button text for restoring from backup on desktop",
301+
"placeholders": {
302+
"appPrefix": {
303+
"type": "String",
304+
"description": "Application prefix (e.g., Stack)"
305+
}
306+
}
307+
},
308+
"privacyAgreementText": "By using {appName}, you agree to the ",
309+
"@privacyAgreementText": {
310+
"description": "First part of privacy agreement text",
311+
"placeholders": {
312+
"appName": {
313+
"type": "String",
314+
"description": "Application name"
315+
}
316+
}
317+
},
318+
"termsOfServiceLinkText": "Terms of service",
319+
"@termsOfServiceLinkText": {
320+
"description": "Link text for terms of service"
321+
},
322+
"privacyAgreementConjunction": " and ",
323+
"@privacyAgreementConjunction": {
324+
"description": "Conjunction between terms and privacy policy links"
325+
},
326+
"privacyPolicyLinkText": "Privacy policy",
327+
"@privacyPolicyLinkText": {
328+
"description": "Link text for privacy policy"
329+
},
330+
331+
"enterPinTitle": "Enter PIN",
332+
"@enterPinTitle": {
333+
"description": "Title text for PIN entry screen"
334+
},
335+
"useBiometricsButton": "Use biometrics",
336+
"@useBiometricsButton": {
337+
"description": "Button text for using biometric authentication"
338+
},
339+
"loadingWalletsMessage": "Loading wallets...",
340+
"@loadingWalletsMessage": {
341+
"description": "Loading message while wallets are being loaded"
342+
},
343+
"incorrectPinTryAgainError": "Incorrect PIN. Please try again",
344+
"@incorrectPinTryAgainError": {
345+
"description": "Error message for incorrect PIN entry"
346+
},
347+
"incorrectPinThrottleError": "Incorrect PIN entered too many times. Please wait {waitTime}",
348+
"@incorrectPinThrottleError": {
349+
"description": "Error message when PIN attempts are throttled",
350+
"placeholders": {
351+
"waitTime": {
352+
"type": "String",
353+
"description": "Time to wait before trying again"
354+
}
355+
}
278356
}
279357
}

lib/l10n/app_localizations.dart

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,84 @@ abstract class AppLocalizations {
497497
/// In en, this message translates to:
498498
/// **'Privacy conscious'**
499499
String get privacyConscious;
500+
501+
/// Main tagline shown on welcome/intro screen
502+
///
503+
/// In en, this message translates to:
504+
/// **'An open-source, multicoin wallet for everyone'**
505+
String get welcomeTagline;
506+
507+
/// Button text for starting wallet setup on mobile
508+
///
509+
/// In en, this message translates to:
510+
/// **'Get started'**
511+
String get getStartedButton;
512+
513+
/// Button text for creating new wallet on desktop
514+
///
515+
/// In en, this message translates to:
516+
/// **'Create new {appPrefix}'**
517+
String createNewWalletButton(String appPrefix);
518+
519+
/// Button text for restoring from backup on desktop
520+
///
521+
/// In en, this message translates to:
522+
/// **'Restore from {appPrefix} backup'**
523+
String restoreFromBackupButton(String appPrefix);
524+
525+
/// First part of privacy agreement text
526+
///
527+
/// In en, this message translates to:
528+
/// **'By using {appName}, you agree to the '**
529+
String privacyAgreementText(String appName);
530+
531+
/// Link text for terms of service
532+
///
533+
/// In en, this message translates to:
534+
/// **'Terms of service'**
535+
String get termsOfServiceLinkText;
536+
537+
/// Conjunction between terms and privacy policy links
538+
///
539+
/// In en, this message translates to:
540+
/// **' and '**
541+
String get privacyAgreementConjunction;
542+
543+
/// Link text for privacy policy
544+
///
545+
/// In en, this message translates to:
546+
/// **'Privacy policy'**
547+
String get privacyPolicyLinkText;
548+
549+
/// Title text for PIN entry screen
550+
///
551+
/// In en, this message translates to:
552+
/// **'Enter PIN'**
553+
String get enterPinTitle;
554+
555+
/// Button text for using biometric authentication
556+
///
557+
/// In en, this message translates to:
558+
/// **'Use biometrics'**
559+
String get useBiometricsButton;
560+
561+
/// Loading message while wallets are being loaded
562+
///
563+
/// In en, this message translates to:
564+
/// **'Loading wallets...'**
565+
String get loadingWalletsMessage;
566+
567+
/// Error message for incorrect PIN entry
568+
///
569+
/// In en, this message translates to:
570+
/// **'Incorrect PIN. Please try again'**
571+
String get incorrectPinTryAgainError;
572+
573+
/// Error message when PIN attempts are throttled
574+
///
575+
/// In en, this message translates to:
576+
/// **'Incorrect PIN entered too many times. Please wait {waitTime}'**
577+
String incorrectPinThrottleError(String waitTime);
500578
}
501579

502580
class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {

lib/l10n/app_localizations_ar.dart

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,4 +208,51 @@ class AppLocalizationsAr extends AppLocalizations {
208208

209209
@override
210210
String get privacyConscious => 'واعي بالخصوصية';
211+
212+
@override
213+
String get welcomeTagline => 'An open-source, multicoin wallet for everyone';
214+
215+
@override
216+
String get getStartedButton => 'Get started';
217+
218+
@override
219+
String createNewWalletButton(String appPrefix) {
220+
return 'Create new $appPrefix';
221+
}
222+
223+
@override
224+
String restoreFromBackupButton(String appPrefix) {
225+
return 'Restore from $appPrefix backup';
226+
}
227+
228+
@override
229+
String privacyAgreementText(String appName) {
230+
return 'By using $appName, you agree to the ';
231+
}
232+
233+
@override
234+
String get termsOfServiceLinkText => 'Terms of service';
235+
236+
@override
237+
String get privacyAgreementConjunction => ' and ';
238+
239+
@override
240+
String get privacyPolicyLinkText => 'Privacy policy';
241+
242+
@override
243+
String get enterPinTitle => 'Enter PIN';
244+
245+
@override
246+
String get useBiometricsButton => 'Use biometrics';
247+
248+
@override
249+
String get loadingWalletsMessage => 'Loading wallets...';
250+
251+
@override
252+
String get incorrectPinTryAgainError => 'Incorrect PIN. Please try again';
253+
254+
@override
255+
String incorrectPinThrottleError(String waitTime) {
256+
return 'Incorrect PIN entered too many times. Please wait $waitTime';
257+
}
211258
}

lib/l10n/app_localizations_en.dart

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,4 +208,51 @@ class AppLocalizationsEn extends AppLocalizations {
208208

209209
@override
210210
String get privacyConscious => 'Privacy conscious';
211+
212+
@override
213+
String get welcomeTagline => 'An open-source, multicoin wallet for everyone';
214+
215+
@override
216+
String get getStartedButton => 'Get started';
217+
218+
@override
219+
String createNewWalletButton(String appPrefix) {
220+
return 'Create new $appPrefix';
221+
}
222+
223+
@override
224+
String restoreFromBackupButton(String appPrefix) {
225+
return 'Restore from $appPrefix backup';
226+
}
227+
228+
@override
229+
String privacyAgreementText(String appName) {
230+
return 'By using $appName, you agree to the ';
231+
}
232+
233+
@override
234+
String get termsOfServiceLinkText => 'Terms of service';
235+
236+
@override
237+
String get privacyAgreementConjunction => ' and ';
238+
239+
@override
240+
String get privacyPolicyLinkText => 'Privacy policy';
241+
242+
@override
243+
String get enterPinTitle => 'Enter PIN';
244+
245+
@override
246+
String get useBiometricsButton => 'Use biometrics';
247+
248+
@override
249+
String get loadingWalletsMessage => 'Loading wallets...';
250+
251+
@override
252+
String get incorrectPinTryAgainError => 'Incorrect PIN. Please try again';
253+
254+
@override
255+
String incorrectPinThrottleError(String waitTime) {
256+
return 'Incorrect PIN entered too many times. Please wait $waitTime';
257+
}
211258
}

lib/l10n/app_localizations_es.dart

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,4 +208,51 @@ class AppLocalizationsEs extends AppLocalizations {
208208

209209
@override
210210
String get privacyConscious => 'Consciente de la privacidad';
211+
212+
@override
213+
String get welcomeTagline => 'An open-source, multicoin wallet for everyone';
214+
215+
@override
216+
String get getStartedButton => 'Get started';
217+
218+
@override
219+
String createNewWalletButton(String appPrefix) {
220+
return 'Create new $appPrefix';
221+
}
222+
223+
@override
224+
String restoreFromBackupButton(String appPrefix) {
225+
return 'Restore from $appPrefix backup';
226+
}
227+
228+
@override
229+
String privacyAgreementText(String appName) {
230+
return 'By using $appName, you agree to the ';
231+
}
232+
233+
@override
234+
String get termsOfServiceLinkText => 'Terms of service';
235+
236+
@override
237+
String get privacyAgreementConjunction => ' and ';
238+
239+
@override
240+
String get privacyPolicyLinkText => 'Privacy policy';
241+
242+
@override
243+
String get enterPinTitle => 'Enter PIN';
244+
245+
@override
246+
String get useBiometricsButton => 'Use biometrics';
247+
248+
@override
249+
String get loadingWalletsMessage => 'Loading wallets...';
250+
251+
@override
252+
String get incorrectPinTryAgainError => 'Incorrect PIN. Please try again';
253+
254+
@override
255+
String incorrectPinThrottleError(String waitTime) {
256+
return 'Incorrect PIN entered too many times. Please wait $waitTime';
257+
}
211258
}

lib/pages/intro_view.dart

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import 'package:flutter/material.dart';
1515
import 'package:flutter_riverpod/flutter_riverpod.dart';
1616
import 'package:flutter_svg/svg.dart';
1717
import 'package:url_launcher/url_launcher.dart';
18+
import '../l10n/app_localizations.dart';
1819

1920
import '../app_config.dart';
2021
import '../pages_desktop_specific/password/create_password_view.dart';
@@ -128,7 +129,7 @@ class _IntroViewState extends ConsumerState<IntroView> {
128129
if (isDesktop) const SizedBox(height: 20),
129130
if (isDesktop)
130131
SecondaryButton(
131-
label: "Restore from ${AppConfig.prefix} backup",
132+
label: AppLocalizations.of(context)!.restoreFromBackupButton(AppConfig.prefix),
132133
onPressed: () {
133134
Navigator.of(context).pushNamed(
134135
CreatePasswordView.routeName,
@@ -174,7 +175,7 @@ class IntroAboutText extends StatelessWidget {
174175
@override
175176
Widget build(BuildContext context) {
176177
return Text(
177-
AppConfig.shortDescriptionText,
178+
AppLocalizations.of(context)!.welcomeTagline,
178179
textAlign: TextAlign.center,
179180
style:
180181
!isDesktop
@@ -197,11 +198,11 @@ class PrivacyAndTOSText extends StatelessWidget {
197198
text: TextSpan(
198199
style: STextStyles.label(context).copyWith(fontSize: fontSize),
199200
children: [
200-
const TextSpan(
201-
text: "By using ${AppConfig.appName}, you agree to the ",
201+
TextSpan(
202+
text: AppLocalizations.of(context)!.privacyAgreementText(AppConfig.appName),
202203
),
203204
TextSpan(
204-
text: "Terms of service",
205+
text: AppLocalizations.of(context)!.termsOfServiceLinkText,
205206
style: STextStyles.richLink(context).copyWith(fontSize: fontSize),
206207
recognizer:
207208
TapGestureRecognizer()
@@ -214,9 +215,9 @@ class PrivacyAndTOSText extends StatelessWidget {
214215
);
215216
},
216217
),
217-
const TextSpan(text: " and "),
218+
TextSpan(text: AppLocalizations.of(context)!.privacyAgreementConjunction),
218219
TextSpan(
219-
text: "Privacy policy",
220+
text: AppLocalizations.of(context)!.privacyPolicyLinkText,
220221
style: STextStyles.richLink(context).copyWith(fontSize: fontSize),
221222
recognizer:
222223
TapGestureRecognizer()
@@ -251,7 +252,7 @@ class GetStartedButton extends StatelessWidget {
251252
context,
252253
).pushNamed(StackPrivacyCalls.routeName, arguments: false);
253254
},
254-
child: Text("Get started", style: STextStyles.button(context)),
255+
child: Text(AppLocalizations.of(context)!.getStartedButton, style: STextStyles.button(context)),
255256
)
256257
: SizedBox(
257258
width: double.infinity,
@@ -266,7 +267,7 @@ class GetStartedButton extends StatelessWidget {
266267
).pushNamed(StackPrivacyCalls.routeName, arguments: false);
267268
},
268269
child: Text(
269-
"Create new ${AppConfig.prefix}",
270+
AppLocalizations.of(context)!.createNewWalletButton(AppConfig.prefix),
270271
style: STextStyles.button(context).copyWith(fontSize: 20),
271272
),
272273
),

0 commit comments

Comments
 (0)