From d029402d33d554b6252ddaa99429804fbe9dc728 Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 7 Nov 2023 16:39:31 +0100 Subject: [PATCH 1/4] 1175: add language switch, adjust tabItem for sozialpass --- frontend/assets/l10n/app_de.json | 4 + frontend/assets/l10n/app_en.json | 4 + .../assets/nuernberg/l10n/override_de.json | 3 + .../assets/nuernberg/l10n/override_en.json | 3 + frontend/build-configs/bayern/index.ts | 3 +- frontend/build-configs/nuernberg/index.ts | 3 +- frontend/build-configs/types.ts | 1 + frontend/lib/about/about_page.dart | 109 +++++++++++------- frontend/lib/about/language_change.dart | 27 +++++ frontend/lib/about/section.dart | 23 ++++ frontend/lib/home/home_page.dart | 4 +- 11 files changed, 138 insertions(+), 46 deletions(-) create mode 100644 frontend/lib/about/language_change.dart create mode 100644 frontend/lib/about/section.dart diff --git a/frontend/assets/l10n/app_de.json b/frontend/assets/l10n/app_de.json index 44ad09c9e..a82517af3 100644 --- a/frontend/assets/l10n/app_de.json +++ b/frontend/assets/l10n/app_de.json @@ -15,6 +15,10 @@ }, "privacyDeclaration": "Datenschutzerklärung", "publisher": "Herausgeber", + "settings": { + "headline": "Einstellungen", + "languageChange": "Sprache wechseln" + }, "sourceCode": "Quellcode der App", "title": "Über" }, diff --git a/frontend/assets/l10n/app_en.json b/frontend/assets/l10n/app_en.json index 12d154821..a3b68975c 100644 --- a/frontend/assets/l10n/app_en.json +++ b/frontend/assets/l10n/app_en.json @@ -15,6 +15,10 @@ }, "privacyDeclaration": "Privacy policy", "publisher": "Publisher", + "settings": { + "headline": "Settings", + "languageChange": "Change language" + }, "sourceCode": "Source code", "title": "About" }, diff --git a/frontend/assets/nuernberg/l10n/override_de.json b/frontend/assets/nuernberg/l10n/override_de.json index 76c38c031..a63359282 100644 --- a/frontend/assets/nuernberg/l10n/override_de.json +++ b/frontend/assets/nuernberg/l10n/override_de.json @@ -30,5 +30,8 @@ "usageDescription": "Auf der Karte von Nürnberg können Sie alle Akzeptanzstellen finden. Tippen Sie auf einen Standort, um mehr Informationen sehen zu können.", "usageTitle": "Wo kann ich den Nürnberg-Pass nutzen?", "welcomeDescription": "Vielen Dank, dass Sie sich die App zum Nürnberg-Pass heruntergeladen haben!" + }, + "about": { + "title": "Mehr" } } diff --git a/frontend/assets/nuernberg/l10n/override_en.json b/frontend/assets/nuernberg/l10n/override_en.json index 159272b6a..ca52269e8 100644 --- a/frontend/assets/nuernberg/l10n/override_en.json +++ b/frontend/assets/nuernberg/l10n/override_en.json @@ -30,5 +30,8 @@ "usageDescription": "On the map of Nürnberg you can find all acceptance points. Tap on a location to be able to see more information.", "usageTitle": "Where can I use my Nürnberg-Pass?", "welcomeDescription": "Thank you for downloading the app for the Nürnberg-Pass!" + }, + "about": { + "title": "More" } } diff --git a/frontend/build-configs/bayern/index.ts b/frontend/build-configs/bayern/index.ts index d5c55ddf9..71c6dfbd7 100644 --- a/frontend/build-configs/bayern/index.ts +++ b/frontend/build-configs/bayern/index.ts @@ -62,7 +62,8 @@ export const bayernCommon: CommonBuildConfigType = { "assets/bayern/intro_slides/search_with_location.png", ], featureFlags: { - verification: true + verification: true, + settings: false }, applicationUrl: "https://bayern.ehrenamtskarte.app/beantragen", dataPrivacyPolicyUrl: "https://bayern.ehrenamtskarte.app/data-privacy-policy", diff --git a/frontend/build-configs/nuernberg/index.ts b/frontend/build-configs/nuernberg/index.ts index c24ca1b16..2bd24eefd 100644 --- a/frontend/build-configs/nuernberg/index.ts +++ b/frontend/build-configs/nuernberg/index.ts @@ -62,7 +62,8 @@ export const nuernbergCommon: CommonBuildConfigType = { "assets/nuernberg/intro_slides/search_with_location.png", ], featureFlags: { - verification: true + verification: true, + settings: true }, applicationUrl: "https://beantragen.nuernberg.sozialpass.app", publisherAddress: diff --git a/frontend/build-configs/types.ts b/frontend/build-configs/types.ts index e7085380b..1825aa5dc 100644 --- a/frontend/build-configs/types.ts +++ b/frontend/build-configs/types.ts @@ -6,6 +6,7 @@ type BuildConfigType = { export type FeatureFlagsType = { verification: boolean + settings: boolean } export type ThemeType = { diff --git a/frontend/lib/about/about_page.dart b/frontend/lib/about/about_page.dart index 10e942cdb..c1c9beaa1 100644 --- a/frontend/lib/about/about_page.dart +++ b/frontend/lib/about/about_page.dart @@ -1,7 +1,9 @@ import 'package:ehrenamtskarte/about/backend_switch_dialog.dart'; import 'package:ehrenamtskarte/about/content_tile.dart'; import 'package:ehrenamtskarte/about/dev_settings_view.dart'; +import 'package:ehrenamtskarte/about/language_change.dart'; import 'package:ehrenamtskarte/about/license_page.dart'; +import 'package:ehrenamtskarte/about/section.dart'; import 'package:ehrenamtskarte/about/texts.dart'; import 'package:ehrenamtskarte/build_config/build_config.dart' show buildConfig; import 'package:ehrenamtskarte/configuration/configuration.dart'; @@ -95,53 +97,76 @@ class AboutPageState extends State { ); }, ), + if (buildConfig.featureFlags.settings) + Column(children: [ + const Divider( + height: 1, + thickness: 1, + ), + Section( + headline: t.about.settings.headline, + children: [ + ContentTile( + icon: Icons.language, title: t.about.settings.languageChange, children: [LanguageChange()]), + ], + ), + ]), const Divider( height: 1, thickness: 1, ), - const SizedBox(height: 20), - ContentTile(icon: Icons.copyright, title: t.about.licenses(n: 1), children: getCopyrightText(context)), - ListTile( - leading: const Icon(Icons.privacy_tip_outlined), - title: Text(t.about.privacyDeclaration), - onTap: () => launchUrlString(buildConfig.dataPrivacyPolicyUrl, mode: LaunchMode.externalApplication), - ), - ContentTile( - icon: Icons.info_outline, - title: t.about.disclaimer, - children: getDisclaimerText(context), - ), - ListTile( - leading: const Icon(Icons.book_outlined), - title: Text(t.about.dependencies), - onTap: () { - Navigator.push( - context, - AppRoute( - builder: (context) => const CustomLicensePage(), - ), - ); - }, - ), - ListTile( - leading: const Icon(Icons.code_outlined), - title: Text(t.about.sourceCode), - onTap: () { - launchUrlString( - 'https://github.com/digitalfabrik/entitlementcard', - mode: LaunchMode.externalApplication, - ); - }, - ), - if (config.showDevSettings) + Section(headline: t.about.moreInformation, children: [ + ContentTile(icon: Icons.copyright, title: t.about.licenses(n: 1), children: getCopyrightText(context)), ListTile( - leading: const Icon(Icons.build), - title: Text(t.about.developmentOptions), - onTap: () => showDialog( - context: context, - builder: (context) => - SimpleDialog(title: Text(t.about.developmentOptions), children: [DevSettingsView()]), - ), + leading: const Icon(Icons.privacy_tip_outlined), + title: Text(t.about.privacyDeclaration), + onTap: () => launchUrlString(buildConfig.dataPrivacyPolicyUrl, mode: LaunchMode.externalApplication), + ), + ContentTile( + icon: Icons.info_outline, + title: t.about.disclaimer, + children: getDisclaimerText(context), + ), + ListTile( + leading: const Icon(Icons.book_outlined), + title: Text(t.about.dependencies), + onTap: () { + Navigator.push( + context, + AppRoute( + builder: (context) => const CustomLicensePage(), + ), + ); + }, + ), + ListTile( + leading: const Icon(Icons.code_outlined), + title: Text(t.about.sourceCode), + onTap: () { + launchUrlString( + 'https://github.com/digitalfabrik/entitlementcard', + mode: LaunchMode.externalApplication, + ); + }, + ), + ]), + if (config.showDevSettings) + Column( + children: [ + const Divider( + height: 1, + thickness: 1, + ), + ListTile( + leading: const Icon(Icons.build), + title: Text(t.about.developmentOptions), + onTap: () => showDialog( + context: context, + builder: (context) => + SimpleDialog(title: Text(t.about.developmentOptions), children: [DevSettingsView()]), + ), + ) + ], ) ]; } else { diff --git a/frontend/lib/about/language_change.dart b/frontend/lib/about/language_change.dart new file mode 100644 index 000000000..f065e08dc --- /dev/null +++ b/frontend/lib/about/language_change.dart @@ -0,0 +1,27 @@ +import 'package:ehrenamtskarte/build_config/build_config.dart' show buildConfig; +import 'package:ehrenamtskarte/l10n/translations.g.dart'; +import 'package:flutter/material.dart'; + +Map languages = {'en': 'Englisch', 'de': 'Deutsch'}; + +class LanguageChange extends StatelessWidget { + const LanguageChange({super.key}); + + @override + Widget build(BuildContext context) { + return Column(children: [ + ...buildConfig.appLocales.map((item) => DecoratedBox( + decoration: BoxDecoration( + color: LocaleSettings.currentLocale.languageCode == item + ? Theme.of(context).colorScheme.surfaceVariant + : null), + child: ListTile( + title: Text( + languages[item]!, + textAlign: TextAlign.center, + style: TextStyle(fontWeight: FontWeight.bold), + ), + onTap: () => LocaleSettings.setLocaleRaw(item)))) + ]); + } +} diff --git a/frontend/lib/about/section.dart b/frontend/lib/about/section.dart new file mode 100644 index 000000000..00f044d67 --- /dev/null +++ b/frontend/lib/about/section.dart @@ -0,0 +1,23 @@ +import 'package:flutter/material.dart'; + +class Section extends StatelessWidget { + final String headline; + final List children; + + const Section({super.key, required this.headline, required this.children}); + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(top: 20, left: 20, right: 20), + child: Text(headline, style: TextStyle(color: Theme.of(context).colorScheme.primary)), + ), + Column(children: children), + const SizedBox(height: 10), + ], + ); + } +} diff --git a/frontend/lib/home/home_page.dart b/frontend/lib/home/home_page.dart index aec036628..588b93def 100644 --- a/frontend/lib/home/home_page.dart +++ b/frontend/lib/home/home_page.dart @@ -55,8 +55,8 @@ class HomePageState extends State { (BuildContext context) => t.identification.title, GlobalKey(debugLabel: 'Auth tab key'), ), - AppFlow(const AboutPage(), Icons.info_outline, (BuildContext context) => t.about.title, - GlobalKey(debugLabel: 'About tab key')), + AppFlow(const AboutPage(), buildConfig.featureFlags.settings ? Icons.menu : Icons.info_outline, + (BuildContext context) => t.about.title, GlobalKey(debugLabel: 'About tab key')), ]; } From 5aa21d3143bd44df92b93ee27bc2bb50ac7a94ac Mon Sep 17 00:00:00 2001 From: Andy Date: Tue, 7 Nov 2023 17:48:08 +0100 Subject: [PATCH 2/4] 1175: add notification for language change --- frontend/assets/l10n/app_de.json | 3 ++- frontend/assets/l10n/app_en.json | 3 ++- frontend/lib/about/about_page.dart | 3 ++- frontend/lib/about/language_change.dart | 15 ++++++++++++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/frontend/assets/l10n/app_de.json b/frontend/assets/l10n/app_de.json index a82517af3..80da2d001 100644 --- a/frontend/assets/l10n/app_de.json +++ b/frontend/assets/l10n/app_de.json @@ -17,7 +17,8 @@ "publisher": "Herausgeber", "settings": { "headline": "Einstellungen", - "languageChange": "Sprache wechseln" + "languageChange": "Sprache wechseln", + "languageNotification": "Ihre Sprache wurde erfolgreich geändert!" }, "sourceCode": "Quellcode der App", "title": "Über" diff --git a/frontend/assets/l10n/app_en.json b/frontend/assets/l10n/app_en.json index a3b68975c..ebaeba9b6 100644 --- a/frontend/assets/l10n/app_en.json +++ b/frontend/assets/l10n/app_en.json @@ -17,7 +17,8 @@ "publisher": "Publisher", "settings": { "headline": "Settings", - "languageChange": "Change language" + "languageChange": "Change language", + "languageNotification": "Your language was changed successfully!" }, "sourceCode": "Source code", "title": "About" diff --git a/frontend/lib/about/about_page.dart b/frontend/lib/about/about_page.dart index c1c9beaa1..90b9e71a4 100644 --- a/frontend/lib/about/about_page.dart +++ b/frontend/lib/about/about_page.dart @@ -29,7 +29,8 @@ class AboutPageState extends State { @override Widget build(BuildContext context) { final config = Configuration.of(context); - + print('title:${t.about.settings.languageChange}'); + print('locale:${LocaleSettings.currentLocale.languageCode}'); return FutureBuilder( future: PackageInfo.fromPlatform(), builder: (context, snapshot) { diff --git a/frontend/lib/about/language_change.dart b/frontend/lib/about/language_change.dart index f065e08dc..103dff979 100644 --- a/frontend/lib/about/language_change.dart +++ b/frontend/lib/about/language_change.dart @@ -21,7 +21,20 @@ class LanguageChange extends StatelessWidget { textAlign: TextAlign.center, style: TextStyle(fontWeight: FontWeight.bold), ), - onTap: () => LocaleSettings.setLocaleRaw(item)))) + onTap: () => switchLanguage(context, item)))) ]); } + + switchLanguage(BuildContext context, String language) { + final messengerState = ScaffoldMessenger.of(context); + LocaleSettings.setLocaleRaw(language); + messengerState.showSnackBar( + SnackBar( + backgroundColor: Theme.of(context).colorScheme.primary, + content: Text(t.about.settings.languageNotification, + style: TextStyle(color: Theme.of(context).colorScheme.background)), + ), + ); + Navigator.pop(context); + } } From a0b82b25ecd4f8506e9a2758a4736217f728a4df Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 8 Nov 2023 14:41:03 +0100 Subject: [PATCH 3/4] 1175: replace identity icon, restructure translations for about --- frontend/assets/l10n/app_de.json | 23 +++++++++++++---------- frontend/assets/l10n/app_en.json | 23 +++++++++++++---------- frontend/build-configs/bayern/index.ts | 1 - frontend/build-configs/nuernberg/index.ts | 1 - frontend/build-configs/types.ts | 1 - frontend/lib/about/about_page.dart | 17 ++++++++--------- frontend/lib/about/language_change.dart | 2 +- frontend/lib/about/license_page.dart | 2 +- frontend/lib/about/section.dart | 8 ++++++-- frontend/lib/home/home_page.dart | 4 ++-- frontend/lib/themes.dart | 4 ++-- 11 files changed, 46 insertions(+), 40 deletions(-) diff --git a/frontend/assets/l10n/app_de.json b/frontend/assets/l10n/app_de.json index 80da2d001..83b0bb3a1 100644 --- a/frontend/assets/l10n/app_de.json +++ b/frontend/assets/l10n/app_de.json @@ -1,26 +1,29 @@ { "about": { - "dependencies": "Software-Bibliotheken", "developmentOptions": "Entwickleroptionen", - "disclaimer": "Haftung, Haftungsausschluss und Impressum", - "licenses": { - "one": "Lizenz", - "other": "Lizenzen" + "info": { + "dependencies": "Software-Bibliotheken", + "disclaimer": "Haftung, Haftungsausschluss und Impressum", + "headline": "Info", + "licenses": { + "one": "Lizenz", + "other": "Lizenzen" + }, + "privacyDeclaration": "Datenschutzerklärung", + "sourceCode": "Quellcode der App" }, "moreInformation": "Mehr Informationen", "numberLicenses": { - "zero": "Keine Lizenzen", "one": "1 Lizenz", - "other": "$n Lizenzen" + "other": "$n Lizenzen", + "zero": "Keine Lizenzen" }, - "privacyDeclaration": "Datenschutzerklärung", "publisher": "Herausgeber", "settings": { "headline": "Einstellungen", "languageChange": "Sprache wechseln", - "languageNotification": "Ihre Sprache wurde erfolgreich geändert!" + "languageChangeSuccessful": "Ihre Sprache wurde erfolgreich geändert!" }, - "sourceCode": "Quellcode der App", "title": "Über" }, "category": { diff --git a/frontend/assets/l10n/app_en.json b/frontend/assets/l10n/app_en.json index ebaeba9b6..e2c3933fc 100644 --- a/frontend/assets/l10n/app_en.json +++ b/frontend/assets/l10n/app_en.json @@ -1,26 +1,29 @@ { "about": { - "dependencies": "Libraries", "developmentOptions": "Developer options", - "disclaimer": "Liability, disclaimer and imprint", - "licenses": { - "one": "License", - "other": "Licenses" + "info": { + "dependencies": "Libraries", + "disclaimer": "Liability, disclaimer and imprint", + "headline": "Info", + "licenses": { + "one": "License", + "other": "Licenses" + }, + "privacyDeclaration": "Privacy policy", + "sourceCode": "Source code" }, "moreInformation": "More information", "numberLicenses": { - "zero": "No licenses", "one": "1 license", - "other": "$n licenses" + "other": "$n licenses", + "zero": "No licenses" }, - "privacyDeclaration": "Privacy policy", "publisher": "Publisher", "settings": { "headline": "Settings", "languageChange": "Change language", - "languageNotification": "Your language was changed successfully!" + "languageChangeSuccessful": "Your language was changed successfully!" }, - "sourceCode": "Source code", "title": "About" }, "category": { diff --git a/frontend/build-configs/bayern/index.ts b/frontend/build-configs/bayern/index.ts index 71c6dfbd7..79f0f6e30 100644 --- a/frontend/build-configs/bayern/index.ts +++ b/frontend/build-configs/bayern/index.ts @@ -63,7 +63,6 @@ export const bayernCommon: CommonBuildConfigType = { ], featureFlags: { verification: true, - settings: false }, applicationUrl: "https://bayern.ehrenamtskarte.app/beantragen", dataPrivacyPolicyUrl: "https://bayern.ehrenamtskarte.app/data-privacy-policy", diff --git a/frontend/build-configs/nuernberg/index.ts b/frontend/build-configs/nuernberg/index.ts index 2bd24eefd..6dd7f404e 100644 --- a/frontend/build-configs/nuernberg/index.ts +++ b/frontend/build-configs/nuernberg/index.ts @@ -63,7 +63,6 @@ export const nuernbergCommon: CommonBuildConfigType = { ], featureFlags: { verification: true, - settings: true }, applicationUrl: "https://beantragen.nuernberg.sozialpass.app", publisherAddress: diff --git a/frontend/build-configs/types.ts b/frontend/build-configs/types.ts index 1825aa5dc..e7085380b 100644 --- a/frontend/build-configs/types.ts +++ b/frontend/build-configs/types.ts @@ -6,7 +6,6 @@ type BuildConfigType = { export type FeatureFlagsType = { verification: boolean - settings: boolean } export type ThemeType = { diff --git a/frontend/lib/about/about_page.dart b/frontend/lib/about/about_page.dart index 90b9e71a4..ce944186c 100644 --- a/frontend/lib/about/about_page.dart +++ b/frontend/lib/about/about_page.dart @@ -29,8 +29,6 @@ class AboutPageState extends State { @override Widget build(BuildContext context) { final config = Configuration.of(context); - print('title:${t.about.settings.languageChange}'); - print('locale:${LocaleSettings.currentLocale.languageCode}'); return FutureBuilder( future: PackageInfo.fromPlatform(), builder: (context, snapshot) { @@ -98,7 +96,7 @@ class AboutPageState extends State { ); }, ), - if (buildConfig.featureFlags.settings) + if (buildConfig.appLocales.length > 1) Column(children: [ const Divider( height: 1, @@ -116,21 +114,22 @@ class AboutPageState extends State { height: 1, thickness: 1, ), - Section(headline: t.about.moreInformation, children: [ - ContentTile(icon: Icons.copyright, title: t.about.licenses(n: 1), children: getCopyrightText(context)), + Section(headline: t.about.info.headline, children: [ + ContentTile( + icon: Icons.copyright, title: t.about.info.licenses(n: 1), children: getCopyrightText(context)), ListTile( leading: const Icon(Icons.privacy_tip_outlined), - title: Text(t.about.privacyDeclaration), + title: Text(t.about.info.privacyDeclaration), onTap: () => launchUrlString(buildConfig.dataPrivacyPolicyUrl, mode: LaunchMode.externalApplication), ), ContentTile( icon: Icons.info_outline, - title: t.about.disclaimer, + title: t.about.info.disclaimer, children: getDisclaimerText(context), ), ListTile( leading: const Icon(Icons.book_outlined), - title: Text(t.about.dependencies), + title: Text(t.about.info.dependencies), onTap: () { Navigator.push( context, @@ -142,7 +141,7 @@ class AboutPageState extends State { ), ListTile( leading: const Icon(Icons.code_outlined), - title: Text(t.about.sourceCode), + title: Text(t.about.info.sourceCode), onTap: () { launchUrlString( 'https://github.com/digitalfabrik/entitlementcard', diff --git a/frontend/lib/about/language_change.dart b/frontend/lib/about/language_change.dart index 103dff979..d8573140c 100644 --- a/frontend/lib/about/language_change.dart +++ b/frontend/lib/about/language_change.dart @@ -31,7 +31,7 @@ class LanguageChange extends StatelessWidget { messengerState.showSnackBar( SnackBar( backgroundColor: Theme.of(context).colorScheme.primary, - content: Text(t.about.settings.languageNotification, + content: Text(t.about.settings.languageChangeSuccessful, style: TextStyle(color: Theme.of(context).colorScheme.background)), ), ); diff --git a/frontend/lib/about/license_page.dart b/frontend/lib/about/license_page.dart index 6c9c85182..acfd21518 100644 --- a/frontend/lib/about/license_page.dart +++ b/frontend/lib/about/license_page.dart @@ -53,7 +53,7 @@ class CustomLicensePage extends StatelessWidget { return CustomScrollView( slivers: [ - CustomSliverAppBar(title: t.about.licenses(n: licenses.length)), + CustomSliverAppBar(title: t.about.info.licenses(n: licenses.length)), SliverList( delegate: SliverChildBuilderDelegate( (BuildContext context, int index) { diff --git a/frontend/lib/about/section.dart b/frontend/lib/about/section.dart index 00f044d67..652727715 100644 --- a/frontend/lib/about/section.dart +++ b/frontend/lib/about/section.dart @@ -12,8 +12,12 @@ class Section extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( - padding: EdgeInsets.only(top: 20, left: 20, right: 20), - child: Text(headline, style: TextStyle(color: Theme.of(context).colorScheme.primary)), + padding: EdgeInsets.only(top: 16, left: 16, right: 16), + child: Text(headline, + style: Theme.of(context) + .textTheme + .bodySmall + ?.merge(TextStyle(color: Theme.of(context).colorScheme.secondary))), ), Column(children: children), const SizedBox(height: 10), diff --git a/frontend/lib/home/home_page.dart b/frontend/lib/home/home_page.dart index 588b93def..c306cf0be 100644 --- a/frontend/lib/home/home_page.dart +++ b/frontend/lib/home/home_page.dart @@ -51,11 +51,11 @@ class HomePageState extends State { if (buildConfig.featureFlags.verification) AppFlow( IdentificationPage(), - Icons.remove_red_eye_outlined, + Icons.credit_card, (BuildContext context) => t.identification.title, GlobalKey(debugLabel: 'Auth tab key'), ), - AppFlow(const AboutPage(), buildConfig.featureFlags.settings ? Icons.menu : Icons.info_outline, + AppFlow(const AboutPage(), buildConfig.appLocales.length > 1 ? Icons.menu : Icons.info_outline, (BuildContext context) => t.about.title, GlobalKey(debugLabel: 'About tab key')), ]; } diff --git a/frontend/lib/themes.dart b/frontend/lib/themes.dart index 71cebd3eb..7c925b8d3 100644 --- a/frontend/lib/themes.dart +++ b/frontend/lib/themes.dart @@ -16,7 +16,7 @@ ThemeData get lightTheme { ), textTheme: defaultTypography.copyWith( headlineMedium: defaultTypography.headlineMedium?.apply(color: Colors.black87), - headlineSmall: defaultTypography.headlineMedium?.apply(color: Colors.black87), + headlineSmall: defaultTypography.headlineSmall?.apply(color: Colors.black87), titleLarge: const TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold), bodyLarge: const TextStyle(fontSize: 15.0, fontWeight: FontWeight.normal), bodyMedium: const TextStyle(fontSize: 15.0, color: Color(0xFF505050)), @@ -59,7 +59,7 @@ ThemeData get darkTheme { ), textTheme: defaultTypography.copyWith( headlineMedium: defaultTypography.headlineMedium?.apply(color: Colors.white), - headlineSmall: defaultTypography.headlineMedium?.apply(color: Colors.white), + headlineSmall: defaultTypography.headlineSmall?.apply(color: Colors.white), titleLarge: const TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold), bodyLarge: const TextStyle(fontSize: 15.0, fontWeight: FontWeight.normal), bodyMedium: const TextStyle(fontSize: 15.0, color: Color(0xFFC6C4C4)), From 31689755292b7454cc3f8fc70920f6bf908c1a38 Mon Sep 17 00:00:00 2001 From: Andy Date: Wed, 8 Nov 2023 16:22:40 +0100 Subject: [PATCH 4/4] 1175: revert restructure translations for about --- frontend/assets/l10n/app_de.json | 26 +++++++++++-------------- frontend/assets/l10n/app_en.json | 26 +++++++++++-------------- frontend/lib/about/about_page.dart | 18 ++++++++--------- frontend/lib/about/language_change.dart | 4 ++-- frontend/lib/about/license_page.dart | 2 +- 5 files changed, 33 insertions(+), 43 deletions(-) diff --git a/frontend/assets/l10n/app_de.json b/frontend/assets/l10n/app_de.json index 83b0bb3a1..07f4dc13d 100644 --- a/frontend/assets/l10n/app_de.json +++ b/frontend/assets/l10n/app_de.json @@ -1,16 +1,14 @@ { "about": { + "dependencies": "Software-Bibliotheken", "developmentOptions": "Entwickleroptionen", - "info": { - "dependencies": "Software-Bibliotheken", - "disclaimer": "Haftung, Haftungsausschluss und Impressum", - "headline": "Info", - "licenses": { - "one": "Lizenz", - "other": "Lizenzen" - }, - "privacyDeclaration": "Datenschutzerklärung", - "sourceCode": "Quellcode der App" + "disclaimer": "Haftung, Haftungsausschluss und Impressum", + "infoTitle": "Info", + "languageChange": "Sprache wechseln", + "languageChangeSuccessful": "Ihre Sprache wurde erfolgreich geändert!", + "licenses": { + "one": "Lizenz", + "other": "Lizenzen" }, "moreInformation": "Mehr Informationen", "numberLicenses": { @@ -18,12 +16,10 @@ "other": "$n Lizenzen", "zero": "Keine Lizenzen" }, + "privacyDeclaration": "Datenschutzerklärung", "publisher": "Herausgeber", - "settings": { - "headline": "Einstellungen", - "languageChange": "Sprache wechseln", - "languageChangeSuccessful": "Ihre Sprache wurde erfolgreich geändert!" - }, + "settingsTitle": "Einstellungen", + "sourceCode": "Quellcode der App", "title": "Über" }, "category": { diff --git a/frontend/assets/l10n/app_en.json b/frontend/assets/l10n/app_en.json index e2c3933fc..c2d7aaa4d 100644 --- a/frontend/assets/l10n/app_en.json +++ b/frontend/assets/l10n/app_en.json @@ -1,16 +1,14 @@ { "about": { + "dependencies": "Libraries", "developmentOptions": "Developer options", - "info": { - "dependencies": "Libraries", - "disclaimer": "Liability, disclaimer and imprint", - "headline": "Info", - "licenses": { - "one": "License", - "other": "Licenses" - }, - "privacyDeclaration": "Privacy policy", - "sourceCode": "Source code" + "disclaimer": "Liability, disclaimer and imprint", + "infoTitle": "Info", + "languageChange": "Change language", + "languageChangeSuccessful": "Your language was changed successfully!", + "licenses": { + "one": "License", + "other": "Licenses" }, "moreInformation": "More information", "numberLicenses": { @@ -18,12 +16,10 @@ "other": "$n licenses", "zero": "No licenses" }, + "privacyDeclaration": "Privacy policy", "publisher": "Publisher", - "settings": { - "headline": "Settings", - "languageChange": "Change language", - "languageChangeSuccessful": "Your language was changed successfully!" - }, + "settingsTitle": "Settings", + "sourceCode": "Source code", "title": "About" }, "category": { diff --git a/frontend/lib/about/about_page.dart b/frontend/lib/about/about_page.dart index ce944186c..4e41af45f 100644 --- a/frontend/lib/about/about_page.dart +++ b/frontend/lib/about/about_page.dart @@ -103,10 +103,9 @@ class AboutPageState extends State { thickness: 1, ), Section( - headline: t.about.settings.headline, + headline: t.about.settingsTitle, children: [ - ContentTile( - icon: Icons.language, title: t.about.settings.languageChange, children: [LanguageChange()]), + ContentTile(icon: Icons.language, title: t.about.languageChange, children: [LanguageChange()]), ], ), ]), @@ -114,22 +113,21 @@ class AboutPageState extends State { height: 1, thickness: 1, ), - Section(headline: t.about.info.headline, children: [ - ContentTile( - icon: Icons.copyright, title: t.about.info.licenses(n: 1), children: getCopyrightText(context)), + Section(headline: t.about.infoTitle, children: [ + ContentTile(icon: Icons.copyright, title: t.about.licenses(n: 1), children: getCopyrightText(context)), ListTile( leading: const Icon(Icons.privacy_tip_outlined), - title: Text(t.about.info.privacyDeclaration), + title: Text(t.about.privacyDeclaration), onTap: () => launchUrlString(buildConfig.dataPrivacyPolicyUrl, mode: LaunchMode.externalApplication), ), ContentTile( icon: Icons.info_outline, - title: t.about.info.disclaimer, + title: t.about.disclaimer, children: getDisclaimerText(context), ), ListTile( leading: const Icon(Icons.book_outlined), - title: Text(t.about.info.dependencies), + title: Text(t.about.dependencies), onTap: () { Navigator.push( context, @@ -141,7 +139,7 @@ class AboutPageState extends State { ), ListTile( leading: const Icon(Icons.code_outlined), - title: Text(t.about.info.sourceCode), + title: Text(t.about.sourceCode), onTap: () { launchUrlString( 'https://github.com/digitalfabrik/entitlementcard', diff --git a/frontend/lib/about/language_change.dart b/frontend/lib/about/language_change.dart index d8573140c..eb5eb2b13 100644 --- a/frontend/lib/about/language_change.dart +++ b/frontend/lib/about/language_change.dart @@ -31,8 +31,8 @@ class LanguageChange extends StatelessWidget { messengerState.showSnackBar( SnackBar( backgroundColor: Theme.of(context).colorScheme.primary, - content: Text(t.about.settings.languageChangeSuccessful, - style: TextStyle(color: Theme.of(context).colorScheme.background)), + content: + Text(t.about.languageChangeSuccessful, style: TextStyle(color: Theme.of(context).colorScheme.background)), ), ); Navigator.pop(context); diff --git a/frontend/lib/about/license_page.dart b/frontend/lib/about/license_page.dart index acfd21518..6c9c85182 100644 --- a/frontend/lib/about/license_page.dart +++ b/frontend/lib/about/license_page.dart @@ -53,7 +53,7 @@ class CustomLicensePage extends StatelessWidget { return CustomScrollView( slivers: [ - CustomSliverAppBar(title: t.about.info.licenses(n: licenses.length)), + CustomSliverAppBar(title: t.about.licenses(n: licenses.length)), SliverList( delegate: SliverChildBuilderDelegate( (BuildContext context, int index) {