Platform & Access · Back-office interface language
The staff interface is shown in Spanish or Portuguese when the browser is set to one of them, and in English otherwise, with English filling any missing string.
| Area | Platform & Access |
| Routes | application |
| Centre modules | always available |
| Staff levels | all |
| Models | — |
| UI label | (intl) |
| Coverage | 2 use cases · 1 happy · 3 failure |
Known issues (1)
How it works
_setLanguage() always loads English first, then — if navigator.language starts with es or pt — loads that locale, strips keys whose value is an empty string (_removeKeysWithVoidValues) and calls intl.setLocale([lang, 'en']), so untranslated strings fall back to English rather than rendering blank. Loading is retried up to three times before giving up with a console error. There is no in-app language switcher: the only control is the browser’s language setting. This is separate from the content languages configured per centre (see Multi-language content authoring).
Use cases
Why someone opens this (2)
- Spanish and Portuguese centre staff using the back office in their own language.
- Shipping a new string in English first while translations catch up, without blank labels.
Path map
flowchart LR F(["Back-office interface language"]):::feat F --> H1["Portuguese browser"]:::ok F -.-> X1["Unsupported browser language"]:::bad F -.-> X2["Translation bundle fails to load"]:::bad F -.-> X3["Wrong-language string in a bundle"]:::bad classDef feat fill:#4a5c8a,stroke:#4a5c8a,color:#ffffff,font-weight:bold classDef ok fill:#e3f1ea,stroke:#0d6b42,color:#0d4a2e classDef bad fill:#f7e6e2,stroke:#9a2d1c,color:#6e1f13
Happy paths
Portuguese browser
- Browser language is
pt-PT; English and Portuguese bundles load.- Empty Portuguese values are removed and the locale chain is set to
pt, thenen.- The UI renders in Portuguese with English for any gaps.
Failure paths
Unsupported browser language
Cause — e.g. French or Italian.
What happens — English is used; there is no way to choose Spanish or Portuguese without changing the browser.
Translation bundle fails to load
Cause — Network error three times in a row.
What happens — Logged to the console only; the app continues with whatever locale state exists, which can mean raw keys on screen.
Wrong-language string in a bundle
Cause — A value in the wrong language inside the English file.
What happens — Rendered as-is — e.g.
import-csv.errors.load.required-selectionsappears in Portuguese to English users.
QA checklist
Tick these off while regression-testing this feature. The boxes are plain Markdown, so progress is visible in git diffs.
- ✅ Portuguese browser
- ⛔ Unsupported browser language
- ⛔ Translation bundle fails to load
- ⛔ Wrong-language string in a bundle
Implementation
Related
- Same area — Staff login · Password reset request · Password update from reset link · Change own password · Idle auto-logout · Centre switching & multi-centre scoping · Server-incident banner · Desktop (home dashboard) · Runtime environment & white-label boot · In-app help & support chat (Froged)
Generated from doc/feature-inventory.json · id platform-ui-language · commit 276788ca6