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,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
@@ -47,8 +48,8 @@ class SearchBar extends HookConsumerWidget with PreferredSizeWidget {
onChanged: (value) {
ref.watch(searchPageStateProvider.notifier).setSearchTerm(value);
},
decoration: const InputDecoration(
hintText: 'Search your photos',
decoration: InputDecoration(
hintText: 'search_bar_hint'.tr(),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.transparent),
),

View File

@@ -55,7 +55,7 @@ class ThumbnailWithInfo extends StatelessWidget {
child: SizedBox(
width: MediaQuery.of(context).size.width / 3,
child: Text(
textInfo.capitalizeFirstLetter(),
textInfo,
style: const TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,

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:hive_flutter/hive_flutter.dart';
@@ -82,7 +83,7 @@ class SearchPage extends HookConsumerWidget {
return ThumbnailWithInfo(
imageUrl:
'https://images.unsplash.com/photo-1612178537253-bccd437b730e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8NXx8Ymxhbmt8ZW58MHx8MHx8&auto=format&fit=crop&w=700&q=60',
textInfo: 'No Places Info Available',
textInfo: 'search_page_no_places'.tr(),
onTap: () {},
);
}),
@@ -134,7 +135,7 @@ class SearchPage extends HookConsumerWidget {
return ThumbnailWithInfo(
imageUrl:
'https://images.unsplash.com/photo-1612178537253-bccd437b730e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8NXx8Ymxhbmt8ZW58MHx8MHx8&auto=format&fit=crop&w=700&q=60',
textInfo: 'No Object Info Available',
textInfo: 'sarch_no_objects'.tr(),
onTap: () {},
);
}),
@@ -158,20 +159,20 @@ class SearchPage extends HookConsumerWidget {
children: [
ListView(
children: [
const Padding(
Padding(
padding: EdgeInsets.all(16.0),
child: Text(
"Places",
child: const Text(
"search_page_places",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16),
),
).tr(),
),
_buildPlaces(),
const Padding(
Padding(
padding: EdgeInsets.all(16.0),
child: Text(
"Things",
child: const Text(
"search_page_things",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16),
),
).tr(),
),
_buildThings()
],

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:flutter_spinkit/flutter_spinkit.dart';
@@ -66,8 +67,8 @@ class SearchResultPage extends HookConsumerWidget {
onChanged: (value) {
ref.watch(searchPageStateProvider.notifier).setSearchTerm(value);
},
decoration: const InputDecoration(
hintText: 'New Search',
decoration: InputDecoration(
hintText: 'search_result_page_new_search_hint'.tr(),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.transparent),
),