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
5 changed files with 35 additions and 26 deletions

View File

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

View File

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

View File

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

View File

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