I’m using Babel in our multilingual site and everything is running smoothly with seven languages. URL structure: subdomain e.g. www.*****.com/en/.
I encountered a problem, when i need to create site for India region with english language also. We already have english as a default language in web-context.
I tried create new Indian context with following settings.
base_url → in
cultureKey → en
That didn’t work, I guess i can’t use ‘en’ as an cultureKey since it’s already use in web-context. And base_url and cultureKey should be same in Context?
Is there a way to create with Babel two different context with same language?
Hi, Thanks.
The main problem is to use same cultureKey (en) in two context? How to define language (cultureKey) in Indian context, if en is already in use in web-context? So basically i need multi-regional pages instead of multi-lingual. Maybe it’s not possible with babel?
The same cultureKey shouldn’t be a problem for babel. You can set up context groups in babel’s babel.contextKeys setting by putting a semi-colon between e.g.:
Keep in mind that Babel pretty much only handles the linking between resources on different contexts. As for loading the page, it’s up to your router plugin e.g. XRouting as Jako mentioned above - make sure each base_url is unique.
It appears to also require you to use language-specific Apache/NGINX rewrites (whereas XRouting doesn’t need that)
In terms of the context groups, yeah I think it’s typically meant for having different locations/sites with multiple languages in each. So perhaps that’s not quite your use case…
Can you try using a different cultureKey for the second English language context? e.g. in-en or something along those lines? You’d need to update your rewrite rules to accommodate that too.