Language check

Permalink 1 user found helpful
Hi

I have a shared include file in my templates for the header area and want to do some if else statement to check what language the site is currently in (using the internationlization module) and then display the right stack with the right main nav on, can any advise if there is a method to getLanguage to do the checking?

designportfolio
 
shad0w replied on at Permalink Reply
Hi,

you can check the language like this:

//load the Language Helper
$lh = Loader::helper('section', 'multilingual');
//Check for Languages
if($lh->getLanguage() == "de_DE")
{
 //Do this when German       
}
else if($lh->getLanguage() == "da_DK")
{
//do this when Danish
}


You can echo out getLanguage() to see your different language codes.
Hope this helps.