feat(mobile): improve localization (#2405)

This commit is contained in:
Michel Heusschen 2023-05-09 15:58:27 +02:00 committed by GitHub
parent dffd992304
commit cd43edf074
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 26 deletions

View File

@ -112,6 +112,7 @@
"control_bottom_app_bar_delete": "Delete", "control_bottom_app_bar_delete": "Delete",
"control_bottom_app_bar_favorite": "Favorite", "control_bottom_app_bar_favorite": "Favorite",
"control_bottom_app_bar_archive": "Archive", "control_bottom_app_bar_archive": "Archive",
"control_bottom_app_bar_unarchive": "Unarchive",
"control_bottom_app_bar_share": "Share", "control_bottom_app_bar_share": "Share",
"create_album_page_untitled": "Untitled", "create_album_page_untitled": "Untitled",
"create_shared_album_page_create": "Create", "create_shared_album_page_create": "Create",
@ -135,6 +136,7 @@
"experimental_settings_subtitle": "Use at your own risk!", "experimental_settings_subtitle": "Use at your own risk!",
"experimental_settings_title": "Experimental", "experimental_settings_title": "Experimental",
"favorites_page_title": "Favorites", "favorites_page_title": "Favorites",
"favorites_page_no_favorites": "No favorite assets found",
"home_page_add_to_album_conflicts": "Added {added} assets to album {album}. {failed} assets are already in the album.", "home_page_add_to_album_conflicts": "Added {added} assets to album {album}. {failed} assets are already in the album.",
"home_page_add_to_album_err_local": "Can not add local assets to albums yet, skipping", "home_page_add_to_album_err_local": "Can not add local assets to albums yet, skipping",
"home_page_add_to_album_success": "Added {added} assets to album {album}.", "home_page_add_to_album_success": "Added {added} assets to album {album}.",
@ -272,5 +274,6 @@
"advanced_settings_troubleshooting_subtitle": "Enable additional features for troubleshooting", "advanced_settings_troubleshooting_subtitle": "Enable additional features for troubleshooting",
"description_input_submit_error": "Error updating description, check the log for more details", "description_input_submit_error": "Error updating description, check the log for more details",
"description_input_hint_text": "Add description...", "description_input_hint_text": "Add description...",
"archive_page_title": "Archive ({})" "archive_page_title": "Archive ({})",
"archive_page_no_archived_assets": "No archived assets found"
} }

View File

@ -85,15 +85,15 @@ class SharingPage extends HookConsumerWidget {
), ),
), ),
subtitle: isOwner subtitle: isOwner
? const Text( ? Text(
'Owned', 'album_thumbnail_owned'.tr(),
style: TextStyle( style: const TextStyle(
fontSize: 12.0, fontSize: 12.0,
), ),
) )
: album.ownerName != null : album.ownerName != null
? Text( ? Text(
'Shared by ${album.ownerName!}', 'album_thumbnail_shared_by'.tr(args: [album.ownerName!]),
style: const TextStyle( style: const TextStyle(
fontSize: 12.0, fontSize: 12.0,
), ),

View File

@ -80,8 +80,10 @@ class ArchivePage extends HookConsumerWidget {
leading: const Icon( leading: const Icon(
Icons.unarchive_rounded, Icons.unarchive_rounded,
), ),
title: title: Text(
const Text("Unarchive", style: TextStyle(fontSize: 14)), 'control_bottom_app_bar_unarchive'.tr(),
style: const TextStyle(fontSize: 14),
),
onTap: () { onTap: () {
if (selection.value.isNotEmpty) { if (selection.value.isNotEmpty) {
ref ref
@ -112,8 +114,8 @@ class ArchivePage extends HookConsumerWidget {
return Scaffold( return Scaffold(
appBar: buildAppBar(), appBar: buildAppBar(),
body: archivedAssets.value.isEmpty body: archivedAssets.value.isEmpty
? const Center( ? Center(
child: Text('No archived assets found.'), child: Text('archive_page_no_archived_assets'.tr()),
) )
: Stack( : Stack(
children: [ children: [

View File

@ -1,5 +1,5 @@
import 'dart:io'; import 'dart:io';
import 'package:easy_localization/easy_localization.dart';
import 'package:auto_route/auto_route.dart'; import 'package:auto_route/auto_route.dart';
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -338,22 +338,26 @@ class GalleryViewerPage extends HookConsumerWidget {
showSelectedLabels: false, showSelectedLabels: false,
showUnselectedLabels: false, showUnselectedLabels: false,
items: [ items: [
const BottomNavigationBarItem(
icon: Icon(Icons.ios_share_rounded),
label: 'Share',
tooltip: 'Share',
),
BottomNavigationBarItem( BottomNavigationBarItem(
icon: currentAsset.isArchived icon: const Icon(Icons.ios_share_rounded),
? const Icon(Icons.unarchive_rounded) label: 'control_bottom_app_bar_share'.tr(),
: const Icon(Icons.archive_outlined), tooltip: 'control_bottom_app_bar_share'.tr(),
label: 'Archive',
tooltip: 'Archive',
), ),
const BottomNavigationBarItem( currentAsset.isArchived
icon: Icon(Icons.delete_outline), ? BottomNavigationBarItem(
label: 'Delete', icon: const Icon(Icons.unarchive_rounded),
tooltip: 'Delete', label: 'control_bottom_app_bar_unarchive'.tr(),
tooltip: 'control_bottom_app_bar_unarchive'.tr(),
)
: BottomNavigationBarItem(
icon: const Icon(Icons.archive_outlined),
label: 'control_bottom_app_bar_archive'.tr(),
tooltip: 'control_bottom_app_bar_archive'.tr(),
),
BottomNavigationBarItem(
icon: const Icon(Icons.delete_outline),
label: 'control_bottom_app_bar_delete'.tr(),
tooltip: 'control_bottom_app_bar_delete'.tr(),
), ),
], ],
onTap: (index) { onTap: (index) {

View File

@ -27,8 +27,8 @@ class FavoritesPage extends HookConsumerWidget {
return Scaffold( return Scaffold(
appBar: buildAppBar(), appBar: buildAppBar(),
body: ref.watch(favoriteAssetProvider).isEmpty body: ref.watch(favoriteAssetProvider).isEmpty
? const Center( ? Center(
child: Text('No favorite assets found.'), child: Text('favorites_page_no_favorites'.tr()),
) )
: ImmichAssetGrid( : ImmichAssetGrid(
assets: ref.watch(favoriteAssetProvider), assets: ref.watch(favoriteAssetProvider),