Hi,
We have dictionary under /content/dam for languages say (en-us, es-us) . When we load the page its injected and we have the translated content render on the page. As part of the requirement I have some doubts to clarify.
1) When I load the page, I see multiple calls of /libs/cq/i18n/dict.xxx.json, how can we restrict default dictionary calls?
2) My custom dictionary /libs/cq/i18n/dict.en-US.json has only 5 labels, but in response i see numbers of other labels may be injected via /libs/cq/i18n/dict.en.json
3) Is there way to load /libs/cq/i18n/dict.en-US.json as per site level. Say, I want to load the dictionary on /content/mySiteA/en-US and not on /content/mySiteB/en-US ? keeping in consideration that codebase is same.
Thanks,
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @vdhim23,
i18n dictionaries are retrieved using call to Servlet(com.adobe.granite.i18n.impl.ResourceBundleExportServlet) registered with path /libs/cq/i18n/dict being called via xhr request from JS.
In particular, it is the clientlib with category named granite.utils -> source -> I18n.js which has desired logic.
For your queries:
With above 2 pointers, you will be able to make a call to the servlet/set locale per your need.(for content specific call)
Hi @vdhim23,
i18n dictionaries are retrieved using call to Servlet(com.adobe.granite.i18n.impl.ResourceBundleExportServlet) registered with path /libs/cq/i18n/dict being called via xhr request from JS.
In particular, it is the clientlib with category named granite.utils -> source -> I18n.js which has desired logic.
For your queries:
With above 2 pointers, you will be able to make a call to the servlet/set locale per your need.(for content specific call)
Thanks. But I think this would still not solve the requirement of being able to load site specific i18n JSON. Is there any alternative to writing a custom servlet?
/apps/proj1/i18n/en.json > has 100 keys and messages
/apps/proj2/i18n/en.json > has 100 keys and messages
/apps/proj3/i18n/en.json > has 100 keys and messages
/libs/cq/i18n/dict.en.json loads 300 keys and messages which is not at all required. Any way to fix this?
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies