feat(i18n): re-apply internationalization support#145
Merged
Conversation
Re-applies all i18n changes from feat/i18n branch that were inadvertently reverted along with the canary branch revert. Original PR: #133
✅ Deploy Preview for xyd-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for xyd-website canceled.
|
✅ Deploy Preview for xyd-apidocs-demo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…cher catalog watching
- resolveLocaleSettings + applyOverrides moved to client-safe
hydration/locale module (exposed at @xyd-js/framework/hydration/locale)
so the Layout React component can apply per-locale overrides without
pulling server-only @xyd-js/content into the browser bundle.
- layout.tsx loader computes effectiveSettings = resolveLocaleSettings(
settings, locale) and uses it for banner content compilation; the
Layout component re-resolves and passes effectiveSettings to the
Framework provider so useSettings() returns locale-resolved values
(banner.icon, banner.label, components.*) per locale.
- documan dev watcher: new resolveI18nCatalogPaths helper; catalog file
changes (i18n.catalogs[locale] declared paths + i18n/<locale>.json
convention) trigger the standard settings-reload pipeline so editing
a catalog hot-refreshes the page.
- e2e fixtures (8.i18n):
5.catalog-only-navigation/ — verifies top-level navigation.sidebar
inheritance + "i18n: <key>" group title resolution per locale.
6.overrides/ — verifies flat dot-key + nested-object overrides
serialize into the settings bundle for pl/de.
7.catalog-dollar-overrides/ — verifies $-prefixed catalog keys are
extracted into navigation.languages[].overrides at boot.
All three pass (3/3, 4/4, 5/5).
- Unit tests: new i18n.applyOverrides.test.ts adds 17 cases for
applyOverrides, expandDotKeys, and resolveLocaleSettings end-to-end.
36/36 plugin-docs tests passing.
- Docs: apps/docs/guides/internalization.md Per-Locale Overrides
section reworked to use components.banner (renders reliably) instead
of the footer footnote; three tabs cover text-only, multi-field, and
catalog $-key overrides.
- Examples submodule: i18n-overrides, i18n-overrides-flat, and
i18n-catalog-overrides switched to the banner pattern with matching
pl/de translations and updated READMEs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-applies all i18n changes from feat/i18n branch that were inadvertently reverted along with the canary branch revert.
Original PR: #133