Skip to content

feat: Vuetify component translations - #1945

Merged
pedrolamas merged 3 commits into
fluidd-core:developfrom
pedrolamas:pedrolamas/vuetify-i18n
Aug 27, 2026
Merged

feat: Vuetify component translations#1945
pedrolamas merged 3 commits into
fluidd-core:developfrom
pedrolamas:pedrolamas/vuetify-i18n

Conversation

@pedrolamas

Copy link
Copy Markdown
Member

Wires Vuetify's own component translations to the Fluidd language setting, and fixes browser locale detection along the way.

Vuetify i18n

  • Vuetify keeps a separate string table for what its components render on their own — the v-data-table footer, pagination and sort aria-labels, the v-file-input counter. No locales were registered, so these stayed english in every language.
  • Registers a translation for each language Fluidd ships, mapping the Fluidd locale codes onto Vuetify's (zh-CNzh-Hans, zh-HKzh-Hant, pt_BRpt).
  • Tamil has no Vuetify translation and stays on the english fallback.
  • Types the vuetify/lib/locale/* module shim, which otherwise resolved as any.

Browser locale detection

  • getStartingLocale stripped the region before matching, so a browser set to zh-CN resolved to zh — not a supported code — and fell back to english. Chinese users got english by default despite both translations shipping.
  • It also only read the first navigator preference, so ['nb-NO', 'de-DE'] gave english rather than german.
  • Navigator locales are now walked in preference order, matching the full code before the language alone.

Locale loading

  • loadLocaleMessagesAsync now leans on i18n.availableLocales instead of tracking loaded locales in a parallel array, collapsing three branches into one.
  • Called with no locale, it resolves the browser default itself, so callers no longer reach for getStartingLocale.
  • Load failures log through consola rather than being swallowed.
  • Waits.onLoadLanguage moves into a finally — a failed load previously stranded it — and now drives the language selector's loading state, which nothing had been reading.

🤖 Generated with Claude Code

pedrolamas and others added 2 commits August 27, 2026 11:30
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
getStartingLocale stripped the region before matching, so a browser set
to zh-CN resolved to zh, which is not a supported code, and fell back to
english. It also only read the first navigator preference, ignoring a
supported second one. Navigator locales are now walked in order, with
the full code matched before the language alone.

Also simplifies loadLocaleMessagesAsync onto i18n.availableLocales
rather than tracking loaded locales separately, takes the browser
default when called with no locale, logs load failures through consola,
and keeps the language wait in a finally so a failed load cannot strand
it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
@pedrolamas
pedrolamas requested a lite review from Copilot August 27, 2026 11:31
@pedrolamas pedrolamas added the FR - Enhancement New feature or request label Aug 27, 2026
@pedrolamas pedrolamas added this to the 1.37.5 milestone Aug 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Hooks Vuetify’s built-in component locale strings (data table footer/pagination, aria labels, file input counter, etc.) into Fluidd’s locale flow, and improves browser-locale resolution so the initial language selection better matches supported locales.

Changes:

  • Add async Vuetify-locale loading (loadVuetifyLocaleAsync) and call it during config/onLocaleChange.
  • Fix getStartingLocale to prefer full locale codes and walk navigator preferences in order; simplify locale async loading using i18n.availableLocales and add error logging via consola.
  • Add unit tests for locale detection and wire the language selector loading state to Waits.onLoadLanguage.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/typings/vuetify.d.ts Adds typing shim for vuetify/lib/locale/* imports.
src/store/config/actions.ts Drives both VueI18n and Vuetify locale loading under onLocaleChange, with wait cleanup in finally.
src/plugins/vuetify.ts Introduces Vuetify locale import map + loadVuetifyLocaleAsync.
src/plugins/i18n.ts Improves starting-locale detection + simplifies async locale loading + logs load failures via consola.
src/plugins/tests/i18n.spec.ts Adds tests covering locale matching and fallback behavior.
src/components/settings/GeneralSettings.vue Shows language selector loading state via Waits.onLoadLanguage.
docs/docs/features/localization.md Updates localization docs copy (Weblate note).
docs/docs/development.md Documents Vuetify component translation behavior and mapping.
AGENTS.md Documents the Vuetify locale map/loader behavior for agents/contributors.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/plugins/i18n.ts
Comment thread src/plugins/vuetify.ts
`loadVuetifyLocaleAsync` returned early for a locale with no Vuetify
translation, leaving `lang.current` on the previously selected language.
Switching from Portuguese to Tamil left the data table footer reading
"Linhas por página:". Reset `lang.current` to `en` instead, matching the
documented behaviour.

`getStartingLocale` truncated at the underscore rather than normalizing
it, so an underscore-form browser locale such as `zh_CN` collapsed to
`zh` and matched nothing.

Adds coverage for `loadVuetifyLocaleAsync` (locale mapping, the English
reset, and load caching) plus the underscore form.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
@pedrolamas
pedrolamas merged commit 044954d into fluidd-core:develop Aug 27, 2026
6 checks passed
@pedrolamas
pedrolamas deleted the pedrolamas/vuetify-i18n branch August 27, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FR - Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants