Internationalization (German) of the mobile app. (#246)

* Add i18n framework to mobile app and write simple translation generator

* Replace all texts in login_form with i18n keys

* Localization of sharing section

* Localization of asset viewer section

* Use JSON as base translation format

* Add check for missing/unused translation keys

* Add localizely

* Remove i18n directory in favour of localizely

* Backup Translation

* More translations

* Translate home page

* Translation of search page

* Translate new server version announcement

* Reformat code

* Fix typo in german translation

* Update englisch translations

* Change translation keys to match dart filenames

* Add /api to translated endpoint_urls

* Update localizely.yml

* Add languages to ios plist

* Remove unused keys

* Added script to check outdated key in other translations

* Add download key to localizely.yml

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
Matthias Rupp
2022-07-07 20:40:54 +02:00
committed by GitHub
parent f3032f74a4
commit 2b5cef156c
36 changed files with 601 additions and 213 deletions

View File

@@ -1,4 +1,5 @@
import 'package:auto_route/auto_route.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:fluttertoast/fluttertoast.dart';
@@ -55,7 +56,7 @@ class BackupAlbumSelectionPage extends HookConsumerWidget {
if (ref.watch(backupProvider).selectedBackupAlbums.length == 1) {
ImmichToast.show(
context: context,
msg: "Cannot remove the only album",
msg: "backup_err_only_album".tr(),
toastType: ToastType.error,
gravity: ToastGravity.BOTTOM,
);
@@ -136,20 +137,21 @@ class BackupAlbumSelectionPage extends HookConsumerWidget {
icon: const Icon(Icons.arrow_back_ios_rounded),
),
title: const Text(
"Select Albums",
"backup_album_selection_page_select_albums",
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
),
).tr(),
elevation: 0,
),
body: ListView(
physics: const ClampingScrollPhysics(),
children: [
const Padding(
padding: EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
child: Text(
"Selection Info",
Padding(
padding:
const EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
child: const Text(
"backup_album_selection_page_selection_info",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14),
),
).tr(),
),
// Selected Album Chips
@@ -181,14 +183,18 @@ class BackupAlbumSelectionPage extends HookConsumerWidget {
ListTile(
visualDensity: VisualDensity.compact,
title: Text(
"Total unique assets",
"backup_album_selection_page_total_assets",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: Colors.grey[700]),
),
).tr(),
trailing: Text(
'${ref.watch(backupProvider).allUniqueAssets.length}',
ref
.watch(backupProvider)
.allUniqueAssets
.length
.toString(),
style: const TextStyle(fontWeight: FontWeight.bold),
),
),
@@ -199,19 +205,20 @@ class BackupAlbumSelectionPage extends HookConsumerWidget {
ListTile(
title: Text(
"Albums on device (${availableAlbums.length})",
"backup_album_selection_page_albums_device"
.tr(args: [availableAlbums.length.toString()]),
style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 14),
),
subtitle: Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Text(
"Tap to include, double tap to exclude",
"backup_album_selection_page_albums_tap",
style: TextStyle(
fontSize: 12,
color: Theme.of(context).primaryColor,
fontWeight: FontWeight.bold,
),
),
).tr(),
),
trailing: IconButton(
splashRadius: 16,
@@ -230,21 +237,21 @@ class BackupAlbumSelectionPage extends HookConsumerWidget {
borderRadius: BorderRadius.circular(12)),
elevation: 5,
title: Text(
'Selection Info',
'backup_album_selection_page_selection_info',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Theme.of(context).primaryColor,
),
),
).tr(),
content: SingleChildScrollView(
child: ListBody(
children: [
Text(
'Assets can scatter across multiple albums. Thus, albums can be included or excluded during the backup process.',
'backup_album_selection_page_assets_scatter',
style: TextStyle(
fontSize: 14, color: Colors.grey[700]),
),
).tr(),
],
),
),