You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(i18n): report the app's declared supportedLocales on GET /i18n/locales (#7679)
`GET /api/v1/i18n/locales` answered with four descriptors (`en`, `zh-CN`,
`ja-JP`, `es-ES`) on the showcase, whose artifact declares
`i18n.supportedLocales: ['en','zh-CN']`. The envelope was right (#3636); the
set was a superset.
Nothing was wrong with what had been LOADED — every platform plugin ships an
`en/zh-CN/ja-JP/es-ES` bundle and pushes it at `kernel:ready`. What was wrong
is that the loaded set was reported as the OFFERED set, so any picker built
from this route (the platform's own Settings > Localization select included)
offered locales in which only `sys_*` objects are translated.
`II18nService` gains an optional `setSupportedLocales(locales)`.
`AppPlugin.loadTranslations` threads the artifact's `i18n.supportedLocales`
into it exactly the way it already threads `defaultLocale`, and both providers
of the `i18n` slot — `createMemoryI18n` and `FileI18nAdapter` — narrow what
`getLocales()` reports to it. Applied as a read-time filter, never a prune:
the platform bundles arrive after the app plugin has run.
Two decisions the filing left open:
- Unset `supportedLocales` means NO narrowing. Every app predating this change
declared nothing and keeps reporting every loaded locale.
- A declared locale with no bundle is REPORTED (declared-but-unserved), not
intersected away. The declaration is the app's statement of intent, a
silently shortened list hides the gap from both ends, and an intersection
would depend on how much had loaded when the route was called.
Only the reported set narrows — `GET /i18n/translations/ja-JP` still answers
on a stack that no longer advertises `ja-JP`.
Verified on a live showcase boot (fresh file DB): the route now returns
descriptors for `en` and `zh-CN` only, and `ja-JP` translations still serve.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0158ZQo7LiHSxGWpYKuPq1wu
0 commit comments