fix(api): a refused write is named, in the reader's language
Deep-review round 5, over round 4's own fixes.
- `notifyActionError` preferred the server's `detail` over the caller's translated fallback, and
`reportFailure` deliberately leaves 403/404/429 to the caller — so for exactly those statuses the
dozen call sites round 4 converted started printing whatever English a route hand-wrote into an
otherwise Hungarian UI ("No user with that email.", "Not subscribed to this channel", "Unknown
job"). A STRUCTURED detail is still preferred: `req` has already run it through `localizeDetail`,
so it is both localized and more specific. A plain string is not.
- The other half of the same defect, on the backend: round 4's `get_or_404(what="channel")` sweep
reached exactly ONE of the five identical sites in channels.py and shipped the HU/EN string with
it, so the Block button said it in Hungarian and the four controls beside it in English. All five
are converted, and the subscription / share-recipient / scheduler-job 404s with them (two new
reasons in both locales).
- `PlexCollectionEditor`'s add/remove, take-over and delete were try/finally with no catch — in the
very file round 4 edited to give `createNew` one. 403 and 404 are the caller's to report, so the
tick simply never appeared and a CONFIRMED "delete collection" did nothing, silently.
- `UploadDialog` is the only `uploadReq` caller and kept an empty catch whose comment still claimed
the global error modal had it. It had not since `reportFailure` became shared: a proxy 502 raised
only the self-clearing connection notice and a 413/403/404 nothing at all, so the dialog snapped
back to its pre-upload state with no error named. The user's own Cancel stays silent — and since
a cancel and a network drop both carry status 0, that difference is now a named `isAborted`
rather than a string literal at each end.
Regression tests for each (5 vitest, 2 pytest, plus two existing assertions corrected), all
mutation-checked: 6 mutations, each red on the assertion it is named after. vitest 1007,
pytest 1127.
This commit is contained in:
@@ -34,7 +34,8 @@
|
||||
"submit": "Upload",
|
||||
"uploading": "Uploading… {{pct}}%",
|
||||
"uploadProgress": "Upload progress",
|
||||
"added": "File uploaded"
|
||||
"added": "File uploaded",
|
||||
"failed": "The upload failed."
|
||||
},
|
||||
"tabs": {
|
||||
"queue": "Queue",
|
||||
|
||||
@@ -14,7 +14,10 @@
|
||||
"video": "This video isn't in the library any more.",
|
||||
"invite": "This invite doesn't exist any more.",
|
||||
"user": "This user doesn't exist any more.",
|
||||
"channel": "This channel isn't in the library any more."
|
||||
"channel": "This channel isn't in the library any more.",
|
||||
"subscription": "You're not subscribed to this channel any more.",
|
||||
"recipient": "There's no user with that email address.",
|
||||
"job": "This job doesn't exist any more."
|
||||
},
|
||||
"ok": "OK",
|
||||
"offline": {
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
"namePlaceholder": "Collection name",
|
||||
"nameTaken": "A collection with this name already exists.",
|
||||
"newHint": "Pick the first title to add — a collection needs at least one.",
|
||||
"createWith": "Create"
|
||||
"createWith": "Create",
|
||||
"deleteFailed": "Couldn't delete the collection."
|
||||
},
|
||||
"searchPlaceholder": "Search Plex…",
|
||||
"searchField": {
|
||||
|
||||
@@ -34,7 +34,8 @@
|
||||
"submit": "Feltöltés",
|
||||
"uploading": "Feltöltés… {{pct}}%",
|
||||
"uploadProgress": "Feltöltés folyamata",
|
||||
"added": "Fájl feltöltve"
|
||||
"added": "Fájl feltöltve",
|
||||
"failed": "A feltöltés nem sikerült."
|
||||
},
|
||||
"tabs": {
|
||||
"queue": "Sor",
|
||||
|
||||
@@ -14,7 +14,10 @@
|
||||
"video": "Ez a videó már nincs a könyvtárban.",
|
||||
"invite": "Ez a meghívó már nem létezik.",
|
||||
"user": "Ez a felhasználó már nem létezik.",
|
||||
"channel": "Ez a csatorna már nincs a könyvtárban."
|
||||
"channel": "Ez a csatorna már nincs a könyvtárban.",
|
||||
"subscription": "Már nem vagy feliratkozva erre a csatornára.",
|
||||
"recipient": "Nincs felhasználó ezzel az e-mail címmel.",
|
||||
"job": "Ez a feladat már nem létezik."
|
||||
},
|
||||
"ok": "OK",
|
||||
"offline": {
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
"namePlaceholder": "Kollekció neve",
|
||||
"nameTaken": "Már létezik ilyen nevű kollekció.",
|
||||
"newHint": "Válaszd ki az első címet — egy kollekcióhoz legalább egy elem kell.",
|
||||
"createWith": "Létrehozás"
|
||||
"createWith": "Létrehozás",
|
||||
"deleteFailed": "Nem sikerült törölni a gyűjteményt."
|
||||
},
|
||||
"searchPlaceholder": "Keresés a Plexben…",
|
||||
"searchField": {
|
||||
|
||||
Reference in New Issue
Block a user