AI OnAI Off
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;
}
}
}