Latest articles
Latest articles of category




Language


CMS is a multilingual system and it is necessary to distinguish the content based on language selection.

Admin Language

There is the ability to have different default language for the front and back end of your site.

The variable $adminLang stores the information of the default language for the back end of CMS.

Example PHP code
 
if($adminLang=='en')
{
    // do something for english language
}

Returned Variables
 
en - for English language
el - for Greek language
it - for Italian language

Default Language

Initially we are selecting from the administration menu the default language of the system.

This is in use every time that the user is not selecting a preferable language.

- The variable $default_code holds the information of the code of the default language

Example PHP Code
 

if($default_code=='en')
{
// do something if the default language is english
}

Returned Variables
 
en - Engliish language
el - Greek language
it - Italian language
ru - Russian language ..

- The variable $default_language holds the information of which is the default language

Example PHP Code
 
if($default_language=='English')
{
   // do something if the default language is english
}

Returned Variables
 
English: English language
Greek: Greek language
Italian: Italian language
Russian: Russian language

Selected Language

- When the user selects a language the variable $session_lang stores the information

Example Smarty Code
 
{if $smarty.session.session_lang}

... {/if}

Example PHP Code
 
if($_SESSION['SESSION_LANG'] == 'en')
{
  // do something if the language is English
}

Returned Variables
 
The code of the selected language
en - for English language
el - for Greek language
it - for Italian language..

Posted on: 23/03/2011