l10n: it
This commit is contained in:
parent
6893e8ad00
commit
ff874dffdf
8 changed files with 90 additions and 19 deletions
|
@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
## <a id="unreleased"></a>[Unreleased]
|
## <a id="unreleased"></a>[Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Info: improved GeoTIFF section
|
||||||
|
- GeoTIFF: locating from GeoTIFF metadata (requires rescan, limited to some projections)
|
||||||
|
- GeoTIFF: overlay on map (limited to some projections)
|
||||||
|
- Italian translation (thanks glemco)
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
- upgraded Flutter to stable v2.10.4
|
- upgraded Flutter to stable v2.10.4
|
||||||
|
|
|
@ -85,7 +85,7 @@ At this stage this project does *not* accept PRs, except for translations.
|
||||||
|
|
||||||
### Translations
|
### Translations
|
||||||
|
|
||||||
If you want to translate this app in your language and share the result, [there is a guide](https://github.com/deckerst/aves/wiki/Contributing-to-Translations). English, Korean and French are already handled by me. Russian, German, Spanish, Portuguese, Indonesian & Japanese are handled by generous volunteers.
|
If you want to translate this app in your language and share the result, [there is a guide](https://github.com/deckerst/aves/wiki/Contributing-to-Translations). English, Korean and French are already handled by me. Russian, German, Spanish, Portuguese, Indonesian, Japanese & Italian are handled by generous volunteers.
|
||||||
|
|
||||||
### Donations
|
### Donations
|
||||||
|
|
||||||
|
|
|
@ -361,7 +361,7 @@
|
||||||
|
|
||||||
"albumPickPageTitleCopy": "Copia su album",
|
"albumPickPageTitleCopy": "Copia su album",
|
||||||
"albumPickPageTitleExport": "Esportazione su album",
|
"albumPickPageTitleExport": "Esportazione su album",
|
||||||
"albumPickPageTitleMove": "Sposta su Album",
|
"albumPickPageTitleMove": "Sposta su album",
|
||||||
"albumPickPageTitlePick": "Scegli l'album",
|
"albumPickPageTitlePick": "Scegli l'album",
|
||||||
|
|
||||||
"albumCamera": "Camera",
|
"albumCamera": "Camera",
|
||||||
|
|
|
@ -11,6 +11,7 @@ class AboutCredits extends StatelessWidget {
|
||||||
'Bahasa Indonesia': 'MeFinity',
|
'Bahasa Indonesia': 'MeFinity',
|
||||||
'Deutsch': 'JanWaldhorn',
|
'Deutsch': 'JanWaldhorn',
|
||||||
'Español (México)': 'n-berenice',
|
'Español (México)': 'n-berenice',
|
||||||
|
'Italiano': 'glemco',
|
||||||
'Português (Brasil)': 'Jonatas De Almeida Barros',
|
'Português (Brasil)': 'Jonatas De Almeida Barros',
|
||||||
'Русский': 'D3ZOXY',
|
'Русский': 'D3ZOXY',
|
||||||
'日本語': 'Maki',
|
'日本語': 'Maki',
|
||||||
|
|
|
@ -142,7 +142,6 @@ class AppDrawer extends StatelessWidget {
|
||||||
),
|
),
|
||||||
child: Wrap(
|
child: Wrap(
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
runSpacing: 8,
|
|
||||||
children: [
|
children: [
|
||||||
OutlinedButton.icon(
|
OutlinedButton.icon(
|
||||||
// key is expected by test driver
|
// key is expected by test driver
|
||||||
|
|
|
@ -2,15 +2,18 @@ import 'dart:collection';
|
||||||
|
|
||||||
import 'package:aves/l10n/l10n.dart';
|
import 'package:aves/l10n/l10n.dart';
|
||||||
import 'package:aves/model/settings/settings.dart';
|
import 'package:aves/model/settings/settings.dart';
|
||||||
|
import 'package:aves/theme/durations.dart';
|
||||||
|
import 'package:aves/widgets/common/basic/reselectable_radio_list_tile.dart';
|
||||||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||||
import 'package:aves/widgets/dialogs/aves_selection_dialog.dart';
|
import 'package:aves/widgets/common/providers/media_query_data_provider.dart';
|
||||||
import 'package:aves/widgets/settings/language/locales.dart';
|
import 'package:aves/widgets/settings/language/locales.dart';
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/scheduler.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class LocaleTile extends StatelessWidget {
|
class LocaleTile extends StatelessWidget {
|
||||||
static const _systemLocaleOption = Locale('system');
|
static const systemLocaleOption = Locale('system');
|
||||||
|
|
||||||
const LocaleTile({Key? key}) : super(key: key);
|
const LocaleTile({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@ -23,33 +26,89 @@ class LocaleTile extends StatelessWidget {
|
||||||
subtitle: Selector<Settings, Locale?>(
|
subtitle: Selector<Settings, Locale?>(
|
||||||
selector: (context, s) => settings.locale,
|
selector: (context, s) => settings.locale,
|
||||||
builder: (context, locale, child) {
|
builder: (context, locale, child) {
|
||||||
return Text(locale == null ? context.l10n.settingsSystemDefault : _getLocaleName(locale));
|
return Text(locale == null ? context.l10n.settingsSystemDefault : getLocaleName(locale));
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
onTap: () => showSelectionDialog<Locale>(
|
onTap: () async {
|
||||||
context: context,
|
final value = await Navigator.push<Locale>(
|
||||||
builder: (context) => AvesSelectionDialog<Locale>(
|
context,
|
||||||
initialValue: settings.locale ?? _systemLocaleOption,
|
MaterialPageRoute(
|
||||||
options: _getLocaleOptions(context),
|
settings: const RouteSettings(name: LocaleSelectionPage.routeName),
|
||||||
title: context.l10n.settingsLanguage,
|
builder: (context) => const LocaleSelectionPage(),
|
||||||
dense: true,
|
),
|
||||||
),
|
);
|
||||||
onSelection: (v) => settings.locale = v == _systemLocaleOption ? null : v,
|
// wait for the dialog to hide as applying the change may block the UI
|
||||||
),
|
await Future.delayed(Durations.pageTransitionAnimation * timeDilation);
|
||||||
|
if (value != null) {
|
||||||
|
settings.locale = value == systemLocaleOption ? null : value;
|
||||||
|
}
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
String _getLocaleName(Locale locale) {
|
static String getLocaleName(Locale locale) {
|
||||||
// the package `flutter_localized_locales` has the answer for all locales
|
// the package `flutter_localized_locales` has the answer for all locales
|
||||||
// but it comes with 3 MB of assets
|
// but it comes with 3 MB of assets
|
||||||
return SupportedLocales.languagesByLanguageCode[locale.languageCode] ?? locale.toString();
|
return SupportedLocales.languagesByLanguageCode[locale.languageCode] ?? locale.toString();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class LocaleSelectionPage extends StatefulWidget {
|
||||||
|
static const routeName = '/settings/locale';
|
||||||
|
|
||||||
|
const LocaleSelectionPage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<LocaleSelectionPage> createState() => _LocaleSelectionPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _LocaleSelectionPageState extends State<LocaleSelectionPage> {
|
||||||
|
late Locale _selectedValue;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_selectedValue = settings.locale ?? LocaleTile.systemLocaleOption;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return MediaQueryDataProvider(
|
||||||
|
child: Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text(context.l10n.settingsLanguage),
|
||||||
|
),
|
||||||
|
body: SafeArea(
|
||||||
|
child: ListView(
|
||||||
|
children: _getLocaleOptions(context).entries.map((kv) {
|
||||||
|
final value = kv.key;
|
||||||
|
final title = kv.value;
|
||||||
|
return ReselectableRadioListTile<Locale>(
|
||||||
|
// key is expected by test driver
|
||||||
|
key: Key(value.toString()),
|
||||||
|
value: value,
|
||||||
|
groupValue: _selectedValue,
|
||||||
|
onChanged: (v) => Navigator.pop(context, v),
|
||||||
|
reselectable: true,
|
||||||
|
title: Text(
|
||||||
|
title,
|
||||||
|
softWrap: false,
|
||||||
|
overflow: TextOverflow.fade,
|
||||||
|
maxLines: 1,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
LinkedHashMap<Locale, String> _getLocaleOptions(BuildContext context) {
|
LinkedHashMap<Locale, String> _getLocaleOptions(BuildContext context) {
|
||||||
final displayLocales = AppLocalizations.supportedLocales.map((locale) => MapEntry(locale, _getLocaleName(locale))).toList()..sort((a, b) => compareAsciiUpperCase(a.value, b.value));
|
final displayLocales = AppLocalizations.supportedLocales.map((locale) => MapEntry(locale, LocaleTile.getLocaleName(locale))).toList()..sort((a, b) => compareAsciiUpperCase(a.value, b.value));
|
||||||
|
|
||||||
return LinkedHashMap.of({
|
return LinkedHashMap.of({
|
||||||
_systemLocaleOption: context.l10n.settingsSystemDefault,
|
LocaleTile.systemLocaleOption: context.l10n.settingsSystemDefault,
|
||||||
...LinkedHashMap.fromEntries(displayLocales),
|
...LinkedHashMap.fromEntries(displayLocales),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ class SupportedLocales {
|
||||||
'es': 'Español (México)',
|
'es': 'Español (México)',
|
||||||
'fr': 'Français',
|
'fr': 'Français',
|
||||||
'id': 'Bahasa Indonesia',
|
'id': 'Bahasa Indonesia',
|
||||||
|
'it': 'Italiano',
|
||||||
'ja': '日本語',
|
'ja': '日本語',
|
||||||
'ko': '한국어',
|
'ko': '한국어',
|
||||||
'pt': 'Português (Brasil)',
|
'pt': 'Português (Brasil)',
|
||||||
|
|
|
@ -15,6 +15,10 @@
|
||||||
"entryActionShowGeoTiffOnMap"
|
"entryActionShowGeoTiffOnMap"
|
||||||
],
|
],
|
||||||
|
|
||||||
|
"it": [
|
||||||
|
"entryActionShowGeoTiffOnMap"
|
||||||
|
],
|
||||||
|
|
||||||
"ja": [
|
"ja": [
|
||||||
"entryActionShowGeoTiffOnMap"
|
"entryActionShowGeoTiffOnMap"
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in a new issue