Jump to content

Get the iso-code of the current language


Recommended Posts

Sorry I have not explained well

 

With the following code I get the id of the current language

 

global $cookie;$id_lang = $cookie->id_lang;

 

 

but I need the iso-code that is assigned to that id

 

Is there any function or global variable for it?

 

Thanks Herland

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

Hi,

 

no query to the database is needed. Try this:

 


global $cookie;
$iso_code = Language::getgetIsoById( (int)$cookie->id_lang );
I think it will work as you wish ;)

 

Did you mean 

global $cookie;
$iso_code = Language::getIsoById( (int)$cookie->id_lang );

with only one get ? ;) 

  • Like 1
Link to comment
Share on other sites

  • 2 years later...
×
×
  • Create New...