Skip to content

Commit

Permalink
chore(#43) : add app localization setting
Browse files Browse the repository at this point in the history
  • Loading branch information
JordyHers committed Jul 2, 2023
1 parent 87b5ccc commit bff0e55
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 11 deletions.
3 changes: 3 additions & 0 deletions lib/app/app.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:times_up_flutter/app/config/screencontroller_config.dart';
import 'package:times_up_flutter/l10n/l10n.dart';
import 'package:times_up_flutter/theme/theme.dart';
import 'package:times_up_flutter/utils/app_strings.dart';

Expand All @@ -18,6 +19,8 @@ class _TimesUpAppState extends State<TimesUpApp> with WidgetsBindingObserver {
title: Strings.appName,
theme: AppTheme.lightTheme,
darkTheme: AppTheme.darkTheme,
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
home: const ScreensController(),
);
}
Expand Down
8 changes: 5 additions & 3 deletions lib/app/pages/parent_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import 'package:times_up_flutter/common_widgets/jh_info_row_widget.dart';
import 'package:times_up_flutter/common_widgets/jh_loading_widget.dart';
import 'package:times_up_flutter/common_widgets/jh_summary_tile.dart';
import 'package:times_up_flutter/common_widgets/show_logger.dart';
import 'package:times_up_flutter/l10n/l10n.dart';
import 'package:times_up_flutter/models/child_model/child_model.dart';
import 'package:times_up_flutter/services/api_path.dart';
import 'package:times_up_flutter/services/app_usage_service.dart';
Expand Down Expand Up @@ -158,7 +159,7 @@ class _ParentPageState extends State<ParentPage>
const SizedBox.shrink()
else
JHDisplayText(
text: 'Welcome',
text: AppLocalizations.of(context).welcome,
style: TextStyle(
color: CustomColors.indigoDark,
fontWeight: FontWeight.w900,
Expand All @@ -169,7 +170,8 @@ class _ParentPageState extends State<ParentPage>
child: Showcase(
key: _settingsKey,
textColor: Colors.indigo,
description: 'change the settings here',
description: AppLocalizations.of(context)
.changeTheSettingsHere,
child: const CircleAvatar(
child: Icon(Icons.person),
),
Expand All @@ -186,7 +188,7 @@ class _ParentPageState extends State<ParentPage>
floatingActionButton: Showcase(
key: _addKey,
textColor: Colors.indigo,
description: 'Add a new child here ',
description: AppLocalizations.of(context).addNewChildHere,
child: FloatingActionButton(
onPressed: () => EditChildPage.show(
context,
Expand Down
7 changes: 7 additions & 0 deletions lib/l10n/arb/app_de.arb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"@@locale": "de",
"welcome": "Wilkommen",
"changeTheSettingsHere": "Ändern Sie hier die Einstellungen",
"addNewChildHere": "Fügen Sie hier ein neues Kind hinzu"

}
8 changes: 4 additions & 4 deletions lib/l10n/arb/app_en.arb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"@@locale": "en",
"counterAppBarTitle": "Counter",
"@counterAppBarTitle": {
"description": "Text shown in the AppBar of the Counter Page"
}
"welcome": "Welcome",
"changeTheSettingsHere": "change the settings here",
"addNewChildHere": "Add a new child here "

}
9 changes: 5 additions & 4 deletions lib/l10n/arb/app_es.arb
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"@@locale": "es",
"counterAppBarTitle": "Contador",
"@counterAppBarTitle": {
"description": "Texto mostrado en la AppBar de la página del contador"
}
"welcome": "Hola !",
"changeTheSettingsHere": "Cambiar la configuración aquí",
"addNewChildHere": "Añadir un nuevo niño[a] aquí"


}
7 changes: 7 additions & 0 deletions lib/l10n/arb/app_fr.arb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"@@locale": "fr",
"welcome": "Bienvenue",
"changeTheSettingsHere": "Modifier les paramètres ici",
"addNewChildHere": "Ajoute un enfant ici"

}
7 changes: 7 additions & 0 deletions lib/l10n/arb/app_tr.arb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"@@locale": "tr",
"welcome": "Hoş Geldiniz",
"changeTheSettingsHere": "Buradaki ayarları değiştir",
"addNewChildHere": "Buraya yeni bir çocuk ekleyin"

}

0 comments on commit bff0e55

Please sign in to comment.