Backend\Core\Engine\Language::setLocale PHP Method

setLocale() public static method

Set locale It will require the correct file and init the needed vars
public static setLocale ( string $language )
$language string The language to load.
    public static function setLocale($language)
    {
        trigger_error('Backend\\Core\\Engine\\Language is deprecated.
             It has been moved to Backend\\Core\\Language\\Language', E_USER_DEPRECATED);
        parent::setLocale($language);
    }

Usage Example

Beispiel #1
0
 /**
  * Do authentication stuff
  * This method could end the script by throwing an exception
  */
 private function validateLogin()
 {
     // check if the user is logged on, if not he shouldn't load any JS-file
     if (!Authentication::isLoggedIn()) {
         throw new Exception('Not logged in.');
     }
     // set interface language
     Language::setLocale(Authentication::getUser()->getSetting('interface_language'));
 }
All Usage Examples Of Backend\Core\Engine\Language::setLocale