From 6aed2dcab1ee8854e6436cc4c74d83c98711c204 Mon Sep 17 00:00:00 2001 From: Eoin Shaughnessy Date: Sun, 5 Apr 2026 23:41:27 +0100 Subject: [PATCH 1/2] docs: document availableLanguages and defaultLanguage for i18n in new frontend system Signed-off-by: Eoin Shaughnessy --- .../building-plugins/07-internationalization.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/frontend-system/building-plugins/07-internationalization.md b/docs/frontend-system/building-plugins/07-internationalization.md index 3e882cb8e2..1300529ede 100644 --- a/docs/frontend-system/building-plugins/07-internationalization.md +++ b/docs/frontend-system/building-plugins/07-internationalization.md @@ -293,6 +293,23 @@ const app = createApp({ }); ``` +### Declaring available languages + +Installing translation extensions makes the translated messages available, but the language switcher in the Settings page only appears once you declare which languages your app supports. 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. + Go to the Settings page — you should see language switching buttons. Switch languages to verify your translations are loaded correctly. ### Using the CLI for full translation workflows From 8b997d07c439b38f7a56ac2fdb1942630c7f9cb8 Mon Sep 17 00:00:00 2001 From: Eoin Shaughnessy Date: Sun, 5 Apr 2026 23:56:19 +0100 Subject: [PATCH 2/2] docs: address review feedback on i18n available languages section Signed-off-by: Eoin Shaughnessy --- .../building-plugins/07-internationalization.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/frontend-system/building-plugins/07-internationalization.md b/docs/frontend-system/building-plugins/07-internationalization.md index 1300529ede..cb112dbd84 100644 --- a/docs/frontend-system/building-plugins/07-internationalization.md +++ b/docs/frontend-system/building-plugins/07-internationalization.md @@ -295,7 +295,7 @@ const app = createApp({ ### Declaring available languages -Installing translation extensions makes the translated messages available, but the language switcher in the Settings page only appears once you declare which languages your app supports. Configure this in your `app-config.yaml` using the `api:app/app-language` extension: +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: @@ -308,9 +308,9 @@ app: 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. +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 language switching buttons. Switch languages to verify your translations are loaded correctly. +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