Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi
I wanted to get the language selected for a particular url by user. For example I have set 4 urls for a page
Hi Manish,
It's prety easy issue with DomainService.
var domain = ApplicationContext.Services.DomainService.GetByName("xyz.net"); var culture = domain.LanguageIsoCode;
Cheers,
Alex
Thanks Alex
You are welcome !
I think you can also do this on your IPublishedContent object
@content.GetCulture()
Dave
Thanks Dave
var culture = Domain.GetDomainsById(NodeId)[0].Language.CultureAlias;
How i approach this
I think the difference is that your approach uses a call to the database to find the culture. The other one is stored on the current request so no database calls which is better for performance.
Well my scenario was bit different i wanted to get culture for all nodes so i looped through the code above.
and if you need culture for current page you can also use this one
var culture = Culture;
Manish
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
How to get language for a particular domain
Hi
I wanted to get the language selected for a particular url by user. For example I have set 4 urls for a page
Hi Manish,
It's prety easy issue with DomainService.
Cheers,
Alex
Thanks Alex
You are welcome !
I think you can also do this on your IPublishedContent object
Dave
Thanks Dave
How i approach this
I think the difference is that your approach uses a call to the database to find the culture. The other one is stored on the current request so no database calls which is better for performance.
Dave
Well my scenario was bit different i wanted to get culture for all nodes so i looped through the code above.
and if you need culture for current page you can also use this one
Manish
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.