Skip to content

Commit e408e8c

Browse files
feat(mobile): added more translations (immich-app#1805)
1 parent 9bfb4df commit e408e8c

File tree

8 files changed

+60
-31
lines changed

8 files changed

+60
-31
lines changed

mobile/assets/i18n/en-US.json

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
{
2+
"add_to_album_bottom_sheet_added": "Added to {album}",
3+
"add_to_album_bottom_sheet_already_exists": "Already in {album}",
24
"album_info_card_backup_album_excluded": "EXCLUDED",
35
"album_info_card_backup_album_included": "INCLUDED",
46
"album_thumbnail_card_item": "1 item",
@@ -87,11 +89,19 @@
8789
"cache_settings_subtitle": "Control the caching behaviour of the Immich mobile application",
8890
"cache_settings_thumbnail_size": "Thumbnail cache size ({} assets)",
8991
"cache_settings_title": "Caching Settings",
90-
"control_bottom_app_bar_add_to_album": "Add to album",
92+
"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.",
93+
"change_password_form_new_password": "New Password",
94+
"change_password_form_password_mismatch": "Passwords do not match",
95+
"change_password_form_confirm_password": "Confirm Password",
96+
"change_password_form_reenter_new_password": "Re-enter New Password",
97+
"common_add_to_album": "Add to album",
98+
"common_change_password": "Change Password",
99+
"common_create_new_album": "Create new album",
100+
"common_shared": "Shared",
91101
"control_bottom_app_bar_album_info": "{} items",
92102
"control_bottom_app_bar_album_info_shared": "{} items · Shared",
93-
"control_bottom_app_bar_create_new_album": "Create new album",
94103
"control_bottom_app_bar_delete": "Delete",
104+
"control_bottom_app_bar_favorite": "Favorite",
95105
"control_bottom_app_bar_share": "Share",
96106
"create_album_page_untitled": "Untitled",
97107
"create_shared_album_page_create": "Create",
@@ -114,9 +124,13 @@
114124
"experimental_settings_title": "Experimental",
115125
"favorites_page_title": "Favorites",
116126
"home_page_add_to_album_conflicts": "Added {added} assets to album {album}. {failed} assets are already in the album.",
127+
"home_page_add_to_album_err_local": "Can not add local assets to albums yet, skipping",
117128
"home_page_add_to_album_success": "Added {added} assets to album {album}.",
118129
"home_page_building_timeline": "Building the timeline",
130+
"home_page_favorite_err_local": "Can not favorite local assets yet, skipping",
119131
"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).",
132+
"image_viewer_page_state_provider_download_error": "Download Error",
133+
"image_viewer_page_state_provider_download_success": "Download Success",
120134
"library_page_albums": "Albums",
121135
"library_page_favorites": "Favorites",
122136
"library_page_new_album": "New album",
@@ -153,6 +167,8 @@
153167
"select_additional_user_for_sharing_page_suggestions": "Suggestions",
154168
"select_user_for_sharing_page_err_album": "Failed to create album",
155169
"select_user_for_sharing_page_share_suggestions": "Suggestions",
170+
"server_info_box_app_version": "App Version",
171+
"server_info_box_server_version": "Server Version",
156172
"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).",
157173
"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).",
158174
"setting_image_viewer_original_title": "Load original image",

mobile/lib/modules/album/ui/add_to_album_bottom_sheet.dart

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:easy_localization/easy_localization.dart';
12
import 'package:auto_route/auto_route.dart';
23
import 'package:flutter/material.dart';
34
import 'package:flutter_hooks/flutter_hooks.dart';
@@ -49,12 +50,16 @@ class AddToAlbumBottomSheet extends HookConsumerWidget {
4950
if (result.alreadyInAlbum.isNotEmpty) {
5051
ImmichToast.show(
5152
context: context,
52-
msg: 'Already in ${album.name}',
53+
msg: 'add_to_album_bottom_sheet_already_exists'.tr(
54+
namedArgs: { "album": album.name },
55+
),
5356
);
5457
} else {
5558
ImmichToast.show(
5659
context: context,
57-
msg: 'Added to ${album.name}',
60+
msg: 'add_to_album_bottom_sheet_added'.tr(
61+
namedArgs: { "album": album.name },
62+
),
5863
);
5964
}
6065
}
@@ -90,12 +95,12 @@ class AddToAlbumBottomSheet extends HookConsumerWidget {
9095
mainAxisAlignment: MainAxisAlignment.spaceBetween,
9196
children: [
9297
Text(
93-
'Add to album',
98+
'common_add_to_album'.tr(),
9499
style: Theme.of(context).textTheme.displayMedium,
95100
),
96101
TextButton.icon(
97102
icon: const Icon(Icons.add),
98-
label: const Text('Create new album'),
103+
label: Text('common_create_new_album'.tr()),
99104
onPressed: () {
100105
ref
101106
.watch(assetSelectionProvider.notifier)

mobile/lib/modules/album/ui/add_to_album_sliverlist.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:easy_localization/easy_localization.dart';
12
import 'package:flutter/material.dart';
23
import 'package:hooks_riverpod/hooks_riverpod.dart';
34
import 'package:immich_mobile/modules/album/ui/album_thumbnail_listtile.dart';
@@ -27,7 +28,7 @@ class AddToAlbumSliverList extends HookConsumerWidget {
2728
return Padding(
2829
padding: const EdgeInsets.only(bottom: 8),
2930
child: ExpansionTile(
30-
title: const Text('Shared'),
31+
title: Text('common_shared'.tr()),
3132
tilePadding: const EdgeInsets.symmetric(horizontal: 10.0),
3233
leading: const Icon(Icons.group),
3334
children: sharedAlbums

mobile/lib/modules/asset_viewer/providers/image_viewer_page_state.provider.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:easy_localization/easy_localization.dart';
12
import 'package:flutter/material.dart';
23
import 'package:fluttertoast/fluttertoast.dart';
34
import 'package:hooks_riverpod/hooks_riverpod.dart';
@@ -29,15 +30,15 @@ class ImageViewerStateNotifier extends StateNotifier<ImageViewerPageState> {
2930

3031
ImmichToast.show(
3132
context: context,
32-
msg: "Download Success",
33+
msg: 'image_viewer_page_state_provider_download_success'.tr(),
3334
toastType: ToastType.success,
3435
gravity: ToastGravity.BOTTOM,
3536
);
3637
} else {
3738
state = state.copyWith(downloadAssetStatus: DownloadAssetStatus.error);
3839
ImmichToast.show(
3940
context: context,
40-
msg: "Download Error",
41+
msg: 'image_viewer_page_state_provider_download_error'.tr(),
4142
toastType: ToastType.error,
4243
gravity: ToastGravity.BOTTOM,
4344
);

mobile/lib/modules/home/ui/control_bottom_app_bar.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class ControlBottomAppBar extends ConsumerWidget {
4343
),
4444
ControlBoxButton(
4545
iconData: Icons.star_rounded,
46-
label: "Favorite",
46+
label: "control_bottom_app_bar_favorite".tr(),
4747
onPressed: () {
4848
onFavorite();
4949
},
@@ -140,7 +140,7 @@ class AddToAlbumTitleRow extends StatelessWidget {
140140
mainAxisAlignment: MainAxisAlignment.spaceBetween,
141141
children: [
142142
const Text(
143-
"control_bottom_app_bar_add_to_album",
143+
"common_add_to_album",
144144
style: TextStyle(
145145
fontSize: 14,
146146
fontWeight: FontWeight.bold,
@@ -150,7 +150,7 @@ class AddToAlbumTitleRow extends StatelessWidget {
150150
onPressed: onCreateNewAlbum,
151151
icon: const Icon(Icons.add),
152152
label: Text(
153-
"control_bottom_app_bar_create_new_album",
153+
"common_create_new_album",
154154
style: TextStyle(
155155
color: Theme.of(context).primaryColor,
156156
fontWeight: FontWeight.bold,

mobile/lib/modules/home/ui/profile_drawer/server_info_box.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class ServerInfoBox extends HookConsumerWidget {
7373
mainAxisAlignment: MainAxisAlignment.spaceBetween,
7474
children: [
7575
Text(
76-
"App Version",
76+
"server_info_box_app_version".tr(),
7777
style: TextStyle(
7878
fontSize: 11,
7979
color: Colors.grey[500],
@@ -98,7 +98,7 @@ class ServerInfoBox extends HookConsumerWidget {
9898
mainAxisAlignment: MainAxisAlignment.spaceBetween,
9999
children: [
100100
Text(
101-
"Server Version",
101+
"server_info_box_server_version".tr(),
102102
style: TextStyle(
103103
fontSize: 11,
104104
color: Colors.grey[500],

mobile/lib/modules/home/views/home_page.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class HomePage extends HookConsumerWidget {
102102

103103
void onFavoriteAssets() {
104104
final remoteAssets = remoteOnlySelection(
105-
localErrorMessage: 'Can not favorite local assets yet, skipping',
105+
localErrorMessage: 'home_page_favorite_err_local'.tr(),
106106
);
107107
if (remoteAssets.isNotEmpty) {
108108
ref.watch(favoriteProvider.notifier).addToFavorites(remoteAssets);
@@ -125,7 +125,7 @@ class HomePage extends HookConsumerWidget {
125125

126126
void onAddToAlbum(Album album) async {
127127
final Iterable<Asset> assets = remoteOnlySelection(
128-
localErrorMessage: "Can not add local assets to albums yet, skipping",
128+
localErrorMessage: "home_page_add_to_album_err_local".tr(),
129129
);
130130
if (assets.isEmpty) {
131131
return;
@@ -166,7 +166,7 @@ class HomePage extends HookConsumerWidget {
166166

167167
void onCreateNewAlbum() async {
168168
final Iterable<Asset> assets = remoteOnlySelection(
169-
localErrorMessage: "Can not add local assets to albums yet, skipping",
169+
localErrorMessage: "home_page_add_to_album_err_local".tr(),
170170
);
171171
if (assets.isEmpty) {
172172
return;

mobile/lib/modules/login/ui/change_password_form.dart

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:easy_localization/easy_localization.dart';
12
import 'package:auto_route/auto_route.dart';
23
import 'package:flutter/material.dart';
34
import 'package:flutter_hooks/flutter_hooks.dart';
@@ -30,7 +31,7 @@ class ChangePasswordForm extends HookConsumerWidget {
3031
alignment: WrapAlignment.start,
3132
children: [
3233
Text(
33-
'Change Password',
34+
'common_change_password'.tr(),
3435
style: TextStyle(
3536
fontSize: 24,
3637
fontWeight: FontWeight.bold,
@@ -40,7 +41,12 @@ class ChangePasswordForm extends HookConsumerWidget {
4041
Padding(
4142
padding: const EdgeInsets.symmetric(vertical: 24.0),
4243
child: Text(
43-
'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.',
44+
'change_password_form_description'.tr(
45+
namedArgs: {
46+
'firstName': authState.firstName,
47+
'lastName': authState.lastName,
48+
},
49+
),
4450
style: TextStyle(
4551
fontSize: 14,
4652
color: Colors.grey[700],
@@ -85,10 +91,10 @@ class PasswordInput extends StatelessWidget {
8591
return TextFormField(
8692
obscureText: true,
8793
controller: controller,
88-
decoration: const InputDecoration(
89-
labelText: 'New Password',
90-
border: OutlineInputBorder(),
91-
hintText: 'New Password',
94+
decoration: InputDecoration(
95+
labelText: 'change_password_form_new_password'.tr(),
96+
border: const OutlineInputBorder(),
97+
hintText: 'change_password_form_new_password'.tr(),
9298
),
9399
);
94100
}
@@ -106,7 +112,7 @@ class ConfirmPasswordInput extends StatelessWidget {
106112

107113
String? _validateInput(String? email) {
108114
if (confirmController.value != originalController.value) {
109-
return 'Passwords do not match';
115+
return 'change_password_form_password_mismatch'.tr();
110116
}
111117
return null;
112118
}
@@ -116,10 +122,10 @@ class ConfirmPasswordInput extends StatelessWidget {
116122
return TextFormField(
117123
obscureText: true,
118124
controller: confirmController,
119-
decoration: const InputDecoration(
120-
labelText: 'Confirm Password',
121-
hintText: 'Re-enter New Password',
122-
border: OutlineInputBorder(),
125+
decoration: InputDecoration(
126+
labelText: 'change_password_form_confirm_password'.tr(),
127+
hintText: 'change_password_form_reenter_new_password'.tr(),
128+
border: const OutlineInputBorder(),
123129
),
124130
validator: _validateInput,
125131
autovalidateMode: AutovalidateMode.always,
@@ -166,9 +172,9 @@ class ChangePasswordButton extends ConsumerWidget {
166172
}
167173
}
168174
},
169-
child: const Text(
170-
"Change Password",
171-
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
175+
child: Text(
176+
'common_change_password'.tr(),
177+
style: const TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
172178
),
173179
);
174180
}

0 commit comments

Comments
 (0)