Getting all cultures of umbraco site
# help-with-umbraco
m
Hi friends so ive created a service that will essentially return all urls of the site upon request via api (i noticed you cant just get all page routes via delivery api) the issue is we will be going multi lingual, therefore i need to also return all of the routes for pages which are under a different culture. so i am able to do this manually by hard setting the culture (this is test code) _variationContextAccessor.VariationContext = new VariationContext("fr"); routes = _publishedContentQuery.Content(ids).Select(item => item.Url()).ToList(); but what i want to do is possibly get ahold of all available cultures in the cms then i can do this dynamically? unless someone has a better way of returning every node url including all cultures my code essentially - gets all ids of content from external index - gets all published content using a list of guids obtained from the index - returns all page routes in a list which is returned to caller
a
Just out of my head, can't you use the domainservice to get the configured domains with their languages ?
m
not sure, never used the domain service! will need to look into some examples!
j
You can use
_localizationService.GetAllLanguages()
, which uses
ILocalizationService
in
Umbraco.Cms.Core.Services;
83 Views