wu-sheng opened a new pull request, #15:
URL: https://github.com/apache/skywalking-horizon-ui/pull/15

   End-to-end internationalisation. English is the immovable source; **zh-CN, 
es, pt, ja, ko** ship as catalog overlays. Missing keys fall back to English at 
the leaf — half-translated catalogs are valid.
   
   ## What's in
   
   ### BFF
   - `apps/bff/src/i18n/` — locale typing, structural deep-merge, drift-safe 
overlay store, request-header parsing, embedded-i18n variant for OAP-stored 
user templates.
   - `X-Horizon-Locale` resolved per-request (header → `Accept-Language` → 
`en`) and plumbed into menu / dashboard-config / overview list+detail / 
config-bundle responses. Bundle etag now folds in the locale so 304s don't 
cross-pollinate.
   - Layer + overview loaders skip `<stem>.i18n.<lang>.json` siblings.
   - Shared **lexicon** at `apps/bff/src/i18n/lexicon/<lang>.json` with expert 
translations of common widget vocabulary; `en.json` is the source-of-truth gate.
   - `pnpm i18n:seed` + `pnpm i18n:validate` CLIs. Seed walks the 
loader-normalised source (matching the runtime merge target) and prefills 
per-template overlays from the lexicon. Validate catches orphan keys, type 
drift, and lexicon keys absent from `en`.
   - **All 44 bundled templates × 5 non-English locales seeded** — 220 sibling 
catalog files committed.
   
   ### UI
   - `apps/ui/src/i18n/`: vue-i18n bootstrap (legacy off, fallback `en`, silent 
missing), six catalogs (English in main bundle, others lazy-loaded) with expert 
translations of high-visibility chrome.
   - Bootstrap order: localStorage → `navigator.languages` → `en`. Pre-auth 
login page resolves through the same path.
   - `bffClient` stamps every request with `X-Horizon-Locale`.
   - New **`LocaleChip`** (same vocabulary as the theme chip). Lives in 
`AppTopbar` (post-auth) and `LoginView` (pre-auth). On switch: persists 
localStorage, swaps vue-i18n locale, invalidates every vue-query so 
BFF-localised payloads refetch.
   - Chrome wrapped: `LoginView` (full), `AppSidebar` (collapse / show / sign 
out / unpublished-edits), auth-store error messages.
   
   ### Admin polish (in scope per request)
   Both `LayerDashboardsAdmin` and `OverviewTemplatesAdmin`:
   - **10-second countdown after push to OAP**, visible in the save message, 
then `resync` + `refreshConfigBundle`. Gives OAP time to propagate the write 
across its cluster before re-reading state.
   - **\"refresh from remote\"** button next to the picker count: forces the 
BFF to invalidate its 30s sync cache and re-read every UI-template from OAP.
   
   ### Templates
   - Envoy AI Gateway: enabled `components.logs` + service-scoped log config — 
the layer was missing its logs tab.
   - ActiveMQ: re-pushed bundled to OAP (was disabled).
   
   ### Docs + governance
   - `CLAUDE.md` → new \"Internationalization\" section. IT terms / proper 
nouns / OAP-supplied data are not translated; translate meaning, not words; 
AI-assisted seeds are acceptable; catalog drift is a build error.
   - `docs/customization/i18n.md`: end-user guide — locale list, what is and 
isn't translated, AI-seed disclosure with contribution pointers, adding a new 
locale.
   
   ## Validation
   - BFF `tsc --noEmit` ✓
   - UI `vue-tsc --noEmit` ✓
   - `pnpm i18n:validate` → no findings
   - `license-eye header check` → 343 valid, 0 invalid
   - Smoke-tested against demo OAP: `GET /api/menu` with `X-Horizon-Locale: 
zh-CN` returns localised slots (服务 / 实例 / API); `X-Horizon-Locale: ja` returns 
Japanese (サービス / インスタンス / API).
   
   ## Translation principles applied
   Per `CLAUDE.md` → Internationalization:
   - **Proper nouns kept**: SkyWalking, Kubernetes, Envoy, Istio, OAP, MQE, 
eBPF, Zipkin, OpenTelemetry, gRPC, Apache, LDAP. Same for abbreviations: RPM, 
SLA, Apdex, P50–P99.
   - **OAP-supplied data is never translated**: service / instance / endpoint 
names, alarm rule names, tag values, log messages, trace span names.
   - **Idiomatic native phrasing**: each locale uses natural constructions 
rather than literal word-for-word machine output. Reviewed phrasings for each 
locale.
   - **AI-assisted seeds are acceptable**: docs flag this and invite 
native-speaker PRs.
   
   ## Follow-ups (not in this PR)
   - **Per-template translation editor** with live preview + EN → target side 
panel. The lexicon + structural overlay format already support it; this PR is 
the foundation. Next iteration will wire the editor into the existing 
template-sync save flow.
   - **Comprehensive chrome wrapping** across all `.vue` files (this PR covers 
login / sidebar / auth store; topbar time picker, feature pages, modals are 
next).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to