Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
public class TemplatePageMultiLang : TemplatePage
{
private bool isLangValidated = false;
public override PageData CurrentPage
{
get
{
if (!isLangValidated)
{
isLangValidated = true;
PageData p = EPiServer.Global.EPDataFactory.GetPage(
CurrentPageLink,
EPiServer.Security.AccessControlList.NoAccess);
if (!EPiServer.Util.MultiLanguageRuntime.LanguageIsTranslated(
p.Property,
LanguageManager.GetContextLanguage(null)))
{
if (EPiServer.Util.MultiLanguageRuntime.LanguageIsTranslated(
p.Property,
"SV"))
{
HttpContext.Current.Items["epslanguage"] = "SV";
}
else if (EPiServer.Util.MultiLanguageRuntime.LanguageIsTranslated(
p.Property,
"NO"))
{
HttpContext.Current.Items["epslanguage"] = "NO";
}
}
}
return base.CurrentPage;
}
}
}