Merge pull request #33767 from EoinTrial/docs/i18n-available-languages

docs: document availableLanguages and defaultLanguage for i18n in new frontend system
This commit is contained in:
Patrik Oldsberg
2026-04-09 01:30:41 +02:00
committed by GitHub
@@ -293,7 +293,24 @@ const app = createApp({
});
```
Go to the Settings page — you should see language switching buttons. Switch languages to verify your translations are loaded correctly.
### Declaring available languages
Installing translation extensions makes the translated messages available, but the language switcher in the Settings page only appears once you declare two or more supported languages. Configure this in your `app-config.yaml` using the `api:app/app-language` extension:
```yaml
app:
extensions:
- api:app/app-language:
config:
availableLanguages:
- en
- zh
defaultLanguage: en
```
The `availableLanguages` array controls which languages appear as options in the Settings page. The `defaultLanguage` sets the language used before the user makes a selection, and defaults to `en` if not specified. If you configure `availableLanguages`, the `defaultLanguage` must be one of those entries — if you omit `defaultLanguage`, make sure `en` is included in `availableLanguages`, otherwise the app can fail to start.
Go to the Settings page — you should see a language select dropdown. Switch languages to verify your translations are loaded correctly.
### Using the CLI for full translation workflows