Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
How to Automate multilinguial support.
anilgkumar
Hi,
Recently I developed a component with datum Locale. Based on this Locale value I'm fetching resource entries and providing client side validation.
Eg1. If Locale=en, I'll read resource_en.xml and fetch two entries values and convert them as javascript variables for validation.
Eg2. If Locale=fr, then resource_fr.xml
But client suggested to automate this process with out providing any Locale value.
We maintain some structure... for pages
/sites/corporate/en/support/contact.page
/sites/corporate/fr/support/contact.page
/sites/corporate/es/support/contact.page
I tried using //iw-ls-page-name.... to find which page is using our component... but No Luck.
Help me in this regard.
Thanks, Anil
Find more posts tagged with
Comments
anilgkumar
Got It......
Rick Poulin
Care to share your answer with the rest of the class?
http://xkcd.com/979/
For anybody else visiting this thread in the future..
If you're using SitePub localization, you can simply do context.getSite().getLocale(). You could also go direct to context.getLocale(), but that one is dependent on how your locale is being figured out. There's settings in customer-runtime-resource-config.xml for the behaviour of the latter.
If you're using something else, like path-based locales in OP's question, you can use /Properties/Data/External/Datum/
@ls-page-name
(or some such) in XSL, or context.getPage() in Java, to do your matching.