Skip to content

Commit

Permalink
feat(#713): adapt language on More page
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Apr 9, 2024
1 parent 6890d52 commit 39aaeb4
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 50 deletions.
20 changes: 10 additions & 10 deletions app/integration_test/more_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ void main() {
final BuildContext context = tester.element(find.byType(Scaffold).first);

expect(
find.text(context.l10n.settings_page_account_settings),
find.text(context.l10n.more_page_account_settings),
findsOneWidget,
);

// test opening of a dialog
await tester.tap(find.text(context.l10n.settings_page_delete_data));
await tester.tap(find.text(context.l10n.more_page_delete_data));
await tester.pumpAndSettle();

expect(
find.text(context.l10n.settings_page_delete_data_text),
find.text(context.l10n.more_page_delete_data_text),
findsOneWidget,
);

Expand All @@ -51,7 +51,7 @@ void main() {
await tester.pumpAndSettle();

// test onboarding button
await tester.tap(find.text(context.l10n.settings_page_onboarding));
await tester.tap(find.text(context.l10n.more_page_onboarding));
await tester.pumpAndSettle();

expect(find.text(context.l10n.onboarding_1_header), findsOneWidget);
Expand All @@ -60,23 +60,23 @@ void main() {
await tester.pumpAndSettle();

// test about us
await tester.tap(find.text(context.l10n.settings_page_about_us));
await tester.tap(find.text(context.l10n.more_page_about_us));
await tester.pumpAndSettle();

expect(
find.text(context.l10n.settings_page_about_us_text),
find.text(context.l10n.more_page_about_us_text),
findsOneWidget,
);

context.router.back();
await tester.pumpAndSettle();

// test privacy policy
await tester.tap(find.text(context.l10n.settings_page_privacy_policy));
await tester.tap(find.text(context.l10n.more_page_privacy_policy));
await tester.pumpAndSettle();

expect(
find.text(context.l10n.settings_page_privacy_policy_text),
find.text(context.l10n.more_page_privacy_policy_text),
findsOneWidget,
);

Expand All @@ -85,12 +85,12 @@ void main() {

// test terms and conditions
await tester.tap(
find.text(context.l10n.settings_page_terms_and_conditions),
find.text(context.l10n.more_page_terms_and_conditions),
);
await tester.pumpAndSettle();

expect(
find.text(context.l10n.settings_page_terms_and_conditions_text),
find.text(context.l10n.more_page_terms_and_conditions_text),
findsOneWidget,
);
});
Expand Down
2 changes: 1 addition & 1 deletion app/lib/faq/pages/faq.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class FaqPage extends StatelessWidget {
[...widgets, ..._buildTopic(context, topic, faqList[topic]!)]
),
..._buildTopicHeader(
context.l10n.settings_page_contact_us,
context.l10n.more_page_contact_us,
addSpace: true,
),
_buildQuestionCard(
Expand Down
34 changes: 17 additions & 17 deletions app/lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -368,23 +368,23 @@
"onboarding_5_header": "We care about your data protection",
"onboarding_5_text": "After downloading your genetic data from your data provider, it is solely kept on your phone in encrypted form.\n\nOur servers know nothing about you, neither your identity nor your DNA.",

"settings_page_account_settings": "Settings",
"settings_page_delete_data": "Delete app data",
"settings_page_delete_data_text": "Are you sure that you want to delete all app data? This also includes your genetic data and will reset the app.",
"settings_page_delete_data_additional_text": "Your genetic data will be deleted and it might not be possible to import it again.",
"settings_page_delete_data_confirmation": "I understand the consequences and want to delete all app data",
"settings_page_app_information": "App information",
"settings_page_onboarding": "Onboarding",
"settings_page_app_tour": "Repeat app tour",
"settings_page_about_us": "About us",
"settings_page_about_us_text": "PharMe was created as a bachelor's project at Hasso Plattner Institute (HPI) in Potsdam, Germany, in collaboration with health professionals from the Mount Sinai Health System in New York City, NY, USA.",
"settings_page_privacy_policy": "Privacy policy",
"settings_page_privacy_policy_text": "These aren't the Droids you're looking for.",
"settings_page_terms_and_conditions": "Terms of use",
"settings_page_terms_and_conditions_text": "These aren't the Droids you're looking for.",
"settings_page_help_and_feedback": "Help & Feedback",
"settings_page_genetic_information": "Learn about genetics (MedlinePlus)",
"settings_page_contact_us": "Contact us",
"more_page_account_settings": "Settings",
"more_page_delete_data": "Delete app data",
"more_page_delete_data_text": "Are you sure that you want to delete all app data? This also includes your genetic data and will reset the app.",
"more_page_delete_data_additional_text": "Your genetic data will be deleted and it might not be possible to import it again.",
"more_page_delete_data_confirmation": "I understand the consequences and want to delete all app data",
"more_page_app_information": "App information",
"more_page_onboarding": "Repeat onboarding",
"more_page_app_tour": "Repeat app tour",
"more_page_about_us": "About us",
"more_page_about_us_text": "PharMe was created as a bachelor's project at Hasso Plattner Institute (HPI) in Potsdam, Germany, in collaboration with health professionals from the Mount Sinai Health System in New York City, NY, USA.",
"more_page_privacy_policy": "Privacy policy",
"more_page_privacy_policy_text": "These aren't the Droids you're looking for.",
"more_page_terms_and_conditions": "Terms of use",
"more_page_terms_and_conditions_text": "These aren't the Droids you're looking for.",
"more_page_help_and_feedback": "Help & Feedback",
"more_page_genetic_information": "Learn about genetics (MedlinePlus)",
"more_page_contact_us": "Contact us",

"comprehension_intro_text": "Would you like to participate in a survey aiming to measure user comprehension of content in the app? This would help us make PharMe more understandable for everyone!",
"comprehension_survey_button_text": "Continue to survey"
Expand Down
4 changes: 2 additions & 2 deletions app/lib/more/pages/about.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ class AboutPage extends StatelessWidget {

@override
Widget build(BuildContext context) {
return pageScaffold(title: context.l10n.settings_page_about_us, body: [
return pageScaffold(title: context.l10n.more_page_about_us, body: [
Container(
color: PharMeTheme.backgroundColor,
child: Padding(
padding: const EdgeInsets.all(16),
child: Text(context.l10n.settings_page_about_us_text,
child: Text(context.l10n.more_page_about_us_text,
style: PharMeTheme.textTheme.bodyLarge)),
),
]);
Expand Down
33 changes: 17 additions & 16 deletions app/lib/more/pages/more.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class MorePage extends StatelessWidget {
title: context.l10n.tab_more,
body: [
SubheaderDivider(
text: context.l10n.settings_page_account_settings,
text: context.l10n.more_page_account_settings,
useLine: false,
),
_buildSettingsItem(
Expand All @@ -23,49 +23,50 @@ class MorePage extends StatelessWidget {
),
),
_buildSettingsItem(
title: context.l10n.settings_page_delete_data,
title: context.l10n.more_page_delete_data,
onTap: () => showDialog(
context: context,
builder: (_) => DeleteDataDialog(),
),
),
SubheaderDivider(
text: context.l10n.settings_page_app_information,
text: context.l10n.more_page_app_information,
useLine: false,
),
_buildSettingsItem(
title: context.l10n.settings_page_onboarding,
onTap: () => context.router.push(OnboardingRoute(isRevisiting: true)),
title: context.l10n.more_page_onboarding,
onTap: () =>
context.router.push(OnboardingRoute(isRevisiting: true)),
),
_buildSettingsItem(
title: context.l10n.settings_page_app_tour,
title: context.l10n.more_page_app_tour,
onTap: () async => showAppTour(
context,
lastNextButtonText: context.l10n.action_back_to_app,
revisiting: true,
),
),
_buildSettingsItem(
title: context.l10n.settings_page_about_us,
title: context.l10n.more_page_about_us,
onTap: () => context.router.push(AboutRoute()),
),
_buildSettingsItem(
title: context.l10n.settings_page_privacy_policy,
title: context.l10n.more_page_privacy_policy,
onTap: () => context.router.push(PrivacyRoute()),
),
_buildSettingsItem(
title: context.l10n.settings_page_terms_and_conditions,
title: context.l10n.more_page_terms_and_conditions,
onTap: () => context.router.push(TermsRoute()),
),
SubheaderDivider(
text: context.l10n.settings_page_help_and_feedback,
text: context.l10n.more_page_help_and_feedback,
useLine: false,
),
_buildSettingsItem(
title: context.l10n.settings_page_genetic_information,
title: context.l10n.more_page_genetic_information,
onTap: openFurtherGeneticInformation),
_buildSettingsItem(
title: context.l10n.settings_page_contact_us,
title: context.l10n.more_page_contact_us,
onTap: sendEmail)
]
),
Expand All @@ -89,14 +90,14 @@ class DeleteDataDialog extends HookWidget {
final agreedToDeletion = useState(false);

return DialogWrapper(
title: context.l10n.settings_page_delete_data,
title: context.l10n.more_page_delete_data,
content: Column(
mainAxisSize: MainAxisSize.min,
children: [
DialogContentText(context.l10n.settings_page_delete_data_text),
DialogContentText(context.l10n.more_page_delete_data_text),
SizedBox(height: PharMeTheme.mediumSpace),
DialogContentText(
context.l10n.settings_page_delete_data_additional_text,
context.l10n.more_page_delete_data_additional_text,
),
SizedBox(height: PharMeTheme.mediumSpace),
Row(
Expand All @@ -115,7 +116,7 @@ class DeleteDataDialog extends HookWidget {
SizedBox(width: PharMeTheme.smallSpace),
Expanded(
child: DialogContentText(
context.l10n.settings_page_delete_data_confirmation,
context.l10n.more_page_delete_data_confirmation,
),
),
],
Expand Down
4 changes: 2 additions & 2 deletions app/lib/more/pages/privacy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ class PrivacyPage extends StatelessWidget {

@override
Widget build(BuildContext context) {
return pageScaffold(title: context.l10n.settings_page_privacy_policy, body: [
return pageScaffold(title: context.l10n.more_page_privacy_policy, body: [
Container(
color: PharMeTheme.backgroundColor,
child: Padding(
padding: const EdgeInsets.all(16),
child: Text(context.l10n.settings_page_privacy_policy_text,
child: Text(context.l10n.more_page_privacy_policy_text,
style: PharMeTheme.textTheme.bodyLarge)),
),
]);
Expand Down
4 changes: 2 additions & 2 deletions app/lib/more/pages/terms.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ class TermsPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return pageScaffold(
title: context.l10n.settings_page_terms_and_conditions,
title: context.l10n.more_page_terms_and_conditions,
body: [
Container(
color: PharMeTheme.backgroundColor,
child: Padding(
padding: const EdgeInsets.all(16),
child: Text(
context.l10n.settings_page_terms_and_conditions_text,
context.l10n.more_page_terms_and_conditions_text,
style: PharMeTheme.textTheme.bodyLarge)),
),
]);
Expand Down

0 comments on commit 39aaeb4

Please sign in to comment.