Expand my Community achievements bar.

SOLVED

Experience Fragment on AEM SPA (React) language recognition does not work

Avatar

Level 1

After configuring the pages and Experience Fragment tree, as per the documentation, I noticed that changing language does not start the language change. in the sense that if I am in the English language and I move into the Italian language the footer that is located in Experience Fragment, I always return to the English language.
I did several tests I tried on a project of WIKED sensa spa but native and li the localization of the Experience Fragment works perfectly, things that does not happen in a project with SPA

Schermata 2023-03-15 alle 12.47.27.pngSchermata 2023-03-15 alle 12.48.11.png

1 Accepted Solution

Avatar

Correct answer by
Employee

The way the localized variation path is created is:
1. find the current page language root path: /content/snam/language-master/it
2. replace /content with /content/experience-fragments: /content/experience-fragments/snam/language-master/it
3. append the relative fragment variation path: /site/footer/master/jcr:content: /content/experience-fragments/snam/language-master/it/site/header/master/jcr:content

The fragment content doesn't exist at this location, so it is falling back to the original reference.

View solution in original post

1 Reply

Avatar

Correct answer by
Employee

The way the localized variation path is created is:
1. find the current page language root path: /content/snam/language-master/it
2. replace /content with /content/experience-fragments: /content/experience-fragments/snam/language-master/it
3. append the relative fragment variation path: /site/footer/master/jcr:content: /content/experience-fragments/snam/language-master/it/site/header/master/jcr:content

The fragment content doesn't exist at this location, so it is falling back to the original reference.