GetBySegment ignores language parameter?

Member since: 2006


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
  • Dejan Caric
    Member since: 2010

    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
    Member since: 2006

    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