Try our conversational search powered by Generative AI!

Is Page Using an Fall back lanaguage ...

Vote:
 

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");                
            }

 

 

#57826
Mar 29, 2012 10:52
Vote:
 

ok i think i can use  ContentLanguage.SpecificCulture although would like thoughts on other methods as well 

#57827
Mar 29, 2012 11:00
Vote:
 

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))
{
    
}

    

#57830
Mar 29, 2012 13:45
Vote:
 

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]

#57831
Mar 29, 2012 15:05
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.