Skip to content

Commit

Permalink
1175: replace identity icon, restructure translations for about
Browse files Browse the repository at this point in the history
  • Loading branch information
f1sh1918 committed Nov 8, 2023
1 parent 5aa21d3 commit a0b82b2
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 40 deletions.
23 changes: 13 additions & 10 deletions frontend/assets/l10n/app_de.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
23 changes: 13 additions & 10 deletions frontend/assets/l10n/app_en.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
1 change: 0 additions & 1 deletion frontend/build-configs/bayern/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 0 additions & 1 deletion frontend/build-configs/nuernberg/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ export const nuernbergCommon: CommonBuildConfigType = {
],
featureFlags: {
verification: true,
settings: true
},
applicationUrl: "https://beantragen.nuernberg.sozialpass.app",
publisherAddress:
Expand Down
1 change: 0 additions & 1 deletion frontend/build-configs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ type BuildConfigType = {

export type FeatureFlagsType = {
verification: boolean
settings: boolean
}

export type ThemeType = {
Expand Down
17 changes: 8 additions & 9 deletions frontend/lib/about/about_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ class AboutPageState extends State<AboutPage> {
@override
Widget build(BuildContext context) {
final config = Configuration.of(context);
print('title:${t.about.settings.languageChange}');
print('locale:${LocaleSettings.currentLocale.languageCode}');
return FutureBuilder<PackageInfo>(
future: PackageInfo.fromPlatform(),
builder: (context, snapshot) {
Expand Down Expand Up @@ -98,7 +96,7 @@ class AboutPageState extends State<AboutPage> {
);
},
),
if (buildConfig.featureFlags.settings)
if (buildConfig.appLocales.length > 1)
Column(children: [
const Divider(
height: 1,
Expand All @@ -116,21 +114,22 @@ class AboutPageState extends State<AboutPage> {
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,
Expand All @@ -142,7 +141,7 @@ class AboutPageState extends State<AboutPage> {
),
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',
Expand Down
2 changes: 1 addition & 1 deletion frontend/lib/about/language_change.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
),
);
Expand Down
2 changes: 1 addition & 1 deletion frontend/lib/about/license_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class CustomLicensePage extends StatelessWidget {

return CustomScrollView(
slivers: <Widget>[
CustomSliverAppBar(title: t.about.licenses(n: licenses.length)),
CustomSliverAppBar(title: t.about.info.licenses(n: licenses.length)),
SliverList(
delegate: SliverChildBuilderDelegate(
(BuildContext context, int index) {
Expand Down
8 changes: 6 additions & 2 deletions frontend/lib/about/section.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions frontend/lib/home/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ class HomePageState extends State<HomePage> {
if (buildConfig.featureFlags.verification)
AppFlow(
IdentificationPage(),
Icons.remove_red_eye_outlined,
Icons.credit_card,
(BuildContext context) => t.identification.title,
GlobalKey<NavigatorState>(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<NavigatorState>(debugLabel: 'About tab key')),
];
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/lib/themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down Expand Up @@ -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)),
Expand Down

0 comments on commit a0b82b2

Please sign in to comment.