Modernizing Galaxy's Internationalization (i18n) System #22456
itisAliRH
started this conversation in
General Discussion
Replies: 2 comments
-
|
I know very little about this, but it looks to me that leaving the decision of adopting a standard i18n library to last (Phase 4) would risk having to redo a good chunk of the Phase 1 and 2 work. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Do we know how many (number/%) people use i18n on the usegalaxy servers? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Galaxy's internationalization system needs a coordinated modernization effort. The current custom localization system covers only ~35% of user-visible strings, uses patterns that will break with Vue 3 (PR #20787), and lacks tooling to measure or improve translation coverage. This discussion aims to gather community input on the approach before implementation begins.
Problem
Galaxy serves a global research community, yet its i18n system has significant gaps:
localize()function. The remaining ~65% are hardcoded English.Vue.filter()andVue.mixin(), both removed in Vue 3. When PR Vue3 #20787 merges, the| localizefilter andthis.l()mixin pattern will break. These must be fixed before the Vue 3 PR merges to avoid UI regressions."1 item"vs"N items"), no interpolation ("Hello, {name}"), no context/disambiguation, no lazy loading.Current State
Architecture
Galaxy uses a custom, client-side-only dictionary-lookup system (
client/src/utils/localization.js). There is no third-party i18n library. The backend has no i18n at all — all API responses and error messages are English-only.Usage Patterns
import localize from "@/utils/localization"v-localizedirective<span v-localize>text</span>this.l("text"){{ "text" | localize }}Supported Languages
falseentries)Note: These numbers are against the current root locale file (~344 keys), which itself only represents ~25% of all user-visible strings.
Biggest Untranslated Areas
components/Grid/configs/)title="..."tooltip attributesplaceholder="..."attributesRelated Issues & PRs
detosupportedLanguagesv-localizedirectiveProposed Solution
Phase 0: Fix Vue 3 Blockers (Before #20787 merges)
The Vue 3 PR should only merge when there are no breaking parts in the UI. The i18n-related breakages must be fixed first:
PR 0a — Update localization plugin for Vue 3:
Vue.filter("localize")→ useapp.config.globalProperties.$lor direct importsVue.mixin(localizeMixin)→ useapp.config.globalProperties.$l+app.provide("localize", ...)v-localizedirective to Vue 3 directive API (mountedhook instead ofbind)| localizefilter tolocalize()callsthis.l()mixin to direct importsPR 0b — Create
useLocalize()composable:Phase 1: Build a Complete Translation Template + Coverage Tooling
The core idea: extract every translatable string from the codebase into a canonical template, then measure each language file against it.
PR 1a — String extraction script:
Create
client/scripts/extract-i18n-strings.jsthat scans all.vue,.ts,.jsfiles and extracts strings from:localize("...")/_l("...")function callsv-localizeelements| localize/| lfilter expressionstitle:fields (and similar patterns)Outputs a
template.json— the "complete" set of strings that should be translated.PR 1b — Coverage report & CI integration:
Add a Makefile target (
make client-i18n-report) and optionally a CI step to track coverage over time.Phase 2: Wrap Remaining Hardcoded Strings
Incrementally wrap hardcoded strings in
localize(), prioritized by impact:title:pattern, easy batch)placeholder/title/aria-labelattributes (~187 strings)Each area can be a separate PR for easier review.
Phase 3: Complete Translations (LLM-Assisted + Community Review)
Translation completion would use an LLM-assisted workflow with native-speaker review:
This is neither pure LLM nor pure community effort — the LLM handles the bulk translation work while community reviewers ensure quality, domain accuracy, and natural phrasing. This approach is motivated by:
Phase 4: Evaluate and Potentially Adopt a Standard i18n Library (Optional)
Once the template-based system is working, the community can evaluate whether adopting a standard library would provide enough value to justify the migration effort. The leading candidates for Vue 3:
useI18n()composable, rich toolingvue-i18n is the most mature and widely adopted option — it's part of the Vue ecosystem with 1.6M+ weekly downloads, full Vue 3 support (v10 released), and features like pluralization, interpolation, lazy loading, and TypeScript support. However, adoption is not required for Phases 0–3 — the current
localize()function works fine once Vue 3-compatible, and the template approach is library-agnostic.This phase should only be pursued if the community agrees the benefits (pluralization, interpolation, tooling) justify the migration cost.
Goals
Breakdown of PRs
useLocalize()composableclient/scripts/placeholder,title,aria-labelPRs in the same phase (e.g., 2a–2d) can be worked on in parallel.
Questions for the Community
vue-i18n(or another library)?Beta Was this translation helpful? Give feedback.
All reactions