Skip to content

armgit / ente

Public Imported from GitHub
0

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

Localize storage limit text in family dashboard

ashilkn058550be566a
diff --git a/mobile/apps/photos/lib/l10n/intl_en.arb b/mobile/apps/photos/lib/l10n/intl_en.arb
index 3d51b998c8..abbb1ab1e4 100644
--- a/mobile/apps/photos/lib/l10n/intl_en.arb
+++ b/mobile/apps/photos/lib/l10n/intl_en.arb
@@ -807,6 +807,15 @@
}
}
},
+ "yourStorageIsLimitedTo": "Your storage is limited to {limit}",
+ "@yourStorageIsLimitedTo": {
+ "placeholders": {
+ "limit": {
+ "type": "String",
+ "example": "50 GB"
+ }
+ }
+ },
"storageLimitExplanation": "Set the maximum storage this member can use. They will not be able to upload once the limit is reached.",
"limit": "Limit",
"noLimit": "No limit",
diff --git a/mobile/apps/photos/lib/services/machine_learning/compute_controller.dart b/mobile/apps/photos/lib/services/machine_learning/compute_controller.dart
index 0b6f8438a7..2d56ece0f8 100644
--- a/mobile/apps/photos/lib/services/machine_learning/compute_controller.dart
+++ b/mobile/apps/photos/lib/services/machine_learning/compute_controller.dart
@@ -275,8 +275,7 @@ class ComputeController {
);
return;
}
- final shouldRunCompute =
- this.shouldRunCompute;
+ final shouldRunCompute = this.shouldRunCompute;
if (shouldRunCompute != _canRunCompute) {
_canRunCompute = shouldRunCompute;
_logger.info(
diff --git a/mobile/apps/photos/lib/services/sync/local_sync_service.dart b/mobile/apps/photos/lib/services/sync/local_sync_service.dart
index 89cbb9a410..4d7c3d2eba 100644
--- a/mobile/apps/photos/lib/services/sync/local_sync_service.dart
+++ b/mobile/apps/photos/lib/services/sync/local_sync_service.dart
@@ -361,7 +361,8 @@ class LocalSyncService {
conflictAlgorithm: SqliteAsyncConflictAlgorithm.ignore,
);
_logger.info('Inserted ${files.length} out of ${allFiles.length} files');
- if (flagService.syncRecoveryDiagnostics && allFiles.length != files.length) {
+ if (flagService.syncRecoveryDiagnostics &&
+ allFiles.length != files.length) {
final sampleLocalIDs =
allFiles.take(3).map((file) => file.localID).toList();
_logger.info(
diff --git a/mobile/apps/photos/lib/services/sync/remote_sync_service.dart b/mobile/apps/photos/lib/services/sync/remote_sync_service.dart
index f0759d3e5c..2a12d7031f 100644
--- a/mobile/apps/photos/lib/services/sync/remote_sync_service.dart
+++ b/mobile/apps/photos/lib/services/sync/remote_sync_service.dart
@@ -1111,9 +1111,8 @@ class RemoteSyncService {
return await _photoManagerPlugin.isLocallyAvailable(
file.localID!,
isOrigin: true,
- subtype: file.fileType == FileType.livePhoto
- ? (file.fileSubType ?? 0)
- : 0,
+ subtype:
+ file.fileType == FileType.livePhoto ? (file.fileSubType ?? 0) : 0,
);
} catch (e, s) {
_logger.warning(
diff --git a/mobile/apps/photos/lib/ui/family/family_plan_page.dart b/mobile/apps/photos/lib/ui/family/family_plan_page.dart
index 796708ba47..db7af3b9ff 100644
--- a/mobile/apps/photos/lib/ui/family/family_plan_page.dart
+++ b/mobile/apps/photos/lib/ui/family/family_plan_page.dart
@@ -853,7 +853,9 @@ class _FamilyStorageOverviewCard extends StatelessWidget {
if (storageLimit != null) ...[
const SizedBox(height: 10),
Text(
- "Your storage is limited to ${convertBytesToReadableFormat(storageLimit!)}",
+ AppLocalizations.of(context).yourStorageIsLimitedTo(
+ limit: convertBytesToReadableFormat(storageLimit!),
+ ),
style: textTheme.miniMuted,
),
],
diff --git a/mobile/apps/photos/lib/ui/viewer/file/qr_code_highlight_overlay.dart b/mobile/apps/photos/lib/ui/viewer/file/qr_code_highlight_overlay.dart
index 2e1298312c..0b4fab2503 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/qr_code_highlight_overlay.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/qr_code_highlight_overlay.dart
@@ -21,46 +21,46 @@ class QrCodeHighlightOverlay extends StatelessWidget {
}
return LayoutBuilder(
- builder: (context, constraints) {
- final screenWidth = constraints.maxWidth;
- final screenHeight = constraints.maxHeight;
+ builder: (context, constraints) {
+ final screenWidth = constraints.maxWidth;
+ final screenHeight = constraints.maxHeight;
- double displayWidth;
- double displayHeight;
- if (file.hasDimensions) {
- final imageAspect = file.width / file.height;
- final screenAspect = screenWidth / screenHeight;
- if (imageAspect > screenAspect) {
- displayWidth = screenWidth;
- displayHeight = screenWidth / imageAspect;
- } else {
- displayHeight = screenHeight;
- displayWidth = screenHeight * imageAspect;
- }
- } else {
- displayWidth = screenWidth;
- displayHeight = screenHeight;
- }
+ double displayWidth;
+ double displayHeight;
+ if (file.hasDimensions) {
+ final imageAspect = file.width / file.height;
+ final screenAspect = screenWidth / screenHeight;
+ if (imageAspect > screenAspect) {
+ displayWidth = screenWidth;
+ displayHeight = screenWidth / imageAspect;
+ } else {
+ displayHeight = screenHeight;
+ displayWidth = screenHeight * imageAspect;
+ }
+ } else {
+ displayWidth = screenWidth;
+ displayHeight = screenHeight;
+ }
- final offsetX = (screenWidth - displayWidth) / 2;
- final offsetY = (screenHeight - displayHeight) / 2;
+ final offsetX = (screenWidth - displayWidth) / 2;
+ final offsetY = (screenHeight - displayHeight) / 2;
- return SizedBox.expand(
- child: Stack(
- children: [
- for (final detection in detections)
- _QrTapRegion(
- detection: detection,
- offsetX: offsetX,
- offsetY: offsetY,
- displayWidth: displayWidth,
- displayHeight: displayHeight,
- ),
- ],
- ),
- );
- },
+ return SizedBox.expand(
+ child: Stack(
+ children: [
+ for (final detection in detections)
+ _QrTapRegion(
+ detection: detection,
+ offsetX: offsetX,
+ offsetY: offsetY,
+ displayWidth: displayWidth,
+ displayHeight: displayHeight,
+ ),
+ ],
+ ),
);
+ },
+ );
}
}
diff --git a/mobile/apps/photos/lib/ui/viewer/file/zoomable_image.dart b/mobile/apps/photos/lib/ui/viewer/file/zoomable_image.dart
index 156b6527a1..f452afe55b 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/zoomable_image.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/zoomable_image.dart
@@ -85,9 +85,8 @@ class _ZoomableImageState extends State<ZoomableImage> {
widget.shouldDisableScroll!(value != PhotoViewScaleState.initial);
}
_isZooming = value != PhotoViewScaleState.initial;
- InheritedDetailPageState.maybeOf(context)
- ?.isZoomedNotifier
- .value = _isZooming;
+ InheritedDetailPageState.maybeOf(context)?.isZoomedNotifier.value =
+ _isZooming;
debugPrint("isZooming = $_isZooming, currentState $value");
// _logger.info('is reakky zooming $_isZooming with state $value');
};
diff --git a/mobile/apps/photos/lib/utils/face_crop_util.dart b/mobile/apps/photos/lib/utils/face_crop_util.dart
index 2c3cf010d1..e697f89a82 100644
--- a/mobile/apps/photos/lib/utils/face_crop_util.dart
+++ b/mobile/apps/photos/lib/utils/face_crop_util.dart
@@ -54,14 +54,12 @@ FaceBox computePaddedFaceCropBox(FaceBox faceBox) {
final xCrop = faceBox.x - faceBox.width * _regularPadding;
final xOvershoot = min(0.0, xCrop).abs() / faceBox.width;
- final widthCrop =
- faceBox.width * (1 + 2 * _regularPadding) -
+ final widthCrop = faceBox.width * (1 + 2 * _regularPadding) -
2 * min(xOvershoot, _regularPadding - _minimumPadding) * faceBox.width;
final yCrop = faceBox.y - faceBox.height * _regularPadding;
final yOvershoot = min(0.0, yCrop).abs() / faceBox.height;
- final heightCrop =
- faceBox.height * (1 + 2 * _regularPadding) -
+ final heightCrop = faceBox.height * (1 + 2 * _regularPadding) -
2 * min(yOvershoot, _regularPadding - _minimumPadding) * faceBox.height;
final xCropSafe = xCrop.clamp(0.0, 1.0);
diff --git a/mobile/apps/photos/plugins/ente_crypto/lib/src/crypto.dart b/mobile/apps/photos/plugins/ente_crypto/lib/src/crypto.dart
index d7eddd4f74..86a2b9712e 100644
--- a/mobile/apps/photos/plugins/ente_crypto/lib/src/crypto.dart
+++ b/mobile/apps/photos/plugins/ente_crypto/lib/src/crypto.dart
@@ -943,8 +943,8 @@ class CryptoUtil {
// account KDF memory limit (128 MiB), not libsodium's absolute minimum.
const int minMemLimit = 128 * 1024 * 1024;
Uint8List key;
- while (memLimit >= minMemLimit &&
- opsLimit <= Sodium.cryptoPwhashOpslimitMax) {
+ while (
+ memLimit >= minMemLimit && opsLimit <= Sodium.cryptoPwhashOpslimitMax) {
try {
key = await deriveKey(password, salt, memLimit, opsLimit);
return DerivedKeyResult(key, memLimit, opsLimit);