fix(i18n): every refusal the API answers is structured and said in the reader's language
~150 HTTPExceptions carried a hand-written English sentence as their detail,
shown verbatim under the Hungarian UI — in the blocking error dialog and on
every inline surface that printed HttpError.detail (sign-in, setup wizard,
change password, the passphrase gate, live search). Four also quoted an
upstream exception's text back to the user.
- app/refusal.py: `refused(status, reason, **params)` → {code: "refused",
reason, …params}; localizeDetail translates errors.refused.<reason> with the
params interpolated. "Unknown X" 404s use the existing not_found(what).
- sysconfig.set_value raises InvalidSetting (reason + bounds) instead of an
English ValueError; the three writers answer it through setting_refused.
- The Plex connection/write/image failures log what the upstream said and
answer a reason; the search scraper's failure is logged and answered as
youtube/unavailable (it crashed refusal_reason before).
- HttpError.detail now only ever holds a translated reason: a string detail
(only the framework's own can remain) is left out, so reading .detail is
safe everywhere — including destructured, the hole the raw-detail source
scan could not see. That scan and its five-file exception list are gone.
- Enforced: test_http_details.py fails on any HTTPException with a sentence
for a detail; the contract test requires every refused reason and every
not_found "what" in both languages, and no key for one that is gone.
- local/jsx-comment-text: a // inside JSX children renders as text; the rule
is ten lines in eslint.config.js rather than eslint-plugin-react's ~1800
lockfile lines.
This commit is contained in:
@@ -21,7 +21,21 @@
|
||||
"job": "This job doesn't exist any more.",
|
||||
"download": "This download doesn't exist any more.",
|
||||
"link": "This share link doesn't exist any more.",
|
||||
"notification": "This notification doesn't exist any more."
|
||||
"notification": "This notification doesn't exist any more.",
|
||||
"account": "That account no longer exists.",
|
||||
"collection": "This collection doesn't exist any more.",
|
||||
"config_key": "There's no such setting.",
|
||||
"file": "The file is no longer available.",
|
||||
"filmstrip": "There's no filmstrip for this.",
|
||||
"host": "This host isn't on the list any more.",
|
||||
"image": "There's no image for this.",
|
||||
"item": "This item doesn't exist any more.",
|
||||
"library": "This library doesn't exist any more.",
|
||||
"plex_item": "This Plex item isn't in the library any more.",
|
||||
"poster": "There's no poster for this.",
|
||||
"profile": "This download profile doesn't exist any more.",
|
||||
"season": "This season isn't in the library any more.",
|
||||
"show": "This show isn't in the library any more."
|
||||
},
|
||||
"admin": {
|
||||
"not_allowed": "Their address isn't approved any more. Add it to the whitelist first.",
|
||||
@@ -99,5 +113,98 @@
|
||||
"quota": "Today's YouTube budget for this instance is spent. It resets at midnight Pacific time — try again then.",
|
||||
"reconnect": "Google no longer accepts this account's YouTube connection. Sign out and sign in with Google again to reconnect it.",
|
||||
"unavailable": "YouTube didn't accept that just now. Please try again."
|
||||
},
|
||||
"refused": {
|
||||
"account_no_access": "That account no longer has access.",
|
||||
"account_signed_out": "That account was signed out elsewhere — sign in again.",
|
||||
"account_suspended": "That account is suspended.",
|
||||
"address_has_account": "That address already has an account — delete the account instead.",
|
||||
"admin_first": "Create the admin account first.",
|
||||
"admin_only": "Only an admin can do that.",
|
||||
"already_set_up": "This instance is already set up.",
|
||||
"already_subscribed": "You're already subscribed to this channel.",
|
||||
"channel_blocked": "You've blocked this channel.",
|
||||
"collection_fields_required": "A title and an item are both needed.",
|
||||
"collection_pending_sync": "The collection changed in Plex, but refreshing the local copy failed — it catches up on the next sync.",
|
||||
"collection_read_only": "This collection is read-only.",
|
||||
"collection_smart": "Smart and auto-list collections can't be made editable.",
|
||||
"demo_activate": "The demo account can't be activated.",
|
||||
"demo_delete": "The demo account can't be deleted.",
|
||||
"demo_role": "The demo account's role can't be changed.",
|
||||
"demo_suspend": "The demo account can't be suspended.",
|
||||
"download_not_ready": "This download isn't ready.",
|
||||
"edit_unfinished": "Only a finished download can be edited.",
|
||||
"filters_not_object": "The view's filters are malformed.",
|
||||
"google_no_userinfo": "Google didn't send back the account details. Try signing in again.",
|
||||
"image_fetch_failed": "The image couldn't be loaded.",
|
||||
"image_host": "Images from that address aren't loaded.",
|
||||
"invalid_cursor": "The list position is out of date — reload the page.",
|
||||
"invalid_email": "Enter a valid email address.",
|
||||
"invalid_interval": "The interval must be between {{min}} and {{max}} minutes.",
|
||||
"invalid_link": "That doesn't look like a valid video link.",
|
||||
"invalid_role": "Unknown role.",
|
||||
"invalid_status": "Unknown status.",
|
||||
"invite_decided": "This request has already been decided.",
|
||||
"job_running": "This job is already running.",
|
||||
"last_active_admin": "This is the only active admin — make someone else admin first.",
|
||||
"last_admin": "This is the only admin — make someone else admin first.",
|
||||
"link_gone": "This link is no longer available.",
|
||||
"link_required": "A video link or id is required.",
|
||||
"media_missing": "The media file isn't on disk.",
|
||||
"message_empty": "The message is empty.",
|
||||
"message_rate": "Too many messages — slow down a moment.",
|
||||
"message_self": "You can't message yourself.",
|
||||
"message_too_long": "The message is too long.",
|
||||
"messaging_set_up": "Secure messaging is already set up.",
|
||||
"name_required": "A name is required.",
|
||||
"no_encryption_key": "Set TOKEN_ENCRYPTION_KEY to store secrets in the database.",
|
||||
"no_messaging": "That member hasn't set up messaging yet.",
|
||||
"no_profile": "There's no download profile to use.",
|
||||
"no_subscription_id": "There's no YouTube subscription on record yet — sync your subscriptions first.",
|
||||
"not_authenticated": "You're not signed in.",
|
||||
"not_ready": "Not available yet.",
|
||||
"not_redownloadable": "This item can't be downloaded again.",
|
||||
"not_your_account": "That's not an account you've signed into here.",
|
||||
"only_admin_delete": "You're the only admin — make someone else admin before deleting your account.",
|
||||
"own_delete": "Delete your own account in Settings → Account.",
|
||||
"own_role": "You can't change your own role.",
|
||||
"own_suspend": "You can't suspend your own account.",
|
||||
"plex_disabled": "The Plex module is turned off.",
|
||||
"plex_not_configured": "Plex isn't set up — add the server address and token in Configuration → Plex.",
|
||||
"plex_unreachable": "The Plex server didn't answer. Check the address and the token, then try again.",
|
||||
"plex_write_failed": "Plex didn't accept the change. Try again.",
|
||||
"profile_name_required": "A profile name is required.",
|
||||
"quota_reserve": "Today's shared YouTube budget is down to its reserve — try again later.",
|
||||
"quota_spent": "Today's shared YouTube budget is spent. Try again tomorrow.",
|
||||
"recipient_required": "A recipient email is required.",
|
||||
"registration_closed": "Registration is currently closed.",
|
||||
"search_daily_limit": "You've reached today's YouTube search limit ({{limit}}). Try again tomorrow.",
|
||||
"search_term_required": "Enter something to search for.",
|
||||
"session_gone": "The playback session ended.",
|
||||
"setting_not_a_choice": "Pick one of: {{choices}}.",
|
||||
"setting_not_a_number": "Enter a whole number.",
|
||||
"setting_too_high": "The value can be at most {{max}}.",
|
||||
"setting_too_low": "The value must be at least {{min}}.",
|
||||
"setup_token": "The setup token is missing or wrong.",
|
||||
"share_own": "That's already your download.",
|
||||
"share_password_required": "This link needs a password.",
|
||||
"share_unfinished": "Only a finished download can be shared.",
|
||||
"smtp_failed": "The email couldn't be sent — check the SMTP settings.",
|
||||
"smtp_off": "SMTP isn't configured.",
|
||||
"spec_not_object": "The profile's settings are malformed.",
|
||||
"still_downloading": "This download is still in progress.",
|
||||
"tag_name_taken": "You already have a tag named “{{name}}”.",
|
||||
"title_required": "A title is required.",
|
||||
"too_many_attempts": "Too many attempts. Try again shortly.",
|
||||
"unknown_setting": "Unknown setting: {{key}}",
|
||||
"value_missing": "A value is required.",
|
||||
"video_gone": "This video is no longer available.",
|
||||
"view_name_taken": "You already have a view named “{{name}}”.",
|
||||
"watch_sync_off": "Turn on Plex watch-sync first.",
|
||||
"weak_password": "The password must be at least {{min}} characters.",
|
||||
"wrong_password": "The current password is incorrect.",
|
||||
"wrong_share_password": "Wrong password.",
|
||||
"youtube_editing_off": "Turn on YouTube editing in Settings first.",
|
||||
"youtube_read_scope": "Connect your YouTube account (read access) first."
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user