Join us this Friday for AI in Action at the Virtual Happy Hour! This free virtual event is open to all—enroll now on Academy and don’t miss out.

 

How see if a page is displayed in its fallback language?

Vote:
 

Hi,

I've searched but cannot find how to check whether a page is displayed in its language or its fallback language (programmatically).

I had a look at ContentLanguageSettingsHandler with no luck.

Any help is welcome.

Regards,

Matthieu

#143223
Jan 15, 2016 18:52
Vote:
 

Hi,

Maybe you could compare current content model language with preferred culture?

            if (EPiServer.Globalization.ContentLanguage.PreferredCulture.Name != this.CurrentPage.Language.Name)
            {
                
            }

The CurrentPage should have your fallback language assigned while PreferredCulture should use assigned language

#143226
Jan 15, 2016 21:58
Vote:
 

Hi,

Thanks for your answer, that's the kind of solution I was looking for but I didn't know the PreferredCulture would contain the expected language.

I'll have a go at this and let you know if it did it.

Regards,

Matthieu

#143258
Jan 18, 2016 17:53
Vote:
 

Hi,

It's working, thanks :)

Matthieu

#143292
Jan 19, 2016 15:40
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* 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.