fix(i18n): a failed RSS poll over one channel reads as one, and keeps its stops
rss_all_failed is a plural pair counted on the raw total (the values are formatted strings, which pick no plural form); both sentences end with a stop. The Hungarian 'show N more' uses the house's megjelenítése.
This commit is contained in:
@@ -190,7 +190,8 @@
|
|||||||
"busy": "another sync is running"
|
"busy": "another sync is running"
|
||||||
},
|
},
|
||||||
"failure": {
|
"failure": {
|
||||||
"rss_all_failed": "The RSS feed answered for none of the {{total}} channels — the first: {{channel}}, {{cause}}. Read through the API instead: {{read}}"
|
"rss_all_failed_one": "The RSS feed did not answer for the one channel, {{channel}}: {{cause}}. Read through the API instead: {{read}}.",
|
||||||
|
"rss_all_failed_other": "The RSS feed answered for none of the {{total}} channels — the first: {{channel}}, {{cause}}. Read through the API instead: {{read}}."
|
||||||
},
|
},
|
||||||
"rssCause": {
|
"rssCause": {
|
||||||
"http": "HTTP {{status}}",
|
"http": "HTTP {{status}}",
|
||||||
|
|||||||
@@ -277,8 +277,8 @@
|
|||||||
"audience": "Közönség",
|
"audience": "Közönség",
|
||||||
"keywords": "Kulcsszavak",
|
"keywords": "Kulcsszavak",
|
||||||
"crew": "Stáb",
|
"crew": "Stáb",
|
||||||
"crewMore_one": "Még {{count}} mutatása",
|
"crewMore_one": "További {{count}} megjelenítése",
|
||||||
"crewMore_other": "Még {{count}} mutatása",
|
"crewMore_other": "További {{count}} megjelenítése",
|
||||||
"crewLess": "Kevesebb",
|
"crewLess": "Kevesebb",
|
||||||
"filterValue": "Szűrés erre: „{{name}}”",
|
"filterValue": "Szűrés erre: „{{name}}”",
|
||||||
"facts": {
|
"facts": {
|
||||||
|
|||||||
@@ -190,7 +190,8 @@
|
|||||||
"busy": "egy másik szinkron fut"
|
"busy": "egy másik szinkron fut"
|
||||||
},
|
},
|
||||||
"failure": {
|
"failure": {
|
||||||
"rss_all_failed": "Az RSS-hírcsatorna egyik csatornánál sem válaszolt ({{total}}) — az első: {{channel}}, {{cause}}. Az API-n át beolvasva helyette: {{read}}"
|
"rss_all_failed_one": "Az RSS-hírcsatorna az egyetlen csatornánál sem válaszolt ({{channel}}): {{cause}}. Az API-n át beolvasva helyette: {{read}}.",
|
||||||
|
"rss_all_failed_other": "Az RSS-hírcsatorna egyik csatornánál sem válaszolt ({{total}}) — az első: {{channel}}, {{cause}}. Az API-n át beolvasva helyette: {{read}}."
|
||||||
},
|
},
|
||||||
"rssCause": {
|
"rssCause": {
|
||||||
"http": "HTTP {{status}}",
|
"http": "HTTP {{status}}",
|
||||||
|
|||||||
@@ -81,13 +81,24 @@ describe("a failed run", () => {
|
|||||||
const t = i18n.getFixedT("hu");
|
const t = i18n.getFixedT("hu");
|
||||||
expect(jobRunText(t, run, "hu").body).toBe(
|
expect(jobRunText(t, run, "hu").body).toBe(
|
||||||
"Az RSS-hírcsatorna egyik csatornánál sem válaszolt (1399) — az első: UCx, HTTP 404. " +
|
"Az RSS-hírcsatorna egyik csatornánál sem válaszolt (1399) — az első: UCx, HTTP 404. " +
|
||||||
"Az API-n át beolvasva helyette: 0",
|
"Az API-n át beolvasva helyette: 0.",
|
||||||
);
|
);
|
||||||
expect(jobFailureText(t, { ...run.result, cause: "transport" }, "hu")).toContain(
|
expect(jobFailureText(t, { ...run.result, cause: "transport" }, "hu")).toContain(
|
||||||
"UCx, nem érhető el.",
|
"UCx, nem érhető el.",
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// E31 S5: the server raises it for an instance with one subscription too ("none of the 1 channels").
|
||||||
|
it("reads one channel as one, and keeps its stop", () => {
|
||||||
|
const t = i18n.getFixedT("en");
|
||||||
|
expect(jobFailureText(t, { ...run.result, total: 1 }, "en")).toBe(
|
||||||
|
"The RSS feed did not answer for the one channel, UCx: HTTP 404. Read through the API instead: 0.",
|
||||||
|
);
|
||||||
|
expect(jobFailureText(t, run.result, "en")).toMatch(
|
||||||
|
/^The RSS feed answered for none of the 1,399 channels .*: 0\.$/,
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
it("keeps any other failure's own text", () => {
|
it("keeps any other failure's own text", () => {
|
||||||
const t = i18n.getFixedT("hu");
|
const t = i18n.getFixedT("hu");
|
||||||
expect(jobRunText(t, { ...run, summary: "Plex returned 500", result: null }, "hu").body).toBe(
|
expect(jobRunText(t, { ...run, summary: "Plex returned 500", result: null }, "hu").body).toBe(
|
||||||
|
|||||||
@@ -48,7 +48,10 @@ export function jobFailureText(t: TFunction, result: unknown, lang: string): str
|
|||||||
for (const [k, v] of Object.entries(params))
|
for (const [k, v] of Object.entries(params))
|
||||||
values[k] = typeof v === "number" ? formatNumber(v, lang) : String(v);
|
values[k] = typeof v === "number" ? formatNumber(v, lang) : String(v);
|
||||||
if (typeof params.cause === "string") values.cause = rssCause(t, params.cause);
|
if (typeof params.cause === "string") values.cause = rssCause(t, params.cause);
|
||||||
return t(`scheduler.failure.${failure}`, { ...values, defaultValue: "" }) || null;
|
// A failure counted over `total` reads as a plural pair: i18next picks the form from a NUMERIC
|
||||||
|
// count, and the formatted values above are strings ("1 399" would pick none).
|
||||||
|
const count = typeof params.total === "number" ? params.total : undefined;
|
||||||
|
return t(`scheduler.failure.${failure}`, { ...values, count, defaultValue: "" }) || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Why a feed did not answer, from the poll's reason code (`http_404`, `transport`, …). */
|
/** Why a feed did not answer, from the poll's reason code (`http_404`, `transport`, …). */
|
||||||
|
|||||||
Reference in New Issue
Block a user