fix(i18n): the video menu's download row says "Download…", and counted copy is pluralized

- The row opens the download dialog, so it is labelled so; the download's state ("Downloaded",
  "In queue") is its hint, not its label.
- The share dialog's expiry ("1 days") and a link's view count ("1 views") go through i18next's
  plural forms (`count`).
This commit is contained in:
2026-09-27 14:50:04 +02:00
parent 17bb14fb18
commit 98bf0a9d66
6 changed files with 102 additions and 9 deletions
+7 -2
View File
@@ -1,5 +1,8 @@
{
"navLabel": "Downloads",
"menu": {
"download": "Download…"
},
"button": {
"label": "Download",
"queued": "In queue",
@@ -124,13 +127,15 @@
"allowDownload": "Allow download",
"expiry": "Expires",
"expiryNever": "Never",
"days": "{{n}} days",
"days_one": "{{count}} day",
"days_other": "{{count}} days",
"password": "Password (optional)",
"copy": "Copy link",
"copyFailed": "Couldn’t copy",
"revoke": "Revoke",
"revokeConfirm": "This link will stop working immediately.",
"views": "{{n}} views",
"views_one": "{{count}} view",
"views_other": "{{count}} views",
"expiresOn": "expires {{date}}",
"hasPassword": "password",
"downloadable": "downloadable",
+7 -2
View File
@@ -1,5 +1,8 @@
{
"navLabel": "Letöltések",
"menu": {
"download": "Letöltés…"
},
"button": {
"label": "Letöltés",
"queued": "Sorban",
@@ -124,13 +127,15 @@
"allowDownload": "Letöltés engedélyezése",
"expiry": "Lejárat",
"expiryNever": "Soha",
"days": "{{n}} nap",
"days_one": "{{count}} nap",
"days_other": "{{count}} nap",
"password": "Jelszó (opcionális)",
"copy": "Link másolása",
"copyFailed": "Nem sikerült másolni",
"revoke": "Visszavonás",
"revokeConfirm": "A link azonnal használhatatlanná válik.",
"views": "{{n}} megtekintés",
"views_one": "{{count}} megtekintés",
"views_other": "{{count}} megtekintés",
"expiresOn": "lejár: {{date}}",
"hasPassword": "jelszó",
"downloadable": "letölthető",
+24
View File
@@ -0,0 +1,24 @@
// @vitest-environment jsdom
//
// E28 review J5: a count in copy goes through i18next's plural forms (`count`), never a bare `n` —
// the share dialog's expiry read "1 days".
import { describe, expect, it } from "vitest";
import i18n from "./index";
describe("counted copy", () => {
it("the share link's expiry is singular for one day", async () => {
await i18n.changeLanguage("en");
expect(i18n.t("downloads.share.days", { count: 1 })).toBe("1 day");
expect(i18n.t("downloads.share.days", { count: 7 })).toBe("7 days");
await i18n.changeLanguage("hu");
expect(i18n.t("downloads.share.days", { count: 1 })).toBe("1 nap");
await i18n.changeLanguage("en");
});
it("a link's view count is singular for one view", async () => {
await i18n.changeLanguage("en");
expect(i18n.t("downloads.share.views", { count: 1 })).toBe("1 view");
expect(i18n.t("downloads.share.views", { count: 0 })).toBe("0 views");
});
});