lxbme opened a new pull request, #3440: URL: https://github.com/apache/apisix-dashboard/pull/3440
**Why submit this pull request?** - [x] Bugfix **What changes will this PR take into?** Part of #3417 (UX/i18n section). Three i18n defects: **1. The language was never persisted.** `lng` was hardcoded to `'en'`, so a reload reset a zh/tr user to English — while the admin key IS persisted right next to it. The choice is now stored under `settings:lang` (the same convention as the admin key) and restored on init. Deliberately **no** browser-language auto-detection: it would silently change the default for existing English users (and, as it happens, broke the e2e auth fixture that keys off the English "Settings" dialog). Restoring an explicit stored choice is the actual bug fix; auto-detection is a separate, debatable feature. **2. antd's ConfigProvider was hardwired to enUS**, so antd-rendered surfaces (list pagination, table controls) stayed English after switching. It now follows `i18n.language` across all five bundled locales. **3. The delete confirmation was assembled from three concatenated pieces** (a sentence + the bold target + a literal `?`/`¿?` mark), producing garbled output like `…la Ruta? <name> ¿?` in es/de/tr where the sentence already ends the question. It is now one locale-owned sentence (`info.delete.confirm`) with the identifier in a `<Trans>` bold slot. **Tests.** e2e `i18n.persistence-and-locale.spec.ts` covers all three: language survives a reload, antd pagination follows the language, and the Spanish confirmation is a single well-formed question with no `¿?`. Not included, deferred to an #3417 comment: the translation-progress indicator counts structural keys rather than translated *values*, so it reports ~100% for every locale and never displays — a separate defect needing a definition of "untranslated". Blast radius: full local e2e suite — 178 passed; the 2 failures are documented environment items unrelated to this change (a list-pagination load flake, green on isolated rerun, and `stream_routes.show-disabled-error`). Unit tests, lint and build clean. **Related issues** Part of #3417 (please do not auto-close the tracking issue) **Checklist:** - [x] Did you explain what problem does this PR solve? - [x] Have you added corresponding test cases? - [ ] Have you modified the corresponding document? (locale JSON updated; no prose doc covers this) - [x] Is this PR backward compatible? -- 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]
