x-schema-name
demo-slides
title
fragment-localization
topbarTitle
Fragment Localization
topbarSubtitle
AEM Edge Delivery Services
slides
- self://#slides-ov1x2a
- self://#slides-bk3n7p
- self://#slides-wp5m4q
- self://#slides-hz8r6t
eyebrowLabel
Overview
slideTitle
What is Fragment Localization?
leadParagraph
Serve locale-specific shared content — headers, footers, callouts — with automatic fallback so pages always render. Authors work in familiar document structure; no code changes required.
bulletPoints
- Fragments are reusable content blocks shared across multiple pages
- Each locale can override any fragment without affecting other locales
- Automatic fallback: if a localized fragment doesn't exist, the default loads
- The HTML `lang` attribute updates automatically with the detected locale
eyebrowLabel
Under the Hood
slideTitle
Locale-Aware Fragment Loading
leadParagraph
The fragment block detects the current URL locale prefix and fetches the localized version first. On failure it transparently falls back to the root fragment — no blank content, no errors.
bulletPoints
- Locale config maps URL prefixes (`/de`, `/fr`, `/es`, `/ja`) to language codes
- On `/de/about-us`, a link to `/fragments/nav` loads `/de/fragments/nav` first
- If `/de/fragments/nav` returns 404, `/fragments/nav` is used as the fallback
- Media base paths are correctly resolved for the actual path that loaded
eyebrowLabel
Authoring
slideTitle
Organizing Localized Fragments
leadParagraph
Mirror the fragment folder structure under each locale prefix. Only create overrides where content must differ — everything else inherits the root default automatically.
bulletPoints
- `/fragments/nav` → global default navigation (always required)
- `/de/fragments/nav` → German-specific nav (only when it differs)
- `/fr/fragments/promo` → French-only promotional banner
- Authors work in documents — no code or config changes needed per locale
eyebrowLabel
See It Live
slideTitle
Locale Switching Demo
leadParagraph
Open the site on each locale path to watch fragment content switch automatically. The page lang attribute, navigation, and any overridden fragments all respond to the URL.
bulletPoints
- English (root): / — loads `/fragments/*` as authored
- German: `/de/` — loads `/de/fragments/*` with fallback to `/fragments/*`
- French: `/fr/` and Spanish: `/es/` — same pattern
openInBrowser
- self://#openinbrowser-le2q9s
- self://#openinbrowser-nm4w1d
- self://#openinbrowser-rv7j5k
buttonText
English (root)
url
/
buttonText
German /de/
url
/de/
buttonText
French /fr/
url
/fr/