Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

GetBySegment ignores language parameter?

Ted
Ted
Vote:
 

Hi!

I'm doing the following to get a page with a known URL segment in a specific language (Swedish):

var repository = ServiceLocator.Current.GetInstance();

var page = repository.GetBySegment(ContentReference.StartPage, "some-url-segment", new CultureInfo("sv"));

I do get a page back, but I always get the English language version (language fallback isn't enabled).

Any idea on what I'm missing here? :)

#147452
Apr 14, 2016 17:15
Vote:
 

Hi Ted,

I tried your code with Alloy, works w/o any issues.

Episerver 9.8.0, enabled English and Swedish. Replacement and fallback languages are not enabled.

Which version of epi are you using?

#147458
Apr 14, 2016 21:53
Ted
Vote:
 

Thanks for testing it, Dejan! I'll have to dwell deeper into that site to figure out what's causing it. Probably some sort of edge case scenario.

Edit: It appears this only happens when a fallback language is enabled, even though the requested language version is published.

#147485
Edited, Apr 15, 2016 15:24
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.