Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

feat: add localization & improve code formatting

AmanRajSinghMourya84ce87e1a8f2
diff --git a/mobile/apps/locker/lib/extensions/user_extension.dart b/mobile/apps/locker/lib/extensions/user_extension.dart
index 214b8dc5e9..3c152667df 100644
--- a/mobile/apps/locker/lib/extensions/user_extension.dart
+++ b/mobile/apps/locker/lib/extensions/user_extension.dart
@@ -1,4 +1,4 @@
-import "package:ente_sharing/models/user.dart";
+import "package:ente_sharing/models/user.dart";
extension UserExtension on User {
//Some initial users have name in name field.
diff --git a/mobile/apps/locker/lib/l10n/app_en.arb b/mobile/apps/locker/lib/l10n/app_en.arb
index d969715dc5..5ad29333e8 100644
--- a/mobile/apps/locker/lib/l10n/app_en.arb
+++ b/mobile/apps/locker/lib/l10n/app_en.arb
@@ -553,5 +553,60 @@
"noSystemLockFound": "No system lock found",
"toEnableAppLockPleaseSetupDevicePasscodeOrScreen": "To enable app lock, please setup device passcode or screen lock in your system settings.",
"legacy": "Legacy",
- "authToManageLegacy": "Please authenticate to manage your trusted contacts"
+ "authToManageLegacy": "Please authenticate to manage your trusted contacts",
+ "uploadError": "Upload Error",
+ "tryAdjustingYourSearchQuery": "Try adjusting your search query",
+ "noFilesFoundForQuery": "No files found for \"{query}\"",
+ "@noFilesFoundForQuery": {
+ "description": "Message when no files match the search query",
+ "placeholders": {
+ "query": {
+ "type": "String",
+ "example": "vacation"
+ }
+ }
+ },
+ "deselectAll": "Deselect All",
+ "selectAll": "Select All",
+ "unnamedCollection": "Unnamed Collection",
+ "enteLocker": "ente Locker",
+ "uploadedFilesProgress": "Uploaded {completed}/{total} files...",
+ "@uploadedFilesProgress": {
+ "description": "Progress message showing uploaded files",
+ "placeholders": {
+ "completed": {
+ "type": "int",
+ "example": "3"
+ },
+ "total": {
+ "type": "int",
+ "example": "5"
+ }
+ }
+ },
+ "uploadedFilesProgressWithError": "Uploaded {completed}/{total} files... ({error})",
+ "@uploadedFilesProgressWithError": {
+ "description": "Progress message showing uploaded files with error",
+ "placeholders": {
+ "completed": {
+ "type": "int",
+ "example": "3"
+ },
+ "total": {
+ "type": "int",
+ "example": "5"
+ },
+ "error": {
+ "type": "String",
+ "example": "Network error"
+ }
+ }
+ },
+ "noCollectionsAvailableForSelection": "No collections available",
+ "createCollectionButton": "Create collection",
+ "collectionButtonLabel": "Collection",
+ "hideWindow": "Hide Window",
+ "showWindow": "Show Window",
+ "exitApp": "Exit App",
+ "lockerLogs": "Locker logs"
}
diff --git a/mobile/apps/locker/lib/l10n/app_localizations.dart b/mobile/apps/locker/lib/l10n/app_localizations.dart
index 949982bb17..67e18fd9df 100644
--- a/mobile/apps/locker/lib/l10n/app_localizations.dart
+++ b/mobile/apps/locker/lib/l10n/app_localizations.dart
@@ -1881,6 +1881,108 @@ abstract class AppLocalizations {
/// In en, this message translates to:
/// **'Please authenticate to manage your trusted contacts'**
String get authToManageLegacy;
+
+ /// No description provided for @uploadError.
+ ///
+ /// In en, this message translates to:
+ /// **'Upload Error'**
+ String get uploadError;
+
+ /// No description provided for @tryAdjustingYourSearchQuery.
+ ///
+ /// In en, this message translates to:
+ /// **'Try adjusting your search query'**
+ String get tryAdjustingYourSearchQuery;
+
+ /// Message when no files match the search query
+ ///
+ /// In en, this message translates to:
+ /// **'No files found for \"{query}\"'**
+ String noFilesFoundForQuery(String query);
+
+ /// No description provided for @deselectAll.
+ ///
+ /// In en, this message translates to:
+ /// **'Deselect All'**
+ String get deselectAll;
+
+ /// No description provided for @selectAll.
+ ///
+ /// In en, this message translates to:
+ /// **'Select All'**
+ String get selectAll;
+
+ /// No description provided for @unnamedCollection.
+ ///
+ /// In en, this message translates to:
+ /// **'Unnamed Collection'**
+ String get unnamedCollection;
+
+ /// No description provided for @enteLocker.
+ ///
+ /// In en, this message translates to:
+ /// **'ente Locker'**
+ String get enteLocker;
+
+ /// Progress message showing uploaded files
+ ///
+ /// In en, this message translates to:
+ /// **'Uploaded {completed}/{total} files...'**
+ String uploadedFilesProgress(int completed, int total);
+
+ /// Progress message showing uploaded files with error
+ ///
+ /// In en, this message translates to:
+ /// **'Uploaded {completed}/{total} files... ({error})'**
+ String uploadedFilesProgressWithError(int completed, int total, String error);
+
+ /// No description provided for @noCollectionsAvailableForSelection.
+ ///
+ /// In en, this message translates to:
+ /// **'No collections available'**
+ String get noCollectionsAvailableForSelection;
+
+ /// No description provided for @createCollectionButton.
+ ///
+ /// In en, this message translates to:
+ /// **'Create collection'**
+ String get createCollectionButton;
+
+ /// No description provided for @collectionButtonLabel.
+ ///
+ /// In en, this message translates to:
+ /// **'Collection'**
+ String get collectionButtonLabel;
+
+ /// No description provided for @hideWindow.
+ ///
+ /// In en, this message translates to:
+ /// **'Hide Window'**
+ String get hideWindow;
+
+ /// No description provided for @showWindow.
+ ///
+ /// In en, this message translates to:
+ /// **'Show Window'**
+ String get showWindow;
+
+ /// No description provided for @exitApp.
+ ///
+ /// In en, this message translates to:
+ /// **'Exit App'**
+ String get exitApp;
+
+ /// No description provided for @lockerLogs.
+ ///
+ /// In en, this message translates to:
+ /// **'Locker logs'**
+ String get lockerLogs;
+
+ /// No description provided for @debugLogsForLockerApp.
+ ///
+ /// In en, this message translates to:
+ /// **'Debug logs for Locker app.\\n\\n'**
+ String get debugLogsForLockerApp;
}
class _AppLocalizationsDelegate
diff --git a/mobile/apps/locker/lib/l10n/app_localizations_en.dart b/mobile/apps/locker/lib/l10n/app_localizations_en.dart
index 03241bea60..24fb54f49f 100644
--- a/mobile/apps/locker/lib/l10n/app_localizations_en.dart
+++ b/mobile/apps/locker/lib/l10n/app_localizations_en.dart
@@ -1061,4 +1061,62 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get authToManageLegacy =>
'Please authenticate to manage your trusted contacts';
+
+ @override
+ String get uploadError => 'Upload Error';
+
+ @override
+ String get tryAdjustingYourSearchQuery => 'Try adjusting your search query';
+
+ @override
+ String noFilesFoundForQuery(String query) {
+ return 'No files found for \"$query\"';
+ }
+
+ @override
+ String get deselectAll => 'Deselect All';
+
+ @override
+ String get selectAll => 'Select All';
+
+ @override
+ String get unnamedCollection => 'Unnamed Collection';
+
+ @override
+ String get enteLocker => 'ente Locker';
+
+ @override
+ String uploadedFilesProgress(int completed, int total) {
+ return 'Uploaded $completed/$total files...';
+ }
+
+ @override
+ String uploadedFilesProgressWithError(
+ int completed, int total, String error) {
+ return 'Uploaded $completed/$total files... ($error)';
+ }
+
+ @override
+ String get noCollectionsAvailableForSelection => 'No collections available';
+
+ @override
+ String get createCollectionButton => 'Create collection';
+
+ @override
+ String get collectionButtonLabel => 'Collection';
+
+ @override
+ String get hideWindow => 'Hide Window';
+
+ @override
+ String get showWindow => 'Show Window';
+
+ @override
+ String get exitApp => 'Exit App';
+
+ @override
+ String get lockerLogs => 'Locker logs';
+
+ @override
+ String get debugLogsForLockerApp => 'Debug logs for Locker app.\\n\\n';
}
diff --git a/mobile/apps/locker/lib/services/collections/models/collection.dart b/mobile/apps/locker/lib/services/collections/models/collection.dart
index 35a16971c6..20a9337def 100644
--- a/mobile/apps/locker/lib/services/collections/models/collection.dart
+++ b/mobile/apps/locker/lib/services/collections/models/collection.dart
@@ -3,7 +3,7 @@ import 'dart:core';
import "package:ente_sharing/models/user.dart";
import 'package:flutter/foundation.dart';
import 'package:locker/services/collections/models/collection_magic.dart';
-import 'package:locker/services/collections/models/public_url.dart';
+import 'package:locker/services/collections/models/public_url.dart';
import 'package:locker/services/files/sync/models/common_keys.dart';
class Collection {
diff --git a/mobile/apps/locker/lib/services/collections/models/collection_view_type.dart b/mobile/apps/locker/lib/services/collections/models/collection_view_type.dart
index 5386236902..28f6eb8edb 100644
--- a/mobile/apps/locker/lib/services/collections/models/collection_view_type.dart
+++ b/mobile/apps/locker/lib/services/collections/models/collection_view_type.dart
@@ -11,7 +11,6 @@ enum CollectionViewType {
favorite
}
-
CollectionViewType getCollectionViewType(Collection c, int userID) {
if (!c.isOwner(userID)) {
return CollectionViewType.sharedCollection;
diff --git a/mobile/apps/locker/lib/ui/collections/collection_flex_grid_view.dart b/mobile/apps/locker/lib/ui/collections/collection_flex_grid_view.dart
index eb50192d20..6d4bb99e1a 100644
--- a/mobile/apps/locker/lib/ui/collections/collection_flex_grid_view.dart
+++ b/mobile/apps/locker/lib/ui/collections/collection_flex_grid_view.dart
@@ -8,10 +8,10 @@ import "package:locker/services/collections/models/collection.dart";
import "package:locker/ui/pages/collection_page.dart";
class CollectionFlexGridViewWidget extends StatefulWidget {
- final List<Collection> collections;
+ final List<Collection> collections;
const CollectionFlexGridViewWidget({
super.key,
- required this.collections,
+ required this.collections,
});
@override
@@ -21,12 +21,12 @@ class CollectionFlexGridViewWidget extends StatefulWidget {
class _CollectionFlexGridViewWidgetState
extends State<CollectionFlexGridViewWidget> {
- late List<Collection> _displayedCollections;
-
+ late List<Collection> _displayedCollections;
+
@override
void initState() {
super.initState();
- _displayedCollections = widget.collections;
+ _displayedCollections = widget.collections;
}
@override
@@ -47,7 +47,8 @@ class _CollectionFlexGridViewWidgetState
itemCount: min(_displayedCollections.length, 4),
itemBuilder: (context, index) {
final collection = _displayedCollections[index];
- final collectionName = collection.name ?? 'Unnamed Collection';
+ final collectionName =
+ collection.name ?? context.l10n.unnamedCollection;
return GestureDetector(
onTap: () => _navigateToCollection(collection),
diff --git a/mobile/apps/locker/lib/ui/components/information_dialog.dart b/mobile/apps/locker/lib/ui/components/information_dialog.dart
index e69de29bb2..8b13789179 100644
--- a/mobile/apps/locker/lib/ui/components/information_dialog.dart
+++ b/mobile/apps/locker/lib/ui/components/information_dialog.dart
@@ -0,0 +1 @@
+
diff --git a/mobile/apps/locker/lib/ui/pages/collection_page.dart b/mobile/apps/locker/lib/ui/pages/collection_page.dart
index 958d3a46c3..0330bd8437 100644
--- a/mobile/apps/locker/lib/ui/pages/collection_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/collection_page.dart
@@ -361,7 +361,7 @@ class _CollectionPageState extends UploaderPageState<CollectionPage>
const SizedBox(height: 16),
Text(
isSearchActive
- ? 'No files found for "$searchQuery"'
+ ? context.l10n.noFilesFoundForQuery(searchQuery)
: context.l10n.noFilesFound,
style: getEnteTextTheme(context).large.copyWith(
color: Colors.grey,
@@ -371,7 +371,7 @@ class _CollectionPageState extends UploaderPageState<CollectionPage>
if (isSearchActive) ...[
const SizedBox(height: 8),
Text(
- 'Try adjusting your search query',
+ context.l10n.tryAdjustingYourSearchQuery,
style: getEnteTextTheme(context).body.copyWith(
color: Colors.grey[600],
),
diff --git a/mobile/apps/locker/lib/ui/pages/home_page.dart b/mobile/apps/locker/lib/ui/pages/home_page.dart
index e4db4f84a9..c78b9924c8 100644
--- a/mobile/apps/locker/lib/ui/pages/home_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/home_page.dart
@@ -271,7 +271,7 @@ class _HomePageState extends UploaderPageState<HomePage>
if (mounted) {
await showErrorDialog(
context,
- 'Upload Error',
+ context.l10n.uploadError,
'Failed to process shared files: $e',
);
}
diff --git a/mobile/apps/locker/lib/ui/pages/uploader_page.dart b/mobile/apps/locker/lib/ui/pages/uploader_page.dart
index 96c173dad4..617935602f 100644
--- a/mobile/apps/locker/lib/ui/pages/uploader_page.dart
+++ b/mobile/apps/locker/lib/ui/pages/uploader_page.dart
@@ -4,6 +4,7 @@ import 'package:ente_ui/pages/base_home_page.dart';
import 'package:ente_ui/utils/dialog_util.dart';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
+import "package:locker/l10n/l10n.dart";
import 'package:locker/services/collections/collections_service.dart';
import 'package:locker/services/collections/models/collection.dart';
import 'package:locker/services/files/sync/metadata_updater_service.dart';
@@ -80,7 +81,8 @@ abstract class UploaderPageState<T extends UploaderPage> extends State<T> {
fileUploadFuture.then((enteFile) async {
completedUploads++;
progressDialog.update(
- message: "Uploaded $completedUploads/${files.length} files...",
+ message: context.l10n
+ .uploadedFilesProgress(completedUploads, files.length),
);
// Add to additional collections if multiple were selected
for (int cIndex = 1;
@@ -103,8 +105,11 @@ abstract class UploaderPageState<T extends UploaderPage> extends State<T> {
}).catchError((e) {
completedUploads++;
progressDialog.update(
- message:
- "Uploaded $completedUploads/${files.length} files... (${e.toString()})",
+ message: context.l10n.uploadedFilesProgressWithError(
+ completedUploads,
+ files.length,
+ e.toString(),
+ ),
);
}),
);
diff --git a/mobile/apps/locker/lib/ui/settings/security_section_widget.dart b/mobile/apps/locker/lib/ui/settings/security_section_widget.dart
index 8831bffe82..57d94c21ea 100644
--- a/mobile/apps/locker/lib/ui/settings/security_section_widget.dart
+++ b/mobile/apps/locker/lib/ui/settings/security_section_widget.dart
@@ -13,7 +13,7 @@ import "package:ente_lock_screen/ui/lock_screen_options.dart";
import "package:ente_ui/components/captioned_text_widget.dart";
import "package:ente_ui/components/menu_item_widget.dart";
import "package:ente_ui/components/toggle_switch_widget.dart";
-import "package:ente_ui/theme/ente_theme.dart";
+import "package:ente_ui/theme/ente_theme.dart";
import "package:ente_ui/utils/dialog_util.dart";
import "package:ente_ui/utils/toast_util.dart";
import "package:ente_utils/navigation_util.dart";
diff --git a/mobile/apps/locker/lib/ui/settings/title_bar_widget.dart b/mobile/apps/locker/lib/ui/settings/title_bar_widget.dart
index ac44124f68..9efd26ef30 100644
--- a/mobile/apps/locker/lib/ui/settings/title_bar_widget.dart
+++ b/mobile/apps/locker/lib/ui/settings/title_bar_widget.dart
@@ -1,4 +1,3 @@
-
import 'package:flutter/material.dart';
import "package:locker/l10n/l10n.dart";
diff --git a/mobile/apps/locker/lib/ui/sharing/manage_album_participant.dart b/mobile/apps/locker/lib/ui/sharing/manage_album_participant.dart
index 4501f7d174..11fb21b367 100644
--- a/mobile/apps/locker/lib/ui/sharing/manage_album_participant.dart
+++ b/mobile/apps/locker/lib/ui/sharing/manage_album_participant.dart
@@ -12,7 +12,7 @@ import "package:ente_ui/utils/dialog_util.dart";
import 'package:flutter/material.dart';
import "package:locker/extensions/user_extension.dart";
import "package:locker/l10n/l10n.dart";
-import "package:locker/services/collections/models/collection.dart";
+import "package:locker/services/collections/models/collection.dart";
import "package:locker/utils/collection_actions.dart";
class ManageIndividualParticipant extends StatefulWidget {
diff --git a/mobile/apps/locker/lib/ui/sharing/manage_links_widget.dart b/mobile/apps/locker/lib/ui/sharing/manage_links_widget.dart
index 2d54d338ff..bad667a5eb 100644
--- a/mobile/apps/locker/lib/ui/sharing/manage_links_widget.dart
+++ b/mobile/apps/locker/lib/ui/sharing/manage_links_widget.dart
@@ -18,7 +18,7 @@ import "package:locker/l10n/l10n.dart";
import "package:locker/services/collections/collections_api_client.dart";
import "package:locker/services/collections/collections_service.dart";
import "package:locker/services/collections/models/collection.dart";
-import "package:locker/services/collections/models/public_url.dart";
+import "package:locker/services/collections/models/public_url.dart";
import "package:locker/ui/sharing/pickers/device_limit_picker_page.dart";
import "package:locker/ui/sharing/pickers/link_expiry_picker_page.dart";
import "package:locker/utils/collection_actions.dart";
@@ -184,7 +184,7 @@ class _ManageSharedLinkWidgetState extends State<ManageSharedLinkWidget> {
),
MenuItemWidget(
key: ValueKey("Password lock $isPasswordEnabled"),
- captionedTextWidget: CaptionedTextWidget(
+ captionedTextWidget: CaptionedTextWidget(
title: context.l10n.passwordLock,
),
alignCaptionedTextToLeft: true,
diff --git a/mobile/apps/locker/lib/ui/sharing/more_count_badge.dart b/mobile/apps/locker/lib/ui/sharing/more_count_badge.dart
index 6ff660e9ff..78067c0a9b 100644
--- a/mobile/apps/locker/lib/ui/sharing/more_count_badge.dart
+++ b/mobile/apps/locker/lib/ui/sharing/more_count_badge.dart
@@ -1,6 +1,6 @@
import "package:ente_ui/theme/colors.dart";
import "package:ente_ui/theme/ente_theme.dart";
-import 'package:flutter/material.dart';
+import 'package:flutter/material.dart';
import 'package:tuple/tuple.dart';
enum MoreCountType { small, mini, tiny, extra }
diff --git a/mobile/apps/locker/lib/ui/sharing/share_collection_page.dart b/mobile/apps/locker/lib/ui/sharing/share_collection_page.dart
index 1b6148a358..631c0cd122 100644
--- a/mobile/apps/locker/lib/ui/sharing/share_collection_page.dart
+++ b/mobile/apps/locker/lib/ui/sharing/share_collection_page.dart
@@ -15,7 +15,7 @@ import "package:locker/extensions/user_extension.dart";
import "package:locker/l10n/l10n.dart";
import "package:locker/services/collections/collections_service.dart";
import "package:locker/services/collections/models/collection.dart";
-import "package:locker/services/configuration.dart";
+import "package:locker/services/configuration.dart";
import "package:locker/ui/sharing/add_participant_page.dart";
import "package:locker/ui/sharing/album_participants_page.dart";
import "package:locker/ui/sharing/album_share_info_widget.dart";
@@ -90,11 +90,11 @@ class _ShareCollectionPageState extends State<ShareCollectionPage> {
onTap: () async {
// ignore: unawaited_futures
routeToPage(
- context,
- AddParticipantPage(
- [widget.collection],
- const [ActionTypesToShow.addViewer],
- ),
+ context,
+ AddParticipantPage(
+ [widget.collection],
+ const [ActionTypesToShow.addViewer],
+ ),
).then(
(value) => {
if (mounted) {setState(() => {})},
diff --git a/mobile/apps/locker/lib/ui/viewer/actions/collection_selection_overlay_bar.dart b/mobile/apps/locker/lib/ui/viewer/actions/collection_selection_overlay_bar.dart
index 6d5e080c11..dfe0cee3d7 100644
--- a/mobile/apps/locker/lib/ui/viewer/actions/collection_selection_overlay_bar.dart
+++ b/mobile/apps/locker/lib/ui/viewer/actions/collection_selection_overlay_bar.dart
@@ -47,8 +47,9 @@ class _CollectionSelectionOverlayBarState
builder: (context, child) {
final isAllSelected = widget.selectedCollections.count ==
widget.collection.length;
- final buttonText =
- isAllSelected ? 'Deselect All' : 'Select All';
+ final buttonText = isAllSelected
+ ? context.l10n.deselectAll
+ : context.l10n.selectAll;
final iconData = isAllSelected
? Icons.remove_circle_outline
: Icons.check_circle_outline_outlined;
diff --git a/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart b/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart
index d38885e326..bdc03c5a9f 100644
--- a/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart
+++ b/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart
@@ -51,8 +51,9 @@ class _FileSelectionOverlayBarState extends State<FileSelectionOverlayBar> {
builder: (context, child) {
final isAllSelected =
widget.selectedFiles.count == widget.files.length;
- final buttonText =
- isAllSelected ? 'Deselect All' : 'Select All';
+ final buttonText = isAllSelected
+ ? context.l10n.deselectAll
+ : context.l10n.selectAll;
final iconData = isAllSelected
? Icons.remove_circle_outline
: Icons.check_circle_outline_outlined;