mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(mobile): added more translations (#1805)
This commit is contained in:
parent
9bfb4dfd06
commit
e408e8ca4a
8 changed files with 60 additions and 31 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
|
|
@ -49,12 +50,16 @@ class AddToAlbumBottomSheet extends HookConsumerWidget {
|
|||
if (result.alreadyInAlbum.isNotEmpty) {
|
||||
ImmichToast.show(
|
||||
context: context,
|
||||
msg: 'Already in ${album.name}',
|
||||
msg: 'add_to_album_bottom_sheet_already_exists'.tr(
|
||||
namedArgs: { "album": album.name },
|
||||
),
|
||||
);
|
||||
} else {
|
||||
ImmichToast.show(
|
||||
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,
|
||||
children: [
|
||||
Text(
|
||||
'Add to album',
|
||||
'common_add_to_album'.tr(),
|
||||
style: Theme.of(context).textTheme.displayMedium,
|
||||
),
|
||||
TextButton.icon(
|
||||
icon: const Icon(Icons.add),
|
||||
label: const Text('Create new album'),
|
||||
label: Text('common_create_new_album'.tr()),
|
||||
onPressed: () {
|
||||
ref
|
||||
.watch(assetSelectionProvider.notifier)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/modules/album/ui/album_thumbnail_listtile.dart';
|
||||
|
|
@ -27,7 +28,7 @@ class AddToAlbumSliverList extends HookConsumerWidget {
|
|||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8),
|
||||
child: ExpansionTile(
|
||||
title: const Text('Shared'),
|
||||
title: Text('common_shared'.tr()),
|
||||
tilePadding: const EdgeInsets.symmetric(horizontal: 10.0),
|
||||
leading: const Icon(Icons.group),
|
||||
children: sharedAlbums
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
|
|
@ -29,7 +30,7 @@ class ImageViewerStateNotifier extends StateNotifier<ImageViewerPageState> {
|
|||
|
||||
ImmichToast.show(
|
||||
context: context,
|
||||
msg: "Download Success",
|
||||
msg: 'image_viewer_page_state_provider_download_success'.tr(),
|
||||
toastType: ToastType.success,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
);
|
||||
|
|
@ -37,7 +38,7 @@ class ImageViewerStateNotifier extends StateNotifier<ImageViewerPageState> {
|
|||
state = state.copyWith(downloadAssetStatus: DownloadAssetStatus.error);
|
||||
ImmichToast.show(
|
||||
context: context,
|
||||
msg: "Download Error",
|
||||
msg: 'image_viewer_page_state_provider_download_error'.tr(),
|
||||
toastType: ToastType.error,
|
||||
gravity: ToastGravity.BOTTOM,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class ControlBottomAppBar extends ConsumerWidget {
|
|||
),
|
||||
ControlBoxButton(
|
||||
iconData: Icons.star_rounded,
|
||||
label: "Favorite",
|
||||
label: "control_bottom_app_bar_favorite".tr(),
|
||||
onPressed: () {
|
||||
onFavorite();
|
||||
},
|
||||
|
|
@ -140,7 +140,7 @@ class AddToAlbumTitleRow extends StatelessWidget {
|
|||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text(
|
||||
"control_bottom_app_bar_add_to_album",
|
||||
"common_add_to_album",
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
|
@ -150,7 +150,7 @@ class AddToAlbumTitleRow extends StatelessWidget {
|
|||
onPressed: onCreateNewAlbum,
|
||||
icon: const Icon(Icons.add),
|
||||
label: Text(
|
||||
"control_bottom_app_bar_create_new_album",
|
||||
"common_create_new_album",
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).primaryColor,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class ServerInfoBox extends HookConsumerWidget {
|
|||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"App Version",
|
||||
"server_info_box_app_version".tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
color: Colors.grey[500],
|
||||
|
|
@ -98,7 +98,7 @@ class ServerInfoBox extends HookConsumerWidget {
|
|||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
"Server Version",
|
||||
"server_info_box_server_version".tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
color: Colors.grey[500],
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ class HomePage extends HookConsumerWidget {
|
|||
|
||||
void onFavoriteAssets() {
|
||||
final remoteAssets = remoteOnlySelection(
|
||||
localErrorMessage: 'Can not favorite local assets yet, skipping',
|
||||
localErrorMessage: 'home_page_favorite_err_local'.tr(),
|
||||
);
|
||||
if (remoteAssets.isNotEmpty) {
|
||||
ref.watch(favoriteProvider.notifier).addToFavorites(remoteAssets);
|
||||
|
|
@ -125,7 +125,7 @@ class HomePage extends HookConsumerWidget {
|
|||
|
||||
void onAddToAlbum(Album album) async {
|
||||
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) {
|
||||
return;
|
||||
|
|
@ -166,7 +166,7 @@ class HomePage extends HookConsumerWidget {
|
|||
|
||||
void onCreateNewAlbum() async {
|
||||
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) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
|
|
@ -30,7 +31,7 @@ class ChangePasswordForm extends HookConsumerWidget {
|
|||
alignment: WrapAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Change Password',
|
||||
'common_change_password'.tr(),
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
|
@ -40,7 +41,12 @@ class ChangePasswordForm extends HookConsumerWidget {
|
|||
Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 24.0),
|
||||
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(
|
||||
fontSize: 14,
|
||||
color: Colors.grey[700],
|
||||
|
|
@ -85,10 +91,10 @@ class PasswordInput extends StatelessWidget {
|
|||
return TextFormField(
|
||||
obscureText: true,
|
||||
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) {
|
||||
if (confirmController.value != originalController.value) {
|
||||
return 'Passwords do not match';
|
||||
return 'change_password_form_password_mismatch'.tr();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
@ -116,10 +122,10 @@ class ConfirmPasswordInput extends StatelessWidget {
|
|||
return TextFormField(
|
||||
obscureText: true,
|
||||
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,
|
||||
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),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue