From 7aaf48cb0ccb574545c45598c6c446ae46c738db Mon Sep 17 00:00:00 2001 From: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> Date: Fri, 5 Apr 2024 16:45:37 +0200 Subject: [PATCH] feat(mobile): add missing translations (#8537) * feat(mobile): add missing translations * fix formatting --- mobile/assets/i18n/en-US.json | 21 +++++++++++++++++++ .../modules/album/ui/album_viewer_appbar.dart | 14 ++++++------- .../backup/views/backup_options_page.dart | 5 ++--- .../login/ui/change_password_form.dart | 2 +- .../lib/modules/partner/ui/partner_list.dart | 11 +++++++--- .../ui/search_filter/camera_picker.dart | 5 +++-- .../search_filter/display_option_picker.dart | 7 ++++--- .../filter_bottom_sheet_scaffold.dart | 5 +++-- .../ui/search_filter/location_picker.dart | 7 ++++--- .../ui/search_filter/media_type_picker.dart | 7 ++++--- .../lib/modules/search/views/search_page.dart | 4 ++-- .../views/shared_link_edit_page.dart | 12 +++++++++-- 12 files changed, 68 insertions(+), 32 deletions(-) diff --git a/mobile/assets/i18n/en-US.json b/mobile/assets/i18n/en-US.json index eb654890ad..b182b879ac 100644 --- a/mobile/assets/i18n/en-US.json +++ b/mobile/assets/i18n/en-US.json @@ -1,6 +1,9 @@ { "action_common_cancel": "Cancel", "action_common_update": "Update", + "action_common_confirm": "Confirm", + "action_common_back": "Back", + "action_common_clear": "Clear", "add_to_album_bottom_sheet_added": "Added to {album}", "add_to_album_bottom_sheet_already_exists": "Already in {album}", "advanced_settings_log_level_title": "Log level: {}", @@ -19,6 +22,7 @@ "album_thumbnail_card_shared": " ยท Shared", "album_thumbnail_owned": "Owned", "album_thumbnail_shared_by": "Shared by {}", + "album_viewer_appbar_delete_confirm": "Are you sure you want to delete this album from your account?", "album_viewer_appbar_share_delete": "Delete album", "album_viewer_appbar_share_err_delete": "Failed to delete album", "album_viewer_appbar_share_err_leave": "Failed to leave album", @@ -111,6 +115,7 @@ "backup_manual_in_progress": "Upload already in progress. Try after sometime", "backup_manual_success": "Success", "backup_manual_title": "Upload status", + "backup_options_page_title": "Backup options", "cache_settings_album_thumbnails": "Library page thumbnails ({} assets)", "cache_settings_clear_cache_button": "Clear cache", "cache_settings_clear_cache_button_title": "Clears the app's cache. This will significantly impact the app's performance until the cache has rebuilt.", @@ -305,6 +310,8 @@ "partner_page_stop_sharing_content": "{} will no longer be able to access your photos.", "partner_page_stop_sharing_title": "Stop sharing your photos?", "partner_page_title": "Partner", + "partner_list_user_photos": "{user}'s photos", + "partner_list_view_all": "View all", "permission_onboarding_back": "Back", "permission_onboarding_continue_anyway": "Continue anyway", "permission_onboarding_get_started": "Get started", @@ -330,6 +337,18 @@ "recently_added_page_title": "Recently Added", "scaffold_body_error_occurred": "Error occurred", "search_bar_hint": "Search your photos", + "search_filter_apply": "Apply filter", + "search_filter_camera_make": "Make", + "search_filter_camera_model": "Model", + "search_filter_display_option_archive": "Archive", + "search_filter_display_option_favorite": "Favorite", + "search_filter_display_option_not_in_album": "Not in album", + "search_filter_location_city": "City", + "search_filter_location_country": "Country", + "search_filter_location_state": "State", + "search_filter_media_type_all": "All", + "search_filter_media_type_image": "Image", + "search_filter_media_type_video": "Video", "search_page_categories": "Categories", "search_page_favorites": "Favorites", "search_page_motion_photos": "Motion Photos", @@ -438,6 +457,8 @@ "shared_link_info_chip_metadata": "EXIF", "shared_link_info_chip_upload": "Upload", "shared_link_manage_links": "Manage Shared links", + "shared_link_public_album": "Public album", + "shared_link_individual_shared": "Individual shared", "share_done": "Done", "share_invite": "Invite to album", "sharing_page_album": "Shared albums", diff --git a/mobile/lib/modules/album/ui/album_viewer_appbar.dart b/mobile/lib/modules/album/ui/album_viewer_appbar.dart index b1a8d4c549..eaf5cbc961 100644 --- a/mobile/lib/modules/album/ui/album_viewer_appbar.dart +++ b/mobile/lib/modules/album/ui/album_viewer_appbar.dart @@ -73,20 +73,18 @@ class AlbumViewerAppbar extends HookConsumerWidget barrierDismissible: false, // user must tap button! builder: (BuildContext context) { return AlertDialog( - title: const Text('Delete album'), - content: const Text( - 'Are you sure you want to delete this album from your account?', - ), + title: const Text('album_viewer_appbar_share_delete').tr(), + content: const Text('album_viewer_appbar_delete_confirm').tr(), actions: [ TextButton( onPressed: () => context.pop('Cancel'), child: Text( - 'Cancel', + 'action_common_cancel', style: TextStyle( color: context.primaryColor, fontWeight: FontWeight.bold, ), - ), + ).tr(), ), TextButton( onPressed: () { @@ -94,12 +92,12 @@ class AlbumViewerAppbar extends HookConsumerWidget deleteAlbum(); }, child: Text( - 'Confirm', + 'action_common_confirm', style: TextStyle( fontWeight: FontWeight.bold, color: !context.isDarkTheme ? Colors.red : Colors.red[300], ), - ), + ).tr(), ), ], ); diff --git a/mobile/lib/modules/backup/views/backup_options_page.dart b/mobile/lib/modules/backup/views/backup_options_page.dart index b37ded6a6a..e8c9e50143 100644 --- a/mobile/lib/modules/backup/views/backup_options_page.dart +++ b/mobile/lib/modules/backup/views/backup_options_page.dart @@ -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:immich_mobile/modules/settings/ui/backup_settings/backup_settings.dart'; @@ -10,9 +11,7 @@ class BackupOptionsPage extends StatelessWidget { return Scaffold( appBar: AppBar( elevation: 0, - title: const Text( - "Backup options", - ), + title: const Text("backup_options_page_title").tr(), leading: IconButton( onPressed: () => context.popRoute(true), splashRadius: 24, diff --git a/mobile/lib/modules/login/ui/change_password_form.dart b/mobile/lib/modules/login/ui/change_password_form.dart index 2f5b5fe756..e66f67d3e7 100644 --- a/mobile/lib/modules/login/ui/change_password_form.dart +++ b/mobile/lib/modules/login/ui/change_password_form.dart @@ -112,7 +112,7 @@ class ChangePasswordForm extends HookConsumerWidget { TextButton.icon( icon: const Icon(Icons.arrow_back), onPressed: () => AutoRouter.of(context).back(), - label: const Text('Back'), + label: const Text('action_common_back').tr(), ), ], ), diff --git a/mobile/lib/modules/partner/ui/partner_list.dart b/mobile/lib/modules/partner/ui/partner_list.dart index 83a02f9a81..2b4aef04f1 100644 --- a/mobile/lib/modules/partner/ui/partner_list.dart +++ b/mobile/lib/modules/partner/ui/partner_list.dart @@ -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:hooks_riverpod/hooks_riverpod.dart'; import 'package:immich_mobile/extensions/build_context_extensions.dart'; @@ -28,15 +29,19 @@ class PartnerList extends HookConsumerWidget { ), leading: userAvatar(context, p, radius: 24), title: Text( - "${p.name}'s photos", + "partner_list_user_photos", style: context.textTheme.labelLarge, + ).tr( + namedArgs: { + 'user': p.name, + }, ), trailing: Text( - "View all", + "partner_list_view_all", style: context.textTheme.labelLarge?.copyWith( color: context.primaryColor, ), - ), + ).tr(), onTap: () => context.pushRoute((PartnerDetailRoute(partner: p))), ); } diff --git a/mobile/lib/modules/search/ui/search_filter/camera_picker.dart b/mobile/lib/modules/search/ui/search_filter/camera_picker.dart index fdfd398e6f..17de9d8c2f 100644 --- a/mobile/lib/modules/search/ui/search_filter/camera_picker.dart +++ b/mobile/lib/modules/search/ui/search_filter/camera_picker.dart @@ -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'; @@ -68,7 +69,7 @@ class CameraPicker extends HookConsumerWidget { }, width: context.width * 0.45, menuHeight: 400, - label: const Text('Make'), + label: const Text('search_filter_camera_make').tr(), inputDecorationTheme: inputDecorationTheme, controller: makeTextController, menuStyle: menuStyle, @@ -98,7 +99,7 @@ class CameraPicker extends HookConsumerWidget { }, width: context.width * 0.45, menuHeight: 400, - label: const Text('Model'), + label: const Text('search_filter_camera_model').tr(), inputDecorationTheme: inputDecorationTheme, controller: modelTextController, menuStyle: menuStyle, diff --git a/mobile/lib/modules/search/ui/search_filter/display_option_picker.dart b/mobile/lib/modules/search/ui/search_filter/display_option_picker.dart index f6cd01cbbf..7f0357f635 100644 --- a/mobile/lib/modules/search/ui/search_filter/display_option_picker.dart +++ b/mobile/lib/modules/search/ui/search_filter/display_option_picker.dart @@ -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:immich_mobile/modules/search/models/search_filter.dart'; @@ -30,7 +31,7 @@ class DisplayOptionPicker extends HookWidget { shrinkWrap: true, children: [ CheckboxListTile( - title: const Text('Not in album'), + title: const Text('search_filter_display_option_not_in_album').tr(), value: options.value[DisplayOption.notInAlbum], onChanged: (bool? value) { options.value = { @@ -41,7 +42,7 @@ class DisplayOptionPicker extends HookWidget { }, ), CheckboxListTile( - title: const Text('Favorite'), + title: const Text('search_filter_display_option_favorite').tr(), value: options.value[DisplayOption.favorite], onChanged: (value) { options.value = { @@ -52,7 +53,7 @@ class DisplayOptionPicker extends HookWidget { }, ), CheckboxListTile( - title: const Text('Archive'), + title: const Text('search_filter_display_option_archive').tr(), value: options.value[DisplayOption.archive], onChanged: (value) { options.value = { diff --git a/mobile/lib/modules/search/ui/search_filter/filter_bottom_sheet_scaffold.dart b/mobile/lib/modules/search/ui/search_filter/filter_bottom_sheet_scaffold.dart index 46bfe96bb8..d636c8c7ce 100644 --- a/mobile/lib/modules/search/ui/search_filter/filter_bottom_sheet_scaffold.dart +++ b/mobile/lib/modules/search/ui/search_filter/filter_bottom_sheet_scaffold.dart @@ -1,3 +1,4 @@ +import 'package:easy_localization/easy_localization.dart'; import 'package:flutter/material.dart'; import 'package:immich_mobile/extensions/build_context_extensions.dart'; @@ -48,7 +49,7 @@ class FilterBottomSheetScaffold extends StatelessWidget { onClear(); Navigator.of(context).pop(); }, - child: const Text('Clear'), + child: const Text('action_common_clear').tr(), ), const SizedBox(width: 8), ElevatedButton( @@ -56,7 +57,7 @@ class FilterBottomSheetScaffold extends StatelessWidget { onSearch(); Navigator.of(context).pop(); }, - child: const Text('Apply filter'), + child: const Text('search_filter_apply').tr(), ), ], ), diff --git a/mobile/lib/modules/search/ui/search_filter/location_picker.dart b/mobile/lib/modules/search/ui/search_filter/location_picker.dart index 22568da474..fe2e3ab374 100644 --- a/mobile/lib/modules/search/ui/search_filter/location_picker.dart +++ b/mobile/lib/modules/search/ui/search_filter/location_picker.dart @@ -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'; @@ -79,7 +80,7 @@ class LocationPicker extends HookConsumerWidget { }, menuHeight: 400, width: context.width * 0.9, - label: const Text('Country'), + label: const Text('search_filter_location_country').tr(), inputDecorationTheme: inputDecorationTheme, menuStyle: menuStyle, controller: countryTextController, @@ -112,7 +113,7 @@ class LocationPicker extends HookConsumerWidget { }, menuHeight: 400, width: context.width * 0.9, - label: const Text('State'), + label: const Text('search_filter_location_state').tr(), inputDecorationTheme: inputDecorationTheme, menuStyle: menuStyle, controller: stateTextController, @@ -145,7 +146,7 @@ class LocationPicker extends HookConsumerWidget { }, menuHeight: 400, width: context.width * 0.9, - label: const Text('City'), + label: const Text('search_filter_location_city').tr(), inputDecorationTheme: inputDecorationTheme, menuStyle: menuStyle, controller: cityTextController, diff --git a/mobile/lib/modules/search/ui/search_filter/media_type_picker.dart b/mobile/lib/modules/search/ui/search_filter/media_type_picker.dart index aaef2c8152..61206b7a17 100644 --- a/mobile/lib/modules/search/ui/search_filter/media_type_picker.dart +++ b/mobile/lib/modules/search/ui/search_filter/media_type_picker.dart @@ -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:immich_mobile/shared/models/asset.dart'; @@ -16,7 +17,7 @@ class MediaTypePicker extends HookWidget { shrinkWrap: true, children: [ RadioListTile( - title: const Text("All"), + title: const Text("search_filter_media_type_all").tr(), value: AssetType.other, onChanged: (value) { selectedMediaType.value = value!; @@ -25,7 +26,7 @@ class MediaTypePicker extends HookWidget { groupValue: selectedMediaType.value, ), RadioListTile( - title: const Text("Image"), + title: const Text("search_filter_media_type_image").tr(), value: AssetType.image, onChanged: (value) { selectedMediaType.value = value!; @@ -34,7 +35,7 @@ class MediaTypePicker extends HookWidget { groupValue: selectedMediaType.value, ), RadioListTile( - title: const Text("Video"), + title: const Text("search_filter_media_type_video").tr(), value: AssetType.video, onChanged: (value) { selectedMediaType.value = value!; diff --git a/mobile/lib/modules/search/views/search_page.dart b/mobile/lib/modules/search/views/search_page.dart index 27ca28126e..d0d9f2e71d 100644 --- a/mobile/lib/modules/search/views/search_page.dart +++ b/mobile/lib/modules/search/views/search_page.dart @@ -151,13 +151,13 @@ class SearchPage extends HookConsumerWidget { Icon(Icons.search, color: context.primaryColor), const SizedBox(width: 16.0), Text( - "Search your photos", + "search_bar_hint", style: context.textTheme.bodyLarge?.copyWith( color: context.isDarkTheme ? Colors.white70 : Colors.black54, fontWeight: FontWeight.w400, ), - ), + ).tr(), ], ), ), diff --git a/mobile/lib/modules/shared_link/views/shared_link_edit_page.dart b/mobile/lib/modules/shared_link/views/shared_link_edit_page.dart index b6d892f925..56d064e29b 100644 --- a/mobile/lib/modules/shared_link/views/shared_link_edit_page.dart +++ b/mobile/lib/modules/shared_link/views/shared_link_edit_page.dart @@ -48,7 +48,11 @@ class SharedLinkEditPage extends HookConsumerWidget { return Row( children: [ const Text( - "Public album | ", + 'shared_link_public_album', + style: TextStyle(fontWeight: FontWeight.bold), + ).tr(), + const Text( + " | ", style: TextStyle(fontWeight: FontWeight.bold), ), Text( @@ -66,7 +70,11 @@ class SharedLinkEditPage extends HookConsumerWidget { return Row( children: [ const Text( - "Individual shared | ", + 'shared_link_individual_shared', + style: TextStyle(fontWeight: FontWeight.bold), + ).tr(), + const Text( + " | ", style: TextStyle(fontWeight: FontWeight.bold), ), Expanded(