Login +

Reference Guide / SLS_Lang

SLS_Lang1 is a class for handling internationalization.

Accessibility

At Controller level, you can access it directly by inheritance on SLS_Generic2Controller:

$this->_lang;

At others levels (PHP), you can access it by reference to SLS_Generic2:

$this->_generic->getObjectLang();
// Or if u haven't a reference to SLS_Generic, using the singleton:
SLS_Generic::getInstance()->getObjectLang();

Data recovery

- If you want to retrieve all the languages in your application, you can use getSiteLangs() function:

$this->_lang->getSiteLangs();

- If you want getting the current language, you can use getLang() function:

$this->_lang->getLang();

- If you want the default language, you can use getDefaultLang() function:

$this->_lang->getDefaultLang();

- If you want to make sure that a language is active, you can use isEnabledLang() function:

$this->_lang->isEnabledLang();

Data updates

- If you want to change the current language, use setLang() function:

$this->_lang->setLang($lang);

- If you want to reset the language detection, use the resetLang() function:

$this->_lang->resetLang();

Related :

References

  1. SLS_Lang - Multilanguage Management
  2. SLS_Generic - Generic Class - Used eveywhere in the application