Element: #501 Basic (navigation/locale-switcher)
What it shows: A language switcher with three options named in their own language; picking one awaits an async onselect before the value changes.
When to use: A language selector in a public header or settings: persist the choice, set the cookie and navigate to the localized URL, with the control busy meanwhile.
Spec:
- `` with `options` of `pt-BR` (label `Português`, `short: 'PT'`), `en` (`English`) and `es` (`Español`)
- `async function onselect(next: string)` waits 600 ms, then writes a visible `saved` note: Saved ; the app would now go to //login.
- Before any pick the note reads `Pick a language: the switcher stays busy until onselect resolves.`
- The column is left-aligned with `gap: var(--ca-space-3)`
Tags: locale-switcher, language, i18n, dropdown, async, onselect
Needs: @codeatlasdev/ui@4.6.0
Components: LocaleSwitcher
Live demo: https://ui.codeatlas.com.br/docs/navigation/locale-switcher#basic
{saved || 'Pick a language: the switcher stays busy until onselect resolves.'}