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
I am using Vorto to create a multi-language website. The home node has a number of domains and languages assigned using "Culture and Hostnames" - e.g.
How can I get a list of the languages using C# ?
Hi Gordon
You should be able to get the added languages in backoffice using LocalizationService.
LocalizationService
IEnumerable<ILanguage> languages = ApplicationContext.Current.Services.LocalizationService.GetAllLanguages();
To get the languages/cultures for the assigned hostnames, I think you should use DomainService, where
DomainService
int contentId = 1234; IDomainService domainService = ApplicationContext.Current.Services.DomainService; IEnumerable<IDomain> domains = domainService.GetAssignedDomains(contentId, true);
You can read more about the services in the documentation here https://our.umbraco.org/apidocs/csharp/
/Bjarne
Thanks Bjarne, that worked :-)
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
Get list of Languages for a node
I am using Vorto to create a multi-language website. The home node has a number of domains and languages assigned using "Culture and Hostnames" - e.g.
How can I get a list of the languages using C# ?
Hi Gordon
You should be able to get the added languages in backoffice using
LocalizationService
.To get the languages/cultures for the assigned hostnames, I think you should use
DomainService
, whereYou can read more about the services in the documentation here https://our.umbraco.org/apidocs/csharp/
/Bjarne
Thanks Bjarne, that worked :-)
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.