Skip to content

Consume server-resolved translations for server-provided strings#1911

Open
marcelveldt wants to merge 2 commits into
mainfrom
server-side-translations
Open

Consume server-resolved translations for server-provided strings#1911
marcelveldt wants to merge 2 commits into
mainfrom
server-side-translations

Conversation

@marcelveldt

Copy link
Copy Markdown
Member

The frontend kept its own copy of translatable strings for objects the server provides — config-entry labels/descriptions/option titles, config categories, media item names, genres, recommendations and browse folders — and resolved them locally via vue-i18n. The server now resolves these server-side and sends them already localized, so the local copies are dead and the lookup logic is redundant.

This migrates the frontend to consume the server-resolved values, leaving only genuinely UI-owned strings in the locale files.

Changes

  • Consume server-resolved label/description/option title/category_label/name directly instead of looking them up via vue-i18n.
  • Send the translations/set_locale command on connect and whenever the UI language changes, then refresh state so server-provided strings re-resolve (works on the Ingress path too, where the auth command is skipped).
  • Pre-translate the frontend-only settings entries (theme/language/menu items/etc.) locally, since those remain frontend-owned.
  • Remove the now-dead server-object keys from the locale files (recommendations.*, genre_names.*, and the migrated config-entry keys); only frontend UI strings remain.

Note: genre descriptions and browse-folder titles stay client-side for now and are a follow-up.

Companion PRs:

The frontend kept its own copy of translatable strings for objects the server
provides (config entries, media item names, genres, recommendations, browse
folders) and resolved them locally. The server now resolves these for the
connection locale and sends them already localized, so consume those values
directly and stop resolving the keys client-side.

- Render server-resolved label/description/option title/category_label/name
  instead of looking them up via vue-i18n.
- Send translations/set_locale on connect and on UI language change, then
  refresh state so server-provided strings re-resolve (also covers the Ingress
  path where the auth command is skipped).
- Pre-translate the frontend-only settings entries locally; those stay
  frontend-owned.
- Remove the now-dead server-object keys from the locale files.
- Update getGenreDisplayName tests for the server-resolved behaviour.
- Remove the now no-op getGenreDisplayName helper and inline genre names to
  item.name (names are resolved server-side), which collapses the genre
  special-casing in the listview, info header and editorial cards.
- Inline the folderTitle passthrough to folder.name.
- Drop the ConfigEntry translation_key/translation_params/category_translation_*
  fields from the interface: the server no longer sends them and nothing reads
  them (the media/option/task translation keys stay, still used client-side).
- Reword the migration comments to describe current behaviour.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant