public static function set($code, $checkStatus = true)
    {
        if (!$code || $code == self::get()) {
            return;
        }

        // Language file available
        if ($code !== 'en' && (self::isLanguageEnabled($code) || $checkStatus === false)) {
            // Store desired language code
            self::$_lang = $code;

            // Clear dictionary
            self::$_dictionary = array();

            // Load core translations
            self::load(vsprintf('%s/lang_%s/lang/lang.%s.php', array(
                EXTENSIONS, self::$_languages[$code]['handle'], $code
            )));

            // Load extension translations
            if (is_array(self::$_languages[$code]['extensions'])) {
                foreach (self::$_languages[$code]['extensions'] as $extension) {
                    self::load(vsprintf('%s/%s/lang/lang.%s.php', array(
                        EXTENSIONS, $extension, $code
                    )));
                }
            }

            // Language file unavailable, use default language
        } else {
            self::$_lang = 'en';

            // Log error, if possible
            if ($code !== 'en' && class_exists('Symphony', false) && Symphony::Log() instanceof Log) {
                Symphony::Log()->pushToLog(
                    __('The selected language, %s, could not be found. Using default English dictionary instead.', array($code)),
                    E_ERROR,
                    true
                );
            }
        }
    }
public static function set($code, $checkStatus = true)
    {
        if (!$code || $code == self::get()) {
            return;
        }

        // Language file available
        if ($code !== 'en' && (self::isLanguageEnabled($code) || $checkStatus === false)) {
            // Store desired language code
            self::$_lang = $code;

            // Clear dictionary
            self::$_dictionary = array();

            // Load core translations
            self::load(vsprintf('%s/lang_%s/lang/lang.%s.php', array(
                EXTENSIONS, self::$_languages[$code]['handle'], $code
            )));

            // Load extension translations
            if (is_array(self::$_languages[$code]['extensions'])) {
                foreach (self::$_languages[$code]['extensions'] as $extension) {
                    self::load(vsprintf('%s/%s/lang/lang.%s.php', array(
                        EXTENSIONS, $extension, $code
                    )));
                }
            }

            // Language file unavailable, use default language
        } else {
            self::$_lang = 'en';

            // Log error, if possible
            if ($code !== 'en' && class_exists('Symphony', false) && Symphony::Log() instanceof Log) {
                Symphony::Log()->pushToLog(
                    __('The selected language, %s, could not be found. Using default English dictionary instead.', array($code)),
                    E_ERROR,
                    true
                );
            }
        }
    }
public static function set ( $ code , $ checkStatus = true ) { if ( ! $ code || $ code == self :: get ( ) ) { return ; } // Language file available if ( $ code !== 'en' && ( self :: isLanguageEnabled ( $ code ) || $ checkStatus === false ) ) { // Store desired language code self :: $ _lang = $ code ; // Clear dictionary self :: $ _dictionary = array ( ) ; // Load core translations self :: load ( vsprintf ( '%s/lang_%s/lang/lang.%s.php' , array ( EXTENSIONS , self :: $ _languages [ $ code ] [ 'handle' ] , $ code ) ) ) ; // Load extension translations if ( is_array ( self :: $ _languages [ $ code ] [ 'extensions' ] ) ) { foreach ( self :: $ _languages [ $ code ] [ 'extensions' ] as $ extension ) { self :: load ( vsprintf ( '%s/%s/lang/lang.%s.php' , array ( EXTENSIONS , $ extension , $ code ) ) ) ; } } // Language file unavailable, use default language } else { self :: $ _lang = 'en' ; // Log error, if possible if ( $ code !== 'en' && class_exists ( 'Symphony' , false ) && Symphony :: Log ( ) instanceof Log ) { Symphony :: Log ( ) -> pushToLog ( __ ( 'The selected language, %s, could not be found. Using default English dictionary instead.' , array ( $ code ) ) , E_ERROR , true ) ; } } }
Set system language, load translations for core and extensions. If the specified language
cannot be found, Symphony will default to English.

Note: Beginning with Symphony 2.2 translations bundled with extensions will only be loaded
when the core dictionary of the specific language is available.

@param string $code
Language code, e. g. 'en' or 'pt-br'
@param boolean $checkStatus (optional)
If false, set the language even if it's not enabled. Defaults to true.
Set system language load translations for core and extensions . If the specified language cannot be found Symphony will default to English .