Browse Source

feat(mobile): added more translations (#1805)

Michel Heusschen 2 years ago
parent
commit
e408e8ca4a

+ 18 - 2
mobile/assets/i18n/en-US.json

@@ -1,4 +1,6 @@
 {
 {
+  "add_to_album_bottom_sheet_added": "Added to {album}",
+  "add_to_album_bottom_sheet_already_exists": "Already in {album}",
   "album_info_card_backup_album_excluded": "EXCLUDED",
   "album_info_card_backup_album_excluded": "EXCLUDED",
   "album_info_card_backup_album_included": "INCLUDED",
   "album_info_card_backup_album_included": "INCLUDED",
   "album_thumbnail_card_item": "1 item",
   "album_thumbnail_card_item": "1 item",
@@ -87,11 +89,19 @@
   "cache_settings_subtitle": "Control the caching behaviour of the Immich mobile application",
   "cache_settings_subtitle": "Control the caching behaviour of the Immich mobile application",
   "cache_settings_thumbnail_size": "Thumbnail cache size ({} assets)",
   "cache_settings_thumbnail_size": "Thumbnail cache size ({} assets)",
   "cache_settings_title": "Caching Settings",
   "cache_settings_title": "Caching Settings",
-  "control_bottom_app_bar_add_to_album": "Add to album",
+  "change_password_form_description": "Hi {firstName} {lastName},\n\nThis is either the first time you are signing into the system or a request has been made to change your password. Please enter the new password below.",
+  "change_password_form_new_password": "New Password",
+  "change_password_form_password_mismatch": "Passwords do not match",
+  "change_password_form_confirm_password": "Confirm Password",
+  "change_password_form_reenter_new_password": "Re-enter New Password",
+  "common_add_to_album": "Add to album",
+  "common_change_password": "Change Password",
+  "common_create_new_album": "Create new album",
+  "common_shared": "Shared",
   "control_bottom_app_bar_album_info": "{} items",
   "control_bottom_app_bar_album_info": "{} items",
   "control_bottom_app_bar_album_info_shared": "{} items · Shared",
   "control_bottom_app_bar_album_info_shared": "{} items · Shared",
-  "control_bottom_app_bar_create_new_album": "Create new album",
   "control_bottom_app_bar_delete": "Delete",
   "control_bottom_app_bar_delete": "Delete",
+  "control_bottom_app_bar_favorite": "Favorite",
   "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",
@@ -114,9 +124,13 @@
   "experimental_settings_title": "Experimental",
   "experimental_settings_title": "Experimental",
   "favorites_page_title": "Favorites",
   "favorites_page_title": "Favorites",
   "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_success": "Added {added} assets to album {album}.",
   "home_page_add_to_album_success": "Added {added} assets to album {album}.",
   "home_page_building_timeline": "Building the timeline",
   "home_page_building_timeline": "Building the timeline",
+  "home_page_favorite_err_local": "Can not favorite local assets yet, skipping",
   "home_page_first_time_notice": "If this is your first time using the app, please make sure to choose a backup album(s) so that the timeline can populate photos and videos in the album(s).",
   "home_page_first_time_notice": "If this is your first time using the app, please make sure to choose a backup album(s) so that the timeline can populate photos and videos in the album(s).",
+  "image_viewer_page_state_provider_download_error": "Download Error",
+  "image_viewer_page_state_provider_download_success": "Download Success",
   "library_page_albums": "Albums",
   "library_page_albums": "Albums",
   "library_page_favorites": "Favorites",
   "library_page_favorites": "Favorites",
   "library_page_new_album": "New album",
   "library_page_new_album": "New album",
@@ -153,6 +167,8 @@
   "select_additional_user_for_sharing_page_suggestions": "Suggestions",
   "select_additional_user_for_sharing_page_suggestions": "Suggestions",
   "select_user_for_sharing_page_err_album": "Failed to create album",
   "select_user_for_sharing_page_err_album": "Failed to create album",
   "select_user_for_sharing_page_share_suggestions": "Suggestions",
   "select_user_for_sharing_page_share_suggestions": "Suggestions",
+  "server_info_box_app_version": "App Version",
+  "server_info_box_server_version": "Server Version",
   "setting_image_viewer_help": "The detail viewer loads the small thumbnail first, then loads the medium-size preview (if enabled), finally loads the original (if enabled).",
   "setting_image_viewer_help": "The detail viewer loads the small thumbnail first, then loads the medium-size preview (if enabled), finally loads the original (if enabled).",
   "setting_image_viewer_original_subtitle": "Enable to load the original full-resolution image (large!). Disable to reduce data usage (both network and on device cache).",
   "setting_image_viewer_original_subtitle": "Enable to load the original full-resolution image (large!). Disable to reduce data usage (both network and on device cache).",
   "setting_image_viewer_original_title": "Load original image",
   "setting_image_viewer_original_title": "Load original image",

+ 9 - 4
mobile/lib/modules/album/ui/add_to_album_bottom_sheet.dart

@@ -1,3 +1,4 @@
+import 'package:easy_localization/easy_localization.dart';
 import 'package:auto_route/auto_route.dart';
 import 'package:auto_route/auto_route.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter_hooks/flutter_hooks.dart';
 import 'package:flutter_hooks/flutter_hooks.dart';
@@ -49,12 +50,16 @@ class AddToAlbumBottomSheet extends HookConsumerWidget {
         if (result.alreadyInAlbum.isNotEmpty) {
         if (result.alreadyInAlbum.isNotEmpty) {
           ImmichToast.show(
           ImmichToast.show(
             context: context,
             context: context,
-            msg: 'Already in ${album.name}',
+            msg: 'add_to_album_bottom_sheet_already_exists'.tr(
+              namedArgs: { "album": album.name },
+            ),
           );
           );
         } else {
         } else {
           ImmichToast.show(
           ImmichToast.show(
             context: context,
             context: context,
-            msg: 'Added to ${album.name}',
+            msg: 'add_to_album_bottom_sheet_added'.tr(
+              namedArgs: { "album": album.name },
+            ),
           );
           );
         }
         }
       }
       }
@@ -90,12 +95,12 @@ class AddToAlbumBottomSheet extends HookConsumerWidget {
                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
                     children: [
                     children: [
                       Text(
                       Text(
-                        'Add to album',
+                        'common_add_to_album'.tr(),
                         style: Theme.of(context).textTheme.displayMedium,
                         style: Theme.of(context).textTheme.displayMedium,
                       ),
                       ),
                       TextButton.icon(
                       TextButton.icon(
                         icon: const Icon(Icons.add),
                         icon: const Icon(Icons.add),
-                        label: const Text('Create new album'),
+                        label: Text('common_create_new_album'.tr()),
                         onPressed: () {
                         onPressed: () {
                           ref
                           ref
                               .watch(assetSelectionProvider.notifier)
                               .watch(assetSelectionProvider.notifier)

+ 2 - 1
mobile/lib/modules/album/ui/add_to_album_sliverlist.dart

@@ -1,3 +1,4 @@
+import 'package:easy_localization/easy_localization.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
 import 'package:immich_mobile/modules/album/ui/album_thumbnail_listtile.dart';
 import 'package:immich_mobile/modules/album/ui/album_thumbnail_listtile.dart';
@@ -27,7 +28,7 @@ class AddToAlbumSliverList extends HookConsumerWidget {
           return Padding(
           return Padding(
             padding: const EdgeInsets.only(bottom: 8),
             padding: const EdgeInsets.only(bottom: 8),
             child: ExpansionTile(
             child: ExpansionTile(
-              title: const Text('Shared'),
+              title:  Text('common_shared'.tr()),
               tilePadding: const EdgeInsets.symmetric(horizontal: 10.0),
               tilePadding: const EdgeInsets.symmetric(horizontal: 10.0),
               leading: const Icon(Icons.group),
               leading: const Icon(Icons.group),
               children: sharedAlbums
               children: sharedAlbums

+ 3 - 2
mobile/lib/modules/asset_viewer/providers/image_viewer_page_state.provider.dart

@@ -1,3 +1,4 @@
+import 'package:easy_localization/easy_localization.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import 'package:fluttertoast/fluttertoast.dart';
 import 'package:fluttertoast/fluttertoast.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
 import 'package:hooks_riverpod/hooks_riverpod.dart';
@@ -29,7 +30,7 @@ class ImageViewerStateNotifier extends StateNotifier<ImageViewerPageState> {
 
 
       ImmichToast.show(
       ImmichToast.show(
         context: context,
         context: context,
-        msg: "Download Success",
+        msg: 'image_viewer_page_state_provider_download_success'.tr(),
         toastType: ToastType.success,
         toastType: ToastType.success,
         gravity: ToastGravity.BOTTOM,
         gravity: ToastGravity.BOTTOM,
       );
       );
@@ -37,7 +38,7 @@ class ImageViewerStateNotifier extends StateNotifier<ImageViewerPageState> {
       state = state.copyWith(downloadAssetStatus: DownloadAssetStatus.error);
       state = state.copyWith(downloadAssetStatus: DownloadAssetStatus.error);
       ImmichToast.show(
       ImmichToast.show(
         context: context,
         context: context,
-        msg: "Download Error",
+        msg: 'image_viewer_page_state_provider_download_error'.tr(),
         toastType: ToastType.error,
         toastType: ToastType.error,
         gravity: ToastGravity.BOTTOM,
         gravity: ToastGravity.BOTTOM,
       );
       );

+ 3 - 3
mobile/lib/modules/home/ui/control_bottom_app_bar.dart

@@ -43,7 +43,7 @@ class ControlBottomAppBar extends ConsumerWidget {
           ),
           ),
           ControlBoxButton(
           ControlBoxButton(
             iconData: Icons.star_rounded,
             iconData: Icons.star_rounded,
-            label: "Favorite",
+            label: "control_bottom_app_bar_favorite".tr(),
             onPressed: () {
             onPressed: () {
               onFavorite();
               onFavorite();
             },
             },
@@ -140,7 +140,7 @@ class AddToAlbumTitleRow extends StatelessWidget {
         mainAxisAlignment: MainAxisAlignment.spaceBetween,
         mainAxisAlignment: MainAxisAlignment.spaceBetween,
         children: [
         children: [
           const Text(
           const Text(
-            "control_bottom_app_bar_add_to_album",
+            "common_add_to_album",
             style: TextStyle(
             style: TextStyle(
               fontSize: 14,
               fontSize: 14,
               fontWeight: FontWeight.bold,
               fontWeight: FontWeight.bold,
@@ -150,7 +150,7 @@ class AddToAlbumTitleRow extends StatelessWidget {
             onPressed: onCreateNewAlbum,
             onPressed: onCreateNewAlbum,
             icon: const Icon(Icons.add),
             icon: const Icon(Icons.add),
             label: Text(
             label: Text(
-              "control_bottom_app_bar_create_new_album",
+              "common_create_new_album",
               style: TextStyle(
               style: TextStyle(
                 color: Theme.of(context).primaryColor,
                 color: Theme.of(context).primaryColor,
                 fontWeight: FontWeight.bold,
                 fontWeight: FontWeight.bold,

+ 2 - 2
mobile/lib/modules/home/ui/profile_drawer/server_info_box.dart

@@ -73,7 +73,7 @@ class ServerInfoBox extends HookConsumerWidget {
                 mainAxisAlignment: MainAxisAlignment.spaceBetween,
                 mainAxisAlignment: MainAxisAlignment.spaceBetween,
                 children: [
                 children: [
                   Text(
                   Text(
-                    "App Version",
+                    "server_info_box_app_version".tr(),
                     style: TextStyle(
                     style: TextStyle(
                       fontSize: 11,
                       fontSize: 11,
                       color: Colors.grey[500],
                       color: Colors.grey[500],
@@ -98,7 +98,7 @@ class ServerInfoBox extends HookConsumerWidget {
                 mainAxisAlignment: MainAxisAlignment.spaceBetween,
                 mainAxisAlignment: MainAxisAlignment.spaceBetween,
                 children: [
                 children: [
                   Text(
                   Text(
-                    "Server Version",
+                    "server_info_box_server_version".tr(),
                     style: TextStyle(
                     style: TextStyle(
                       fontSize: 11,
                       fontSize: 11,
                       color: Colors.grey[500],
                       color: Colors.grey[500],

+ 3 - 3
mobile/lib/modules/home/views/home_page.dart

@@ -102,7 +102,7 @@ class HomePage extends HookConsumerWidget {
 
 
       void onFavoriteAssets() {
       void onFavoriteAssets() {
         final remoteAssets = remoteOnlySelection(
         final remoteAssets = remoteOnlySelection(
-          localErrorMessage: 'Can not favorite local assets yet, skipping',
+          localErrorMessage: 'home_page_favorite_err_local'.tr(),
         );
         );
         if (remoteAssets.isNotEmpty) {
         if (remoteAssets.isNotEmpty) {
           ref.watch(favoriteProvider.notifier).addToFavorites(remoteAssets);
           ref.watch(favoriteProvider.notifier).addToFavorites(remoteAssets);
@@ -125,7 +125,7 @@ class HomePage extends HookConsumerWidget {
 
 
       void onAddToAlbum(Album album) async {
       void onAddToAlbum(Album album) async {
         final Iterable<Asset> assets = remoteOnlySelection(
         final Iterable<Asset> assets = remoteOnlySelection(
-          localErrorMessage: "Can not add local assets to albums yet, skipping",
+          localErrorMessage: "home_page_add_to_album_err_local".tr(),
         );
         );
         if (assets.isEmpty) {
         if (assets.isEmpty) {
           return;
           return;
@@ -166,7 +166,7 @@ class HomePage extends HookConsumerWidget {
 
 
       void onCreateNewAlbum() async {
       void onCreateNewAlbum() async {
         final Iterable<Asset> assets = remoteOnlySelection(
         final Iterable<Asset> assets = remoteOnlySelection(
-          localErrorMessage: "Can not add local assets to albums yet, skipping",
+          localErrorMessage: "home_page_add_to_album_err_local".tr(),
         );
         );
         if (assets.isEmpty) {
         if (assets.isEmpty) {
           return;
           return;

+ 20 - 14
mobile/lib/modules/login/ui/change_password_form.dart

@@ -1,3 +1,4 @@
+import 'package:easy_localization/easy_localization.dart';
 import 'package:auto_route/auto_route.dart';
 import 'package:auto_route/auto_route.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter_hooks/flutter_hooks.dart';
 import 'package:flutter_hooks/flutter_hooks.dart';
@@ -30,7 +31,7 @@ class ChangePasswordForm extends HookConsumerWidget {
             alignment: WrapAlignment.start,
             alignment: WrapAlignment.start,
             children: [
             children: [
               Text(
               Text(
-                'Change Password',
+                'common_change_password'.tr(),
                 style: TextStyle(
                 style: TextStyle(
                   fontSize: 24,
                   fontSize: 24,
                   fontWeight: FontWeight.bold,
                   fontWeight: FontWeight.bold,
@@ -40,7 +41,12 @@ class ChangePasswordForm extends HookConsumerWidget {
               Padding(
               Padding(
                 padding: const EdgeInsets.symmetric(vertical: 24.0),
                 padding: const EdgeInsets.symmetric(vertical: 24.0),
                 child: Text(
                 child: Text(
-                  'Hi ${authState.firstName} ${authState.lastName},\n\nThis is either the first time you are signing into the system or a request has been made to change your password. Please enter the new password below.',
+                  'change_password_form_description'.tr(
+                    namedArgs: {
+                      'firstName': authState.firstName,
+                      'lastName': authState.lastName,
+                    },
+                  ),
                   style: TextStyle(
                   style: TextStyle(
                     fontSize: 14,
                     fontSize: 14,
                     color: Colors.grey[700],
                     color: Colors.grey[700],
@@ -85,10 +91,10 @@ class PasswordInput extends StatelessWidget {
     return TextFormField(
     return TextFormField(
       obscureText: true,
       obscureText: true,
       controller: controller,
       controller: controller,
-      decoration: const InputDecoration(
-        labelText: 'New Password',
-        border: OutlineInputBorder(),
-        hintText: 'New Password',
+      decoration: InputDecoration(
+        labelText: 'change_password_form_new_password'.tr(),
+        border: const OutlineInputBorder(),
+        hintText: 'change_password_form_new_password'.tr(),
       ),
       ),
     );
     );
   }
   }
@@ -106,7 +112,7 @@ class ConfirmPasswordInput extends StatelessWidget {
 
 
   String? _validateInput(String? email) {
   String? _validateInput(String? email) {
     if (confirmController.value != originalController.value) {
     if (confirmController.value != originalController.value) {
-      return 'Passwords do not match';
+      return 'change_password_form_password_mismatch'.tr();
     }
     }
     return null;
     return null;
   }
   }
@@ -116,10 +122,10 @@ class ConfirmPasswordInput extends StatelessWidget {
     return TextFormField(
     return TextFormField(
       obscureText: true,
       obscureText: true,
       controller: confirmController,
       controller: confirmController,
-      decoration: const InputDecoration(
-        labelText: 'Confirm Password',
-        hintText: 'Re-enter New Password',
-        border: OutlineInputBorder(),
+      decoration:  InputDecoration(
+        labelText: 'change_password_form_confirm_password'.tr(),
+        hintText: 'change_password_form_reenter_new_password'.tr(),
+        border: const OutlineInputBorder(),
       ),
       ),
       validator: _validateInput,
       validator: _validateInput,
       autovalidateMode: AutovalidateMode.always,
       autovalidateMode: AutovalidateMode.always,
@@ -166,9 +172,9 @@ class ChangePasswordButton extends ConsumerWidget {
           }
           }
         }
         }
       },
       },
-      child: const Text(
-        "Change Password",
-        style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
+      child: Text(
+        'common_change_password'.tr(),
+        style: const TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
       ),
       ),
     );
     );
   }
   }