Feature: Add support for localization, introduce slang for translations, and integrate German and English locale support throughout the app
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:app/core/i18n/translations.g.dart';
|
||||
import 'package:app/core/ui/panel.dart';
|
||||
import 'package:app/modules/settings/modules/app/app_settings_view.dart';
|
||||
import 'package:app/modules/settings/modules/help/feedback_view.dart';
|
||||
@@ -12,8 +13,10 @@ class SettingsView extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final t = Translations.of(context);
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('Einstellungen')),
|
||||
appBar: AppBar(title: Text(t.settings.title)),
|
||||
body: PanelNavigator(rootBuilder: (ctx) => _CategoryList()),
|
||||
);
|
||||
}
|
||||
@@ -24,6 +27,7 @@ class _CategoryList extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final t = Translations.of(context);
|
||||
|
||||
Widget tile(IconData icon, String label, Widget Function() detail) {
|
||||
return Padding(
|
||||
@@ -53,29 +57,41 @@ class _CategoryList extends StatelessWidget {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const _SectionHeader('App-Einstellungen'),
|
||||
tile(Icons.tune, 'App-Einstellungen', () => const AppSettingsView()),
|
||||
_SectionHeader(t.settings.sections.app),
|
||||
tile(
|
||||
Icons.tune,
|
||||
t.settings.items.appSettings,
|
||||
() => const AppSettingsView(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
const _SectionHeader('Meine Daten'),
|
||||
_SectionHeader(t.settings.sections.account),
|
||||
tile(
|
||||
Icons.badge_outlined,
|
||||
'Persönliche Daten',
|
||||
t.settings.items.personalData,
|
||||
() => const PersonalPanel(),
|
||||
),
|
||||
tile(
|
||||
Icons.manage_accounts_outlined,
|
||||
'Kontoverwaltung',
|
||||
t.settings.items.accountManagement,
|
||||
() => const AccountPanel(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
const _SectionHeader('Hilfe'),
|
||||
tile(Icons.help_outline, 'Hilfe', () => const HelpPanel()),
|
||||
tile(Icons.feedback_outlined, 'Feedback', () => const FeedbackPanel()),
|
||||
_SectionHeader(t.settings.sections.help),
|
||||
tile(
|
||||
Icons.help_outline,
|
||||
t.settings.items.helpCenter,
|
||||
() => const HelpPanel(),
|
||||
),
|
||||
tile(
|
||||
Icons.feedback_outlined,
|
||||
t.settings.items.feedback,
|
||||
() => const FeedbackPanel(),
|
||||
),
|
||||
tile(
|
||||
Icons.gavel_outlined,
|
||||
'Rechtliches & Datenschutz',
|
||||
t.settings.items.legalPrivacy, // "Rechtliches & Datenschutz"
|
||||
() => const LegalPanel(),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
@@ -83,12 +99,10 @@ class _CategoryList extends StatelessWidget {
|
||||
const Divider(),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.logout),
|
||||
title: const Text('Abmelden'),
|
||||
title: Text(t.settings.items.logout),
|
||||
onTap: () {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Logout… (noch nicht implementiert)'),
|
||||
),
|
||||
SnackBar(content: Text(t.settings.messages.logoutNotImplemented)),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user