Skip to content

armgit / ente

Public Imported from GitHub
0

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

[web] Preserve singular localized delete confirmations

Aswin Asokc7df99322158
diff --git a/web/apps/photos/tests/trash-files-dialog.test.ts b/web/apps/photos/tests/trash-files-dialog.test.ts
index 040f6f9909..a761369051 100644
--- a/web/apps/photos/tests/trash-files-dialog.test.ts
+++ b/web/apps/photos/tests/trash-files-dialog.test.ts
@@ -13,12 +13,16 @@ beforeEach(async () => {
"en-US": { translation: en },
"fr-FR": {
translation: {
+ trash_file_title: fr.trash_file_title,
+ trash_file_message: fr.trash_file_message,
trash_files_title: fr.trash_files_title,
trash_files_message: fr.trash_files_message,
},
},
"es-ES": {
translation: {
+ trash_file_title: es.trash_file_title,
+ trash_file_message: es.trash_file_message,
trash_files_title: es.trash_files_title,
trash_files_message: es.trash_files_message,
},
@@ -45,8 +49,14 @@ test.each([
await i18n.changeLanguage(locale);
for (const count of [1, 2]) {
expect(trashFilesDialogAttributes(count)).toMatchObject({
- title: strings.trash_files_title,
- message: strings.trash_files_message,
+ title:
+ count === 1
+ ? strings.trash_file_title
+ : strings.trash_files_title,
+ message:
+ count === 1
+ ? strings.trash_file_message
+ : strings.trash_files_message,
});
}
});
diff --git a/web/packages/gallery/components/trash-files-dialog.tsx b/web/packages/gallery/components/trash-files-dialog.tsx
index 9e05048653..126f3e1e82 100644
--- a/web/packages/gallery/components/trash-files-dialog.tsx
+++ b/web/packages/gallery/components/trash-files-dialog.tsx
@@ -11,12 +11,14 @@ export const trashFilesDialogAttributes = (
title: t("trash_items_title", {
count,
fallbackLng: false,
- defaultValue: t("trash_files_title"),
+ defaultValue: t(count === 1 ? "trash_file_title" : "trash_files_title"),
}),
message: t("trash_items_message", {
count,
fallbackLng: false,
- defaultValue: t("trash_files_message"),
+ defaultValue: t(
+ count === 1 ? "trash_file_message" : "trash_files_message",
+ ),
}),
illustration: (
<Box