1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-08 23:07:06 +02:00

fix: Update locked folder text and improve translations (#18622)

* Update locked folder text and remove unused translations

* uppercase Locked folder in Menu

* convert some translates to icu and improve

* add iOS debug info translations for background processes

* fix lint

---------

Co-authored-by: dvbthien <dvbthien@gmail.com>
This commit is contained in:
Thien Dang
2025-05-30 03:06:08 +07:00
committed by GitHub
parent dbdb64f6c5
commit 0f42babb6b
7 changed files with 57 additions and 84 deletions

View File

@ -14,6 +14,7 @@ import 'package:immich_mobile/providers/album/album.provider.dart';
import 'package:immich_mobile/providers/album/album_sort_by_options.provider.dart';
import 'package:immich_mobile/providers/user.provider.dart';
import 'package:immich_mobile/routing/router.dart';
import 'package:immich_mobile/utils/translation.dart';
import 'package:immich_mobile/widgets/album/album_thumbnail_card.dart';
import 'package:immich_mobile/widgets/common/immich_app_bar.dart';
import 'package:immich_mobile/widgets/common/immich_thumbnail.dart';
@ -229,13 +230,11 @@ class AlbumsPage extends HookConsumerWidget {
),
subtitle: sorted[index].ownerId != null
? Text(
'${(sorted[index].assetCount == 1 ? 'album_thumbnail_card_item'.tr() : 'album_thumbnail_card_items'.tr(
namedArgs: {
'count': sorted[index]
.assetCount
.toString(),
},
))} ${sorted[index].ownerId != userId ? 'album_thumbnail_shared_by'.tr(namedArgs: {'user': sorted[index].ownerName!}) : 'owned'.tr()}',
'${t('items_count', {
'count': sorted[index].assetCount,
})} • ${sorted[index].ownerId != userId ? t('shared_by_user', {
'user': sorted[index].ownerName!,
}) : 'owned'.tr()}',
overflow: TextOverflow.ellipsis,
style:
context.textTheme.bodyMedium?.copyWith(

View File

@ -5,6 +5,7 @@ import 'package:immich_mobile/entities/album.entity.dart';
import 'package:immich_mobile/extensions/build_context_extensions.dart';
import 'package:immich_mobile/extensions/theme_extensions.dart';
import 'package:immich_mobile/providers/user.provider.dart';
import 'package:immich_mobile/utils/translation.dart';
import 'package:immich_mobile/widgets/common/immich_thumbnail.dart';
class AlbumThumbnailCard extends ConsumerWidget {
@ -61,28 +62,24 @@ class AlbumThumbnailCard extends ConsumerWidget {
if (album.ownerId == ref.read(currentUserProvider)?.id) {
owner = 'owned'.tr();
} else if (album.ownerName != null) {
owner = 'album_thumbnail_shared_by'
.tr(namedArgs: {'user': album.ownerName!});
owner = t('shared_by_user', {'user': album.ownerName!});
}
}
return RichText(
overflow: TextOverflow.fade,
text: TextSpan(
style: context.textTheme.bodyMedium?.copyWith(
color: context.colorScheme.onSurfaceSecondary,
),
return Text.rich(
TextSpan(
children: [
TextSpan(
text: album.assetCount == 1
? 'album_thumbnail_card_item'.tr()
: 'album_thumbnail_card_items'
.tr(namedArgs: {'count': '${album.assetCount}'}),
text: t('items_count', {'count': album.assetCount}),
),
if (owner != null) const TextSpan(text: ''),
if (owner != null) TextSpan(text: owner),
],
style: context.textTheme.bodyMedium?.copyWith(
color: context.colorScheme.onSurfaceSecondary,
),
),
overflow: TextOverflow.fade,
);
}

View File

@ -7,6 +7,7 @@ import 'package:immich_mobile/extensions/build_context_extensions.dart';
import 'package:immich_mobile/routing/router.dart';
import 'package:immich_mobile/services/api.service.dart';
import 'package:immich_mobile/utils/image_url_builder.dart';
import 'package:immich_mobile/utils/translation.dart';
import 'package:openapi/api.dart';
class AlbumThumbnailListTile extends StatelessWidget {
@ -90,20 +91,25 @@ class AlbumThumbnailListTile extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: [
Text(
album.assetCount == 1
? 'album_thumbnail_card_item'
: 'album_thumbnail_card_items',
t('items_count', {'count': album.assetCount}),
style: const TextStyle(
fontSize: 12,
),
).tr(namedArgs: {'count': '${album.assetCount}'}),
if (album.shared)
),
if (album.shared) ...[
const Text(
'album_thumbnail_card_shared',
'',
style: TextStyle(
fontSize: 12,
),
).tr(),
),
Text(
'shared'.tr(),
style: const TextStyle(
fontSize: 12,
),
),
],
],
),
],

View File

@ -1,8 +1,9 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/extensions/build_context_extensions.dart';
import 'package:immich_mobile/providers/backup/ios_background_settings.provider.dart';
import 'package:intl/intl.dart';
import 'package:immich_mobile/utils/translation.dart';
/// This is a simple debug widget which should be removed later on when we are
/// more confident about background sync
@ -19,26 +20,35 @@ class IosDebugInfoTile extends HookConsumerWidget {
final processing = settings.timeOfLastProcessing;
final processes = settings.numberOfBackgroundTasksQueued;
final processOrProcesses = processes == 1 ? 'process' : 'processes';
final numberOrZero = processes == 0 ? 'No' : processes.toString();
final title = '$numberOrZero background $processOrProcesses queued';
final String title;
if (processes == 0) {
title = 'ios_debug_info_no_processes_queued'.tr();
} else {
title = t('ios_debug_info_processes_queued', {'count': processes});
}
final df = DateFormat.yMd().add_jm();
final String subtitle;
if (fetch == null && processing == null) {
subtitle = 'No background sync job has run yet';
subtitle = 'ios_debug_info_no_sync_yet'.tr();
} else if (fetch != null && processing == null) {
subtitle = 'Fetch ran ${df.format(fetch)}';
subtitle =
t('ios_debug_info_fetch_ran_at', {'dateTime': df.format(fetch)});
} else if (processing != null && fetch == null) {
subtitle = 'Processing ran ${df.format(processing)}';
subtitle = t(
'ios_debug_info_processing_ran_at',
{'dateTime': df.format(processing)},
);
} else {
final fetchOrProcessing =
fetch!.isAfter(processing!) ? fetch : processing;
subtitle = 'Last sync ${df.format(fetchOrProcessing)}';
subtitle = t(
'ios_debug_info_last_sync_at',
{'dateTime': df.format(fetchOrProcessing)},
);
}
return ListTile(
key: ValueKey(title),
title: Text(
title,
style: TextStyle(