Internationalization (German) of the mobile app. (#246)

* Add i18n framework to mobile app and write simple translation generator

* Replace all texts in login_form with i18n keys

* Localization of sharing section

* Localization of asset viewer section

* Use JSON as base translation format

* Add check for missing/unused translation keys

* Add localizely

* Remove i18n directory in favour of localizely

* Backup Translation

* More translations

* Translate home page

* Translation of search page

* Translate new server version announcement

* Reformat code

* Fix typo in german translation

* Update englisch translations

* Change translation keys to match dart filenames

* Add /api to translated endpoint_urls

* Update localizely.yml

* Add languages to ios plist

* Remove unused keys

* Added script to check outdated key in other translations

* Add download key to localizely.yml

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
Matthias Rupp 2022-07-07 20:40:54 +02:00 committed by GitHub
parent f3032f74a4
commit 2b5cef156c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 601 additions and 213 deletions

View file

@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_map/flutter_map.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
@ -72,7 +73,7 @@ class ExifBottomSheet extends ConsumerWidget {
children: [
if (assetDetail.exifInfo?.dateTimeOriginal != null)
Text(
DateFormat('E, LLL d, y • h:mm a').format(
DateFormat('date_format'.tr()).format(
DateTime.parse(assetDetail.exifInfo!.dateTimeOriginal!),
),
style: TextStyle(
@ -84,12 +85,12 @@ class ExifBottomSheet extends ConsumerWidget {
Padding(
padding: const EdgeInsets.only(top: 16.0),
child: Text(
"Add Description...",
"exif_bottom_sheet_description",
style: TextStyle(
color: Colors.grey[500],
fontSize: 11,
),
),
).tr(),
),
// Location
@ -104,9 +105,9 @@ class ExifBottomSheet extends ConsumerWidget {
color: Colors.grey[600],
),
Text(
"LOCATION",
"exif_bottom_sheet_location",
style: TextStyle(fontSize: 11, color: Colors.grey[400]),
),
).tr(),
if (assetDetail.exifInfo?.latitude != null &&
assetDetail.exifInfo?.longitude != null)
_buildMap(),
@ -134,9 +135,9 @@ class ExifBottomSheet extends ConsumerWidget {
Padding(
padding: const EdgeInsets.only(bottom: 8.0),
child: Text(
"DETAILS",
"exif_bottom_sheet_details",
style: TextStyle(fontSize: 11, color: Colors.grey[400]),
),
).tr(),
),
ListTile(
contentPadding: const EdgeInsets.all(0),

View file

@ -1,6 +1,7 @@
import 'dart:typed_data';
import 'package:auto_route/auto_route.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:fluttertoast/fluttertoast.dart';
@ -37,10 +38,10 @@ class AlbumInfoCard extends HookConsumerWidget {
visualDensity: VisualDensity.compact,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5)),
label: const Text(
"INCLUDED",
"album_info_card_backup_album_included",
style: TextStyle(
fontSize: 10, color: Colors.white, fontWeight: FontWeight.bold),
),
).tr(),
backgroundColor: Theme.of(context).primaryColor,
);
} else if (isExcluded) {
@ -48,10 +49,10 @@ class AlbumInfoCard extends HookConsumerWidget {
visualDensity: VisualDensity.compact,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5)),
label: const Text(
"EXCLUDED",
"album_info_card_backup_album_excluded",
style: TextStyle(
fontSize: 10, color: Colors.white, fontWeight: FontWeight.bold),
),
).tr(),
backgroundColor: Colors.red[300],
);
}
@ -77,7 +78,7 @@ class AlbumInfoCard extends HookConsumerWidget {
if (ref.watch(backupProvider).selectedBackupAlbums.length == 1) {
ImmichToast.show(
context: context,
msg: "Cannot remove the only album",
msg: "backup_err_only_album".tr(),
toastType: ToastType.error,
gravity: ToastGravity.BOTTOM,
);
@ -104,7 +105,7 @@ class AlbumInfoCard extends HookConsumerWidget {
.contains(albumInfo)) {
ImmichToast.show(
context: context,
msg: "Cannot exclude the only album",
msg: "backup_err_only_album".tr(),
toastType: ToastType.error,
gravity: ToastGravity.BOTTOM,
);
@ -180,7 +181,10 @@ class AlbumInfoCard extends HookConsumerWidget {
Padding(
padding: const EdgeInsets.only(top: 2.0),
child: Text(
'${albumInfo.assetCount} ${(albumInfo.isAll ? " (ALL)" : "")}',
albumInfo.assetCount.toString() +
(albumInfo.isAll
? " (${'backup_all'.tr()})"
: ""),
style: TextStyle(
fontSize: 12, color: Colors.grey[600]),
),

View file

@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
class BackupInfoCard extends StatelessWidget {
@ -44,7 +45,7 @@ class BackupInfoCard extends StatelessWidget {
info,
style: const TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
),
const Text("assets"),
const Text("backup_info_card_assets").tr(),
],
),
),

View file

@ -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:flutter_hooks/flutter_hooks.dart';
import 'package:fluttertoast/fluttertoast.dart';
@ -55,7 +56,7 @@ class BackupAlbumSelectionPage extends HookConsumerWidget {
if (ref.watch(backupProvider).selectedBackupAlbums.length == 1) {
ImmichToast.show(
context: context,
msg: "Cannot remove the only album",
msg: "backup_err_only_album".tr(),
toastType: ToastType.error,
gravity: ToastGravity.BOTTOM,
);
@ -136,20 +137,21 @@ class BackupAlbumSelectionPage extends HookConsumerWidget {
icon: const Icon(Icons.arrow_back_ios_rounded),
),
title: const Text(
"Select Albums",
"backup_album_selection_page_select_albums",
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
),
).tr(),
elevation: 0,
),
body: ListView(
physics: const ClampingScrollPhysics(),
children: [
const Padding(
padding: EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
child: Text(
"Selection Info",
Padding(
padding:
const EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
child: const Text(
"backup_album_selection_page_selection_info",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14),
),
).tr(),
),
// Selected Album Chips
@ -181,14 +183,18 @@ class BackupAlbumSelectionPage extends HookConsumerWidget {
ListTile(
visualDensity: VisualDensity.compact,
title: Text(
"Total unique assets",
"backup_album_selection_page_total_assets",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 14,
color: Colors.grey[700]),
),
).tr(),
trailing: Text(
'${ref.watch(backupProvider).allUniqueAssets.length}',
ref
.watch(backupProvider)
.allUniqueAssets
.length
.toString(),
style: const TextStyle(fontWeight: FontWeight.bold),
),
),
@ -199,19 +205,20 @@ class BackupAlbumSelectionPage extends HookConsumerWidget {
ListTile(
title: Text(
"Albums on device (${availableAlbums.length})",
"backup_album_selection_page_albums_device"
.tr(args: [availableAlbums.length.toString()]),
style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 14),
),
subtitle: Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0),
child: Text(
"Tap to include, double tap to exclude",
"backup_album_selection_page_albums_tap",
style: TextStyle(
fontSize: 12,
color: Theme.of(context).primaryColor,
fontWeight: FontWeight.bold,
),
),
).tr(),
),
trailing: IconButton(
splashRadius: 16,
@ -230,21 +237,21 @@ class BackupAlbumSelectionPage extends HookConsumerWidget {
borderRadius: BorderRadius.circular(12)),
elevation: 5,
title: Text(
'Selection Info',
'backup_album_selection_page_selection_info',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Theme.of(context).primaryColor,
),
),
).tr(),
content: SingleChildScrollView(
child: ListBody(
children: [
Text(
'Assets can scatter across multiple albums. Thus, albums can be included or excluded during the backup process.',
'backup_album_selection_page_assets_scatter',
style: TextStyle(
fontSize: 14, color: Colors.grey[700]),
),
).tr(),
],
),
),

View file

@ -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:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
@ -44,9 +45,9 @@ class BackupControllerPage extends HookConsumerWidget {
color: Theme.of(context).primaryColor,
),
title: const Text(
"Server storage",
"backup_controller_page_server_storage",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14),
),
).tr(),
subtitle: Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Column(
@ -66,8 +67,11 @@ class BackupControllerPage extends HookConsumerWidget {
),
Padding(
padding: const EdgeInsets.only(top: 12.0),
child: Text(
'${backupState.serverInfo.diskUse} of ${backupState.serverInfo.diskSize} used'),
child: const Text('backup_controller_page_storage_format').tr(
args: [
backupState.serverInfo.diskUse,
backupState.serverInfo.diskSize
]),
),
],
),
@ -76,11 +80,13 @@ class BackupControllerPage extends HookConsumerWidget {
}
ListTile _buildBackupController() {
var backUpOption =
authenticationState.deviceInfo.isAutoBackup ? "on" : "off";
var backUpOption = authenticationState.deviceInfo.isAutoBackup
? "backup_controller_page_status_on".tr()
: "backup_controller_page_status_off".tr();
var isAutoBackup = authenticationState.deviceInfo.isAutoBackup;
var backupBtnText =
authenticationState.deviceInfo.isAutoBackup ? "off" : "on";
var backupBtnText = authenticationState.deviceInfo.isAutoBackup
? "backup_controller_page_turn_off".tr()
: "backup_controller_page_turn_on".tr();
return ListTile(
isThreeLine: true,
leading: isAutoBackup
@ -90,7 +96,7 @@ class BackupControllerPage extends HookConsumerWidget {
)
: const Icon(Icons.cloud_off_rounded),
title: Text(
"Back up is $backUpOption",
backUpOption,
style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 14),
),
subtitle: Padding(
@ -100,9 +106,9 @@ class BackupControllerPage extends HookConsumerWidget {
children: [
if (!isAutoBackup)
const Text(
"Turn on backup to automatically upload new assets to the server.",
"backup_controller_page_desc_backup",
style: TextStyle(fontSize: 14),
),
).tr(),
Padding(
padding: const EdgeInsets.only(top: 8.0),
child: OutlinedButton(
@ -123,7 +129,7 @@ class BackupControllerPage extends HookConsumerWidget {
.setAutoBackup(true);
}
},
child: Text("Turn $backupBtnText Backup",
child: Text(backupBtnText,
style: const TextStyle(fontWeight: FontWeight.bold)),
),
)
@ -134,13 +140,13 @@ class BackupControllerPage extends HookConsumerWidget {
}
Widget _buildSelectedAlbumName() {
var text = "Selected: ";
var text = "backup_controller_page_backup_selected".tr();
var albums = ref.watch(backupProvider).selectedBackupAlbums;
if (albums.isNotEmpty) {
for (var album in albums) {
if (album.name == "Recent" || album.name == "Recents") {
text += "${album.name} (All), ";
text += "${album.name} (${'backup_all'.tr()}), ";
} else {
text += "${album.name}, ";
}
@ -160,7 +166,7 @@ class BackupControllerPage extends HookConsumerWidget {
return Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Text(
"None selected",
"backup_controller_page_none_selected".tr(),
style: TextStyle(
color: Theme.of(context).primaryColor,
fontSize: 12,
@ -171,7 +177,7 @@ class BackupControllerPage extends HookConsumerWidget {
}
Widget _buildExcludedAlbumName() {
var text = "Excluded: ";
var text = "backup_controller_page_excluded".tr();
var albums = ref.watch(backupProvider).excludedBackupAlbums;
if (albums.isNotEmpty) {
@ -207,17 +213,18 @@ class BackupControllerPage extends HookConsumerWidget {
borderOnForeground: false,
child: ListTile(
minVerticalPadding: 15,
title: const Text("Backup Albums",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20)),
title: const Text("backup_controller_page_albums",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 20))
.tr(),
subtitle: Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Text(
"Albums to be backed up",
"backup_controller_page_to_backup",
style: TextStyle(color: Color(0xFF808080), fontSize: 12),
),
).tr(),
_buildSelectedAlbumName(),
_buildExcludedAlbumName()
],
@ -234,14 +241,14 @@ class BackupControllerPage extends HookConsumerWidget {
onPressed: () {
AutoRouter.of(context).push(const BackupAlbumSelectionRoute());
},
child: const Padding(
padding: EdgeInsets.symmetric(
child: Padding(
padding: const EdgeInsets.symmetric(
vertical: 16.0,
),
child: Text(
"Select",
child: const Text(
"backup_controller_page_select",
style: TextStyle(fontWeight: FontWeight.bold),
),
).tr(),
),
),
),
@ -387,9 +394,9 @@ class BackupControllerPage extends HookConsumerWidget {
appBar: AppBar(
elevation: 0,
title: const Text(
"Backup",
"backup_controller_page_backup",
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
),
).tr(),
leading: IconButton(
onPressed: () {
ref.watch(websocketProvider.notifier).listenUploadEvent();
@ -405,27 +412,27 @@ class BackupControllerPage extends HookConsumerWidget {
child: ListView(
// crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Padding(
padding: EdgeInsets.all(8.0),
child: Text(
"Backup Information",
Padding(
padding: const EdgeInsets.all(8.0),
child: const Text(
"backup_controller_page_info",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16),
),
).tr(),
),
_buildFolderSelectionTile(),
BackupInfoCard(
title: "Total",
subtitle: "All unique photos and videos from selected albums",
title: "backup_controller_page_total".tr(),
subtitle: "backup_controller_page_total_sub".tr(),
info: "${backupState.allUniqueAssets.length}",
),
BackupInfoCard(
title: "Backup",
subtitle: "Backed up photos and videos",
title: "backup_controller_page_backup".tr(),
subtitle: "backup_controller_page_backup_sub".tr(),
info: "${backupState.selectedAlbumsBackupAssetsIds.length}",
),
BackupInfoCard(
title: "Remainder",
subtitle: "Remaining photos and albums to back up from selection",
title: "backup_controller_page_remainder".tr(),
subtitle: "backup_controller_page_remainder_sub".tr(),
info:
"${backupState.allUniqueAssets.length - backupState.selectedAlbumsBackupAssetsIds.length}",
),
@ -452,12 +459,12 @@ class BackupControllerPage extends HookConsumerWidget {
ref.read(backupProvider.notifier).cancelBackup();
},
child: const Text(
"CANCEL",
"backup_controller_page_cancel",
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
),
),
).tr(),
)
: ElevatedButton(
style: ElevatedButton.styleFrom(
@ -467,12 +474,12 @@ class BackupControllerPage extends HookConsumerWidget {
),
onPressed: shouldBackup ? startBackup : null,
child: const Text(
"START BACKUP",
"backup_controller_page_start_backup",
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.bold,
),
),
).tr(),
),
),
)

View file

@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:immich_mobile/modules/home/ui/delete_diaglog.dart';
@ -26,7 +27,7 @@ class ControlBottomAppBar extends StatelessWidget {
children: [
ControlBoxButton(
iconData: Icons.delete_forever_rounded,
label: "Delete",
label: "control_bottom_app_bar_delete".tr(),
onPressed: () {
showDialog(
context: context,

View file

@ -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/home/providers/home_page_state.provider.dart';
@ -19,7 +20,7 @@ class DailyTitleText extends ConsumerWidget {
var currentYear = DateTime.now().year;
var groupYear = DateTime.parse(isoDate).year;
var formatDateTemplate =
currentYear == groupYear ? 'E, MMM dd' : 'E, MMM dd, yyyy';
currentYear == groupYear ? "daily_title_text_date".tr() : "daily_title_text_date_year".tr();
var dateText =
DateFormat(formatDateTemplate).format(DateTime.parse(isoDate));
var isMultiSelectEnable =

View file

@ -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/shared/providers/asset.provider.dart';
@ -13,18 +14,17 @@ class DeleteDialog extends ConsumerWidget {
return AlertDialog(
backgroundColor: Colors.grey[200],
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
title: const Text("Delete Permanently"),
content: const Text(
"These items will be permanently deleted from Immich and from your device"),
title: const Text("delete_dialog_title").tr(),
content: const Text("delete_dialog_alert").tr(),
actions: [
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child: const Text(
"Cancel",
"delete_dialog_cancel",
style: TextStyle(color: Colors.blueGrey),
),
).tr(),
),
TextButton(
onPressed: () {
@ -36,9 +36,9 @@ class DeleteDialog extends ConsumerWidget {
Navigator.of(context).pop();
},
child: Text(
"Delete",
"delete_dialog_ok",
style: TextStyle(color: Colors.red[400]),
),
).tr(),
),
],
);

View file

@ -1,3 +1,4 @@
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
@ -11,7 +12,7 @@ class MonthlyTitleText extends StatelessWidget {
@override
Widget build(BuildContext context) {
var monthTitleText = DateFormat('MMMM y').format(DateTime.parse(isoDate));
var monthTitleText = DateFormat("monthly_title_text_date_format".tr()).format(DateTime.parse(isoDate));
return SliverToBoxAdapter(
child: Padding(

View file

@ -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:flutter_hooks/flutter_hooks.dart';
import 'package:hive_flutter/hive_flutter.dart';
@ -183,12 +184,12 @@ class ProfileDrawer extends HookConsumerWidget {
color: Colors.black54,
),
title: const Text(
"Sign Out",
"profile_drawer_sign_out",
style: TextStyle(
color: Colors.black54,
fontSize: 14,
fontWeight: FontWeight.bold),
),
).tr(),
onTap: () async {
bool res =
await ref.watch(authenticationProvider.notifier).logout();
@ -227,7 +228,7 @@ class ProfileDrawer extends HookConsumerWidget {
child: Text(
serverInfoState.isVersionMismatch
? serverInfoState.versionMismatchErrorMessage
: "Client and Server are up-to-date",
: "profile_drawer_client_server_up_to_date".tr(),
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 11,

View file

@ -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:flutter_hooks/flutter_hooks.dart';
import 'package:hive/hive.dart';
@ -21,7 +22,7 @@ class LoginForm extends HookConsumerWidget {
final passwordController =
useTextEditingController.fromValue(TextEditingValue.empty);
final serverEndpointController =
useTextEditingController(text: 'http://your-server-ip:2283/api');
useTextEditingController(text: 'login_endpoint_hint'.tr());
final isSaveLoginInfo = useState<bool>(false);
useEffect(() {
@ -73,12 +74,12 @@ class LoginForm extends HookConsumerWidget {
borderRadius: BorderRadius.circular(5)),
enableFeedback: true,
title: const Text(
"Stay logged in",
"login_form_save_login",
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.grey),
),
).tr(),
value: isSaveLoginInfo.value,
onChanged: (switchValue) {
if (switchValue != null) {
@ -107,11 +108,11 @@ class ServerEndpointInput extends StatelessWidget {
: super(key: key);
String? _validateInput(String? url) {
if (url?.startsWith(RegExp(r'https?://')) == true) {
return null;
} else {
return 'Please specify http:// or https://';
return 'login_form_err_http'.tr();
}
}
@ -119,10 +120,10 @@ class ServerEndpointInput extends StatelessWidget {
Widget build(BuildContext context) {
return TextFormField(
controller: controller,
decoration: const InputDecoration(
labelText: 'Server Endpoint URL',
decoration: InputDecoration(
labelText: 'login_form_endpoint_url'.tr(),
border: OutlineInputBorder(),
hintText: 'http://your-server-ip:port',
hintText: 'login_form_endpoint_hint'.tr(),
),
validator: _validateInput,
autovalidateMode: AutovalidateMode.always,
@ -137,9 +138,10 @@ class EmailInput extends StatelessWidget {
String? _validateInput(String? email) {
if (email == null || email == '') return null;
if (email.endsWith(' ')) return 'Trailing whitespace';
if (email.startsWith(' ')) return 'Leading whitespace';
if (email.contains(' ') || !email.contains('@')) return 'Invalid Email';
if (email.endsWith(' ')) return 'login_form_err_trailing_whitespace'.tr();
if (email.startsWith(' ')) return 'login_form_err_leading_whitespace'.tr();
if (email.contains(' ') || !email.contains('@'))
return 'login_form_err_invalid_email'.tr();
return null;
}
@ -147,10 +149,10 @@ class EmailInput extends StatelessWidget {
Widget build(BuildContext context) {
return TextFormField(
controller: controller,
decoration: const InputDecoration(
labelText: 'Email',
decoration: InputDecoration(
labelText: 'login_form_label_email'.tr(),
border: OutlineInputBorder(),
hintText: 'youremail@email.com',
hintText: 'login_form_email_hint'.tr(),
),
validator: _validateInput,
autovalidateMode: AutovalidateMode.always,
@ -168,10 +170,10 @@ class PasswordInput extends StatelessWidget {
return TextFormField(
obscureText: true,
controller: controller,
decoration: const InputDecoration(
labelText: 'Password',
decoration: InputDecoration(
labelText: 'login_form_label_password'.tr(),
border: OutlineInputBorder(),
hintText: 'password'),
hintText: 'login_form_password_hint'.tr()),
);
}
}
@ -222,15 +224,14 @@ class LoginButton extends ConsumerWidget {
} else {
ImmichToast.show(
context: context,
msg:
"Error logging you in, check server url, email and password!",
msg: "login_failed".tr(),
toastType: ToastType.error,
);
}
},
child: const Text(
"Login",
"login_form_button_text",
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
));
).tr());
}
}

View file

@ -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';
@ -47,8 +48,8 @@ class SearchBar extends HookConsumerWidget with PreferredSizeWidget {
onChanged: (value) {
ref.watch(searchPageStateProvider.notifier).setSearchTerm(value);
},
decoration: const InputDecoration(
hintText: 'Search your photos',
decoration: InputDecoration(
hintText: 'search_bar_hint'.tr(),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.transparent),
),

View file

@ -55,7 +55,7 @@ class ThumbnailWithInfo extends StatelessWidget {
child: SizedBox(
width: MediaQuery.of(context).size.width / 3,
child: Text(
textInfo.capitalizeFirstLetter(),
textInfo,
style: const TextStyle(
color: Colors.white,
fontWeight: FontWeight.bold,

View file

@ -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:flutter_hooks/flutter_hooks.dart';
import 'package:hive_flutter/hive_flutter.dart';
@ -82,7 +83,7 @@ class SearchPage extends HookConsumerWidget {
return ThumbnailWithInfo(
imageUrl:
'https://images.unsplash.com/photo-1612178537253-bccd437b730e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8NXx8Ymxhbmt8ZW58MHx8MHx8&auto=format&fit=crop&w=700&q=60',
textInfo: 'No Places Info Available',
textInfo: 'search_page_no_places'.tr(),
onTap: () {},
);
}),
@ -134,7 +135,7 @@ class SearchPage extends HookConsumerWidget {
return ThumbnailWithInfo(
imageUrl:
'https://images.unsplash.com/photo-1612178537253-bccd437b730e?ixlib=rb-1.2.1&ixid=MnwxMjA3fDB8MHxzZWFyY2h8NXx8Ymxhbmt8ZW58MHx8MHx8&auto=format&fit=crop&w=700&q=60',
textInfo: 'No Object Info Available',
textInfo: 'sarch_no_objects'.tr(),
onTap: () {},
);
}),
@ -158,20 +159,20 @@ class SearchPage extends HookConsumerWidget {
children: [
ListView(
children: [
const Padding(
Padding(
padding: EdgeInsets.all(16.0),
child: Text(
"Places",
child: const Text(
"search_page_places",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16),
),
).tr(),
),
_buildPlaces(),
const Padding(
Padding(
padding: EdgeInsets.all(16.0),
child: Text(
"Things",
child: const Text(
"search_page_things",
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16),
),
).tr(),
),
_buildThings()
],

View file

@ -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:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
@ -66,8 +67,8 @@ class SearchResultPage extends HookConsumerWidget {
onChanged: (value) {
ref.watch(searchPageStateProvider.notifier).setSearchTerm(value);
},
decoration: const InputDecoration(
hintText: 'New Search',
decoration: InputDecoration(
hintText: 'search_result_page_new_search_hint'.tr(),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Colors.transparent),
),

View file

@ -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/sharing/providers/album_title.provider.dart';
@ -59,7 +60,7 @@ class AlbumTitleTextField extends ConsumerWidget {
borderSide: const BorderSide(color: Colors.transparent),
borderRadius: BorderRadius.circular(10),
),
hintText: 'Add a title',
hintText: 'share_add_title'.tr(),
focusColor: Colors.grey[300],
fillColor: Colors.grey[200],
filled: isAlbumTitleTextFieldFocus.value,

View file

@ -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:fluttertoast/fluttertoast.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
@ -45,7 +46,7 @@ class AlbumViewerAppbar extends HookConsumerWidget with PreferredSizeWidget {
} else {
ImmichToast.show(
context: context,
msg: "Failed to delete album",
msg: "album_viewer_appbar_share_err_delete".tr(),
toastType: ToastType.error,
gravity: ToastGravity.BOTTOM,
);
@ -67,7 +68,7 @@ class AlbumViewerAppbar extends HookConsumerWidget with PreferredSizeWidget {
Navigator.pop(context);
ImmichToast.show(
context: context,
msg: "Failed to leave album",
msg: "album_viewer_appbar_share_err_leave".tr(),
toastType: ToastType.error,
gravity: ToastGravity.BOTTOM,
);
@ -93,7 +94,7 @@ class AlbumViewerAppbar extends HookConsumerWidget with PreferredSizeWidget {
Navigator.pop(context);
ImmichToast.show(
context: context,
msg: "There are problems in removing assets from album",
msg: "album_viewer_appbar_share_err_remove".tr(),
toastType: ToastType.error,
gravity: ToastGravity.BOTTOM,
);
@ -108,9 +109,9 @@ class AlbumViewerAppbar extends HookConsumerWidget with PreferredSizeWidget {
return ListTile(
leading: const Icon(Icons.delete_sweep_rounded),
title: const Text(
'Remove from album',
'album_viewer_appbar_share_remove',
style: TextStyle(fontWeight: FontWeight.bold),
),
).tr(),
onTap: () => _onRemoveFromAlbumPressed(albumId),
);
} else {
@ -121,18 +122,18 @@ class AlbumViewerAppbar extends HookConsumerWidget with PreferredSizeWidget {
return ListTile(
leading: const Icon(Icons.delete_forever_rounded),
title: const Text(
'Delete album',
'album_viewer_appbar_share_delete',
style: TextStyle(fontWeight: FontWeight.bold),
),
).tr(),
onTap: () => _onDeleteAlbumPressed(albumId),
);
} else {
return ListTile(
leading: const Icon(Icons.person_remove_rounded),
title: const Text(
'Leave album',
'album_viewer_appbar_share_leave',
style: TextStyle(fontWeight: FontWeight.bold),
),
).tr(),
onTap: () => _onLeaveAlbumPressed(albumId),
);
}
@ -176,7 +177,7 @@ class AlbumViewerAppbar extends HookConsumerWidget with PreferredSizeWidget {
if (!isSuccess) {
ImmichToast.show(
context: context,
msg: "Failed to change album title",
msg: "album_viewer_appbar_share_err_title".tr(),
gravity: ToastGravity.BOTTOM,
toastType: ToastType.error,
);

View file

@ -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';
@ -74,7 +75,7 @@ class AlbumViewerEditableTitle extends HookConsumerWidget {
focusColor: Colors.grey[300],
fillColor: Colors.grey[200],
filled: titleFocusNode.hasFocus,
hintText: 'Add a title',
hintText: 'share_add_title'.tr(),
),
);
}

View file

@ -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/routing/router.dart';
@ -51,10 +52,10 @@ class SharingSliverAppBar extends StatelessWidget {
size: 20,
),
label: const Text(
"Create shared album",
"sharing_silver_appbar_create_shared_album",
style:
TextStyle(fontWeight: FontWeight.bold, fontSize: 12),
),
).tr(),
),
),
),
@ -73,10 +74,10 @@ class SharingSliverAppBar extends StatelessWidget {
size: 20,
),
label: const Text(
"Share with partner",
"sharing_silver_appbar_share_partner",
style:
TextStyle(fontWeight: FontWeight.bold, fontSize: 12),
),
).tr(),
),
),
)

View file

@ -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:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
@ -204,13 +205,13 @@ class AlbumViewerPage extends HookConsumerWidget {
AlbumActionOutlinedButton(
iconData: Icons.add_photo_alternate_outlined,
onPressed: () => _onAddPhotosPressed(albumInfo),
labelText: "Add photos",
labelText: "share_add_photos".tr(),
),
if (userId == albumInfo.ownerId)
AlbumActionOutlinedButton(
iconData: Icons.person_add_alt_rounded,
onPressed: () => _onAddUsersPressed(albumInfo),
labelText: "Add users",
labelText: "album_viewer_page_share_add_users".tr(),
),
],
),

View file

@ -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:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
@ -65,9 +66,9 @@ class AssetSelectionPage extends HookConsumerWidget {
),
title: selectedAssets.isEmpty
? const Text(
'Add photos',
'share_add_photos',
style: TextStyle(fontSize: 18),
)
).tr()
: Text(
_buildAssetCountText(),
style: const TextStyle(fontSize: 18),
@ -86,9 +87,9 @@ class AssetSelectionPage extends HookConsumerWidget {
AutoRouter.of(context).pop(payload);
},
child: const Text(
"Add",
"share_add",
style: TextStyle(fontWeight: FontWeight.bold),
),
).tr(),
),
],
),

View file

@ -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:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
@ -64,13 +65,13 @@ class CreateSharedAlbumPage extends HookConsumerWidget {
_buildTitle() {
if (selectedAssets.isEmpty) {
return const SliverToBoxAdapter(
return SliverToBoxAdapter(
child: Padding(
padding: EdgeInsets.only(top: 200, left: 18),
child: Text(
'ADD ASSETS',
'create_shared_album_page_share_add_assets',
style: TextStyle(fontSize: 12),
),
).tr(),
),
);
}
@ -97,12 +98,12 @@ class CreateSharedAlbumPage extends HookConsumerWidget {
label: Padding(
padding: const EdgeInsets.only(left: 8.0),
child: Text(
'Select Photos',
'create_shared_album_page_share_select_photos',
style: TextStyle(
fontSize: 16,
color: Colors.grey[700],
fontWeight: FontWeight.bold),
),
).tr(),
),
),
),
@ -123,7 +124,7 @@ class CreateSharedAlbumPage extends HookConsumerWidget {
AlbumActionOutlinedButton(
iconData: Icons.add_photo_alternate_outlined,
onPressed: _onSelectPhotosButtonPressed,
labelText: "Add photos",
labelText: "share_add_photos".tr(),
),
],
),
@ -169,16 +170,16 @@ class CreateSharedAlbumPage extends HookConsumerWidget {
},
icon: const Icon(Icons.close_rounded)),
title: const Text(
'Create album',
'share_create_album',
style: TextStyle(color: Colors.black),
),
).tr(),
actions: [
TextButton(
onPressed: albumTitleController.text.isNotEmpty
? _showSelectUserPage
: null,
child: const Text(
'Share',
child: Text(
'create_shared_album_page_share'.tr(),
style: TextStyle(
fontWeight: FontWeight.bold,
),

View file

@ -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:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
@ -68,10 +69,10 @@ class SelectAdditionalUserForSharingPage extends HookConsumerWidget {
Wrap(
children: [...usersChip],
),
const Padding(
Padding(
padding: EdgeInsets.all(16.0),
child: Text(
'Suggestions',
'select_additional_user_for_sharing_page_suggestions'.tr(),
style: TextStyle(
fontSize: 14,
color: Colors.grey,
@ -112,9 +113,9 @@ class SelectAdditionalUserForSharingPage extends HookConsumerWidget {
return Scaffold(
appBar: AppBar(
title: const Text(
'Invite to album',
'share_invite',
style: TextStyle(color: Colors.black),
),
).tr(),
elevation: 0,
centerTitle: false,
leading: IconButton(
@ -128,9 +129,9 @@ class SelectAdditionalUserForSharingPage extends HookConsumerWidget {
onPressed:
sharedUsersList.value.isEmpty ? null : _addNewUsersHandler,
child: const Text(
"Add",
"share_add",
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
),
).tr(),
)
],
),

View file

@ -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:flutter_hooks/flutter_hooks.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
@ -36,8 +37,7 @@ class SelectUserForSharingPage extends HookConsumerWidget {
.navigate(const TabControllerRoute(children: [SharingRoute()]));
}
const ScaffoldMessenger(
child: SnackBar(content: Text('Failed to create album')));
ScaffoldMessenger(child: SnackBar(content: Text('select_user_for_sharing_page_err_album').tr()));
}
_buildTileIcon(User user) {
@ -84,15 +84,15 @@ class SelectUserForSharingPage extends HookConsumerWidget {
Wrap(
children: [...usersChip],
),
const Padding(
Padding(
padding: EdgeInsets.all(16.0),
child: Text(
'Suggestions',
'share_suggestions',
style: TextStyle(
fontSize: 14,
color: Colors.grey,
fontWeight: FontWeight.bold),
),
).tr(),
),
ListView.builder(
shrinkWrap: true,
@ -128,9 +128,9 @@ class SelectUserForSharingPage extends HookConsumerWidget {
return Scaffold(
appBar: AppBar(
title: const Text(
'Invite to album',
'share_invite',
style: TextStyle(color: Colors.black),
),
).tr(),
elevation: 0,
centerTitle: false,
leading: IconButton(
@ -144,9 +144,9 @@ class SelectUserForSharingPage extends HookConsumerWidget {
onPressed:
sharedUsersList.value.isEmpty ? null : _createSharedAlbum,
child: const Text(
"Create Album",
"share_create_album",
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
))
).tr())
],
),
body: suggestedShareUsers.when(

View file

@ -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:flutter_hooks/flutter_hooks.dart';
import 'package:hive/hive.dart';
@ -104,20 +105,20 @@ class SharingPage extends HookConsumerWidget {
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'EMPTY LIST',
'sharing_page_empty_list',
style: TextStyle(
fontSize: 12,
color: Theme.of(context).primaryColor,
fontWeight: FontWeight.bold,
),
),
).tr(),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
'Create shared albums to share photos and videos with people in your network.',
'sharing_page_description',
style: TextStyle(fontSize: 12, color: Colors.grey[700]),
),
).tr(),
),
],
),
@ -131,15 +132,15 @@ class SharingPage extends HookConsumerWidget {
body: CustomScrollView(
slivers: [
const SharingSliverAppBar(),
const SliverPadding(
SliverPadding(
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 12),
sliver: SliverToBoxAdapter(
child: Text(
"Shared albums",
"sharing_page_album",
style: TextStyle(
fontWeight: FontWeight.bold,
),
),
).tr(),
),
),
sharedAlbums.isNotEmpty