How to configure Experience Fragments for multi language sites?
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