Repository navigation
feat(i18n): locale fallback chain and hreflang links - #64
Merged
Merged
Conversation
- `content_blocks_i18n.fallbacks` (opt-in, empty by default): an untranslated field of a locale reads the listed targets before the source, per field, tab titles and localized media included. Chains are not transitive; progress still counts the field as missing. A host can supply the chains through `LocaleFallbacksProviderInterface`, as it does the target locales. - `cb_i18n_hreflang(area)` prints `<link rel="alternate" hreflang>` tags from `LocalizedPageUrlResolverInterface`, absolute, with `x-default` on the source; `cb_i18n_alternates(area)` returns the data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
VitePress parses an inline {{ … }} as a Vue expression, and the named
argument read as a type annotation, which failed the docs build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes the two remaining i18n items of the ROADMAP's "after 1.0" list, other than per-locale publishing from the builder.
Locale fallback chain (opt-in)
fr_CAfield is still missing in the workbench andcontent-blocks:i18n:status.zh-Hant).LocaleFallbacksProviderInterface: a host can supply the chains from a service, the same wayTargetLocalesProviderInterfacesupplies the locales (defaultConfiguredLocaleFallbacksProviderreads the config). What a provider returns is filtered at runtime.hreflang links
{{ cb_i18n_hreflang(page.contentArea) }}<link rel="alternate" hreflang>per language the host'sLocalizedPageUrlResolverInterfacegives a URL for, the current one included.pt_BRbecomespt-BR, andx-defaultpoints at the source (x_default: falseto drop it).nullarea.cb_i18n_alternates(area)returns the same data for custom markup.The sandbox's public page now prints the tags, and its
<html lang>follows the request locale.Docs
The guide gets new "Fallback chain", "Fallbacks from the host" and "hreflang links" sections. The internals doc gets the rationale (
#the-fallback-chain). The BC page adds the two Twig functions and the new interface. The README, CHANGELOG, ROADMAP and CLAUDE.md are updated.Tests
FallbackChainTest,LocaleFallbacksProviderTest,HreflangExtensionTest, plus config and wiring cases.i18n-hreflang.spec.js.🤖 Generated with Claude Code