diff --git a/lib/features/composer/presentation/extensions/composer_print_draft_extension.dart b/lib/features/composer/presentation/extensions/composer_print_draft_extension.dart index 8742f4b84..a544d5d7d 100644 --- a/lib/features/composer/presentation/extensions/composer_print_draft_extension.dart +++ b/lib/features/composer/presentation/extensions/composer_print_draft_extension.dart @@ -100,7 +100,9 @@ extension ComposerPrintDraftExtension on ComposerController { ccPrefix: appLocalizations.cc_email_address_prefix, bccPrefix: appLocalizations.bcc_email_address_prefix, replyToPrefix: appLocalizations.replyToEmailAddressPrefix, - titleAttachment: appLocalizations.attachments.toLowerCase(), + titleAttachment: uploadController.allAttachmentsUploaded.length > 1 + ? appLocalizations.attachments.toLowerCase() + : appLocalizations.attachment.toLowerCase(), toAddress: listToEmailAddress.toSet().listEmailAddressToString( isFullEmailAddress: true, ), diff --git a/lib/features/composer/presentation/widgets/attachment_header_composer_widget.dart b/lib/features/composer/presentation/widgets/attachment_header_composer_widget.dart index 174621b47..2590c011d 100644 --- a/lib/features/composer/presentation/widgets/attachment_header_composer_widget.dart +++ b/lib/features/composer/presentation/widgets/attachment_header_composer_widget.dart @@ -57,7 +57,9 @@ class AttachmentHeaderComposerWidget extends StatelessWidget { ), const SizedBox(width: AttachmentHeaderComposerWidgetStyle.space / 2), Text( - '${listFileUploaded.length} ${AppLocalizations.of(context).attachments}', + listFileUploaded.length > 1 + ? '${listFileUploaded.length} ${AppLocalizations.of(context).attachments}' + : '${listFileUploaded.length} ${AppLocalizations.of(context).attachment}', style: AttachmentHeaderComposerWidgetStyle.labelTextSize ), const SizedBox(width: AttachmentHeaderComposerWidgetStyle.space), diff --git a/lib/features/email/data/datasource_impl/email_datasource_impl.dart b/lib/features/email/data/datasource_impl/email_datasource_impl.dart index cd5cef4b7..5e5fb69c2 100644 --- a/lib/features/email/data/datasource_impl/email_datasource_impl.dart +++ b/lib/features/email/data/datasource_impl/email_datasource_impl.dart @@ -503,7 +503,9 @@ class EmailDataSourceImpl extends EmailDataSource { ccPrefix: appLocalizations.cc_email_address_prefix, bccPrefix: appLocalizations.bcc_email_address_prefix, replyToPrefix: appLocalizations.replyToEmailAddressPrefix, - titleAttachment: appLocalizations.attachments.toLowerCase(), + titleAttachment: listPreviewAttachment.length > 1 + ? appLocalizations.attachments.toLowerCase() + : appLocalizations.attachment.toLowerCase(), attachmentIcon: attachmentIconBase64Data, toAddress: email.to?.listEmailAddressToString(isFullEmailAddress: true), ccAddress: email.cc?.listEmailAddressToString(isFullEmailAddress: true), diff --git a/lib/features/email/data/datasource_impl/email_local_storage_datasource_impl.dart b/lib/features/email/data/datasource_impl/email_local_storage_datasource_impl.dart index 5aa4e965d..1e16f17f7 100644 --- a/lib/features/email/data/datasource_impl/email_local_storage_datasource_impl.dart +++ b/lib/features/email/data/datasource_impl/email_local_storage_datasource_impl.dart @@ -343,7 +343,9 @@ class EmailLocalStorageDataSourceImpl extends EmailDataSource { ccPrefix: appLocalizations.cc_email_address_prefix, bccPrefix: appLocalizations.bcc_email_address_prefix, replyToPrefix: appLocalizations.replyToEmailAddressPrefix, - titleAttachment: appLocalizations.attachments.toLowerCase(), + titleAttachment: listPreviewAttachment.length > 1 + ? appLocalizations.attachments.toLowerCase() + : appLocalizations.attachment.toLowerCase(), attachmentIcon: attachmentIconBase64Data, toAddress: email.to?.listEmailAddressToString(isFullEmailAddress: true), ccAddress: email.cc?.listEmailAddressToString(isFullEmailAddress: true), diff --git a/lib/features/email/presentation/utils/email_action_reactor/email_action_reactor.dart b/lib/features/email/presentation/utils/email_action_reactor/email_action_reactor.dart index e0671a59f..19263f35f 100644 --- a/lib/features/email/presentation/utils/email_action_reactor/email_action_reactor.dart +++ b/lib/features/email/presentation/utils/email_action_reactor/email_action_reactor.dart @@ -408,7 +408,9 @@ class EmailActionReactor { ccPrefix: appLocalizations.cc_email_address_prefix, bccPrefix: appLocalizations.bcc_email_address_prefix, replyToPrefix: appLocalizations.replyToEmailAddressPrefix, - titleAttachment: appLocalizations.attachments.toLowerCase(), + titleAttachment: emailLoaded.attachments.length > 1 + ? appLocalizations.attachments.toLowerCase() + : appLocalizations.attachment.toLowerCase(), toAddress: presentationEmail.to?.listEmailAddressToString(isFullEmailAddress: true), ccAddress: presentationEmail.cc?.listEmailAddressToString(isFullEmailAddress: true), bccAddress: presentationEmail.bcc?.listEmailAddressToString(isFullEmailAddress: true), diff --git a/lib/features/email/presentation/widgets/attachments_info.dart b/lib/features/email/presentation/widgets/attachments_info.dart index d6d6f78f0..416db7687 100644 --- a/lib/features/email/presentation/widgets/attachments_info.dart +++ b/lib/features/email/presentation/widgets/attachments_info.dart @@ -38,10 +38,15 @@ class AttachmentsInfo extends StatelessWidget { ); final titleHeaderAttachment = Text( - AppLocalizations.of(context).titleHeaderAttachment( - numberOfAttachments, - totalSizeInfo, - ), + numberOfAttachments > 1 + ? AppLocalizations.of(context).titleHeaderAttachment( + numberOfAttachments, + totalSizeInfo, + ) + : AppLocalizations.of(context).singularAttachmentTitleHeader( + numberOfAttachments, + totalSizeInfo, + ), maxLines: 1, overflow: TextOverflow.ellipsis, style: ThemeUtils.textStyleInter400.copyWith( diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index 92135e09a..669e89316 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -363,6 +363,18 @@ "totalSize": {} } }, + "singularAttachmentTitleHeader": "{count} Attachment ({totalSize})", + "@singularAttachmentTitleHeader": { + "type": "text", + "placeholders_order": [ + "count", + "totalSize" + ], + "placeholders": { + "count": {}, + "totalSize": {} + } + }, "attach_file_prepare_text": "Preparing to attach file...", "@attach_file_prepare_text": { "type": "text", @@ -787,6 +799,12 @@ "placeholders_order": [], "placeholders": {} }, + "attachment": "Attachment", + "@attachment": { + "type": "text", + "placeholders_order": [], + "placeholders": {} + }, "showAll": "Show all", "@showAll": { "type": "text", diff --git a/lib/l10n/intl_fr.arb b/lib/l10n/intl_fr.arb index 0366ea5f7..6076c9343 100644 --- a/lib/l10n/intl_fr.arb +++ b/lib/l10n/intl_fr.arb @@ -654,6 +654,12 @@ "placeholders_order": [], "placeholders": {} }, + "attachment": "Pièce jointe", + "@attachment": { + "type": "text", + "placeholders_order": [], + "placeholders": {} + }, "show_all": "Tout afficher", "@show_all": { "type": "text", @@ -2120,6 +2126,18 @@ "totalSize": {} } }, + "singularAttachmentTitleHeader": "{count} Pièce jointe ({totalSize})", + "@singularAttachmentTitleHeader": { + "type": "text", + "placeholders_order": [ + "count", + "totalSize" + ], + "placeholders": { + "count": {}, + "totalSize": {} + } + }, "undo": "Annuler", "@undo": { "type": "text", diff --git a/lib/l10n/intl_messages.arb b/lib/l10n/intl_messages.arb index 823827c72..66e27e631 100644 --- a/lib/l10n/intl_messages.arb +++ b/lib/l10n/intl_messages.arb @@ -1,5 +1,5 @@ { - "@@last_modified": "2025-09-11T12:24:54.969188", + "@@last_modified": "2025-09-19T09:56:48.738620", "initializing_data": "Initializing data...", "@initializing_data": { "type": "text", @@ -390,6 +390,18 @@ "totalSize": {} } }, + "singularAttachmentTitleHeader": "{count} Attachment ({totalSize})", + "@singularAttachmentTitleHeader": { + "type": "text", + "placeholders_order": [ + "count", + "totalSize" + ], + "placeholders": { + "count": {}, + "totalSize": {} + } + }, "attach_file_prepare_text": "Preparing to attach file...", "@attach_file_prepare_text": { "type": "text", @@ -842,6 +854,12 @@ "placeholders_order": [], "placeholders": {} }, + "attachment": "Attachment", + "@attachment": { + "type": "text", + "placeholders_order": [], + "placeholders": {} + }, "showAll": "Show all", "@showAll": { "type": "text", @@ -4842,7 +4860,7 @@ "placeholders_order": [], "placeholders": {} }, - "attachmentReminderModalMessage": "You wrote {keyword} in your message but did not add any attachments. Do you still want to send ?", + "attachmentReminderModalMessage": "You wrote {keyword} in your message but did not add any attachments. Do you still want to send?", "@attachmentReminderModalMessage": { "type": "text", "placeholders_order": [ diff --git a/lib/main/localizations/app_localizations.dart b/lib/main/localizations/app_localizations.dart index d805d397a..04de6749e 100644 --- a/lib/main/localizations/app_localizations.dart +++ b/lib/main/localizations/app_localizations.dart @@ -392,6 +392,14 @@ class AppLocalizations { ); } + String singularAttachmentTitleHeader(int count, String totalSize) { + return Intl.message( + '$count Attachment ($totalSize)', + name: 'singularAttachmentTitleHeader', + args: [count, totalSize] + ); + } + String get attach_file_prepare_text { return Intl.message( 'Preparing to attach file...', @@ -853,6 +861,13 @@ class AppLocalizations { name: 'attachments'); } + String get attachment { + return Intl.message( + 'Attachment', + name: 'attachment', + ); + } + String get showAll { return Intl.message( 'Show all',