How to configure Experience Fragments for multi language sites? | Community
Skip to main content
surenk
Level 4
November 4, 2022
Solved

How to configure Experience Fragments for multi language sites?

  • November 4, 2022
  • 2 replies
  • 1521 views

How can we make a particular language copy of the main site refers/use the respective Experience Fragments in a similar language/folder structure? Docs here https://experienceleague.adobe.com/docs/experience-manager-core-components/using/get-started/localization.html?lang=en#example states they are picked automatically if the structure is similar. But we are having issues - the language copy of the website also shows XF's from main /us/en instead of XF's language-copy.

How can we solve this?

 

Setup: 

We have the main site as:

my-site.com <-- /content/my-site/us/en/ <--- and Experience Fragments (Header & Footer) /content/experience-fragments/my-site/us/en/site/header

 

Created a language copy as:

my-site.com/nl <-- /content/my-site/nl/nl/ <--- and Experience Fragments (Header & Footer) /content/experience-fragments/my-site/nl/nl/site/header

 

Added rewrites in Dispatcher as 

... # rewrite for root redirect RewriteRule ^/?$ /content/${CONTENT_FOLDER_NAME}/us/en/home.html [PT,L] # rewrite for Dutch - nl RewriteRule ^/nl?$ /content/${CONTENT_FOLDER_NAME}/nl/nl/home.html [PT,L] ... RewriteCond %{REQUEST_URI} !^/nl .. RewriteRule ^/nl(.*)$ /content/${CONTENT_FOLDER_NAME}/nl/nl/$1 [PT,L]

 

But the language copy my-site.com/nl also shows the Experience Fragments from /content/experience-fragments/my-site/us/en/ instead of /content/experience-fragments/my-site/nl/nl 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

Him

Use core experience component instead of foundation XF component to achieve localisation with XF, 

https://experienceleague.adobe.com/docs/experience-manager-core-components/using/components/experience-fragment.html?lang=en#localized-site-structure 

2 replies

Mani_kumar_
Community Advisor
Community Advisor
November 4, 2022

Did you write any custom rollout for having the locale URLs for component level

If not make sure those rollout are available so that all the configured URL will map to respective experience fragments

 

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
November 5, 2022

Him

Use core experience component instead of foundation XF component to achieve localisation with XF, 

https://experienceleague.adobe.com/docs/experience-manager-core-components/using/components/experience-fragment.html?lang=en#localized-site-structure 

Arun Patidar
surenk
surenkAuthor
Level 4
November 10, 2022

Thanks @arunpatidar 

We are using Core Components XF. And that should have picked the correct ones.

 

The issue for us is that we were using custom site properties to pick the Header, Footer and other XF's. Now it is resolved for us.