AI OnAI Off
ok i think i can use ContentLanguage.SpecificCulture although would like thoughts on other methods as well
There is no nice method for this. But you can always check if the page is in the requested language.
string language = Request.QueryString["epslanguage"];
if (!string.IsNullOrEmpty(language) && !language.Equals(CurrentPage.LanguageBranch))
{
}
I used the below which seems to work
[code]
CultureInfo specificCulture = ContentLanguage.SpecificCulture;
if (specificCulture.IetfLanguageTag == "en-sys" && !Page.User.Identity.IsAuthenticated)
{
// redirect to 404
throw new HttpException(404, "Not Found");
}
[code]
Is their anything in the PageData object which can tell me if a page currently beiong viewed is getting its property values from a fallback lanaguage as it has not been created in Current Lanaguage, also if it is using an Fallback what is this fall back.
Reason i ask is because i am making a system language which should not be browsable although all pages are created first in this system lanaguage and than created in their individual language variants. Although if not created it falls back to this system language and my code for not making the system language browsable falls over.
if (CurrentPage.LanguageBranch == "en-sys" && !Page.User.Identity.IsAuthenticated)
{
// redirect to 404
throw new HttpException(404, "Not Found");
}