feat: Vuetify component translations - #1945
Merged
pedrolamas merged 3 commits intoAug 27, 2026
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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 duringconfig/onLocaleChange. - Fix
getStartingLocaleto prefer full locale codes and walk navigator preferences in order; simplify locale async loading usingi18n.availableLocalesand add error logging viaconsola. - 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.
`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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Wires Vuetify's own component translations to the Fluidd language setting, and fixes browser locale detection along the way.
Vuetify i18n
v-data-tablefooter, pagination and sort aria-labels, thev-file-inputcounter. No locales were registered, so these stayed english in every language.zh-CN→zh-Hans,zh-HK→zh-Hant,pt_BR→pt).vuetify/lib/locale/*module shim, which otherwise resolved asany.Browser locale detection
getStartingLocalestripped the region before matching, so a browser set tozh-CNresolved tozh— not a supported code — and fell back to english. Chinese users got english by default despite both translations shipping.['nb-NO', 'de-DE']gave english rather than german.Locale loading
loadLocaleMessagesAsyncnow leans oni18n.availableLocalesinstead of tracking loaded locales in a parallel array, collapsing three branches into one.getStartingLocale.consolarather than being swallowed.Waits.onLoadLanguagemoves into afinally— a failed load previously stranded it — and now drives the language selector's loading state, which nothing had been reading.🤖 Generated with Claude Code