l10n: extract string

This commit is contained in:
Neeraj Gupta 2023-05-10 12:28:16 +05:30
parent 31ab8aafb5
commit fb01590fcf
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1
5 changed files with 34 additions and 9 deletions

View file

@ -180,6 +180,9 @@ class MessageLookup extends MessageLookupByLibrary {
static String m37(email) => "This is ${email}\'s Verification ID";
static String m62(count) =>
"${Intl.plural(count, zero: '', one: '1 day', other: '${count} days')}";
static String m38(email) => "Verify ${email}";
static String m39(email) => "We have sent a mail to <green>${email}</green>";
@ -1151,6 +1154,7 @@ class MessageLookup extends MessageLookupByLibrary {
"total": MessageLookupByLibrary.simpleMessage("total"),
"totalSize": MessageLookupByLibrary.simpleMessage("Total size"),
"trash": MessageLookupByLibrary.simpleMessage("Trash"),
"trashDaysLeft": m62,
"tryAgain": MessageLookupByLibrary.simpleMessage("Try again"),
"turnOnBackupForAutoUpload": MessageLookupByLibrary.simpleMessage(
"Turn on backup to automatically upload files added to this device folder to ente."),

View file

@ -5199,6 +5199,20 @@ class S {
);
}
/// `{count, plural, =0 {} =1 {1 day} other {{count} days}}`
String trashDaysLeft(int count) {
return Intl.plural(
count,
zero: '',
one: '1 day',
other: '$count days',
name: 'trashDaysLeft',
desc:
'Text to indicate number of days remaining before permanent deletion',
args: [count],
);
}
/// `Delete All`
String get deleteAll {
return Intl.message(

View file

@ -736,6 +736,16 @@
"referFriendsAnd2xYourPlan": "Refer friends and 2x your plan",
"shareAlbumHint": "Open an album and tap the share button on the top right to share.",
"itemsShowTheNumberOfDaysRemainingBeforePermanentDeletion": "Items show the number of days remaining before permanent deletion",
"trashDaysLeft": "{count, plural, =0 {} =1 {1 day} other {{count} days}}",
"@trashDaysLeft": {
"description": "Text to indicate number of days remaining before permanent deletion",
"placeholders": {
"count": {
"example": "1|2|3",
"type": "int"
}
}
},
"deleteAll": "Delete All",
"renameAlbum": "Rename album",
"rename": "Rename",

View file

@ -1,10 +1,10 @@
import 'package:flutter/material.dart';
import 'package:photos/ente_theme_data.dart';
import "package:photos/generated/l10n.dart";
import 'package:photos/models/collection.dart';
import 'package:photos/models/trash_file.dart';
import 'package:photos/theme/colors.dart';
import 'package:photos/ui/sharing/user_avator_widget.dart';
import 'package:photos/utils/date_time_util.dart';
class ThumbnailPlaceHolder extends StatelessWidget {
const ThumbnailPlaceHolder({Key? key}) : super(key: key);
@ -135,6 +135,10 @@ class TrashedFileOverlayText extends StatelessWidget {
@override
Widget build(BuildContext context) {
final int daysLeft =
((file.deleteBy - DateTime.now().microsecondsSinceEpoch) /
Duration.microsecondsPerDay)
.ceil();
return Container(
decoration: BoxDecoration(
gradient: LinearGradient(
@ -146,7 +150,7 @@ class TrashedFileOverlayText extends StatelessWidget {
alignment: Alignment.bottomCenter,
padding: const EdgeInsets.only(bottom: 5),
child: Text(
daysLeft(file.deleteBy),
S.of(context).trashDaysLeft(daysLeft),
style: Theme.of(context)
.textTheme
.subtitle2!

View file

@ -71,13 +71,6 @@ String getFormattedTime(BuildContext context, DateTime dateTime) {
);
}
String daysLeft(int futureTime) {
final int daysLeft = ((futureTime - DateTime.now().microsecondsSinceEpoch) /
Duration.microsecondsPerDay)
.ceil();
return '$daysLeft day' + (daysLeft <= 1 ? "" : "s");
}
String formatDuration(Duration position) {
final ms = position.inMilliseconds;