src/Common/Controller/Base.php
protected function instantiateLanguages()
    {
        //  Define default language
        $oLanguageService = Factory::service('Language');
        $oDefault         = $oLanguageService->getDefault();

        if (empty($oDefault)) {
            throw new NailsException('No default language has been set, or it\'s been set incorrectly.');
        }

        Functions::define('APP_DEFAULT_LANG_CODE', $oDefault->code);
        Functions::define('APP_DEFAULT_LANG_LABEL', $oDefault->label);

        // --------------------------------------------------------------------------

        /**
         * Set any global preferences for this user, e.g languages, fall back to the
         * app's default language (defined in config.php).
         */

        $sUserLangCode = activeUser('language');

        if (!empty($sUserLangCode)) {
            Functions::define('RENDER_LANG_CODE', $sUserLangCode);
        } else {
            Functions::define('RENDER_LANG_CODE', APP_DEFAULT_LANG_CODE);
        }

        //  Set the language config item which CodeIgniter will use.
        $oConfig = Factory::service('Config');
        $oConfig->set_item('language', RENDER_LANG_CODE);

        //  Load the Nails. generic lang file
        $this->lang->load('nails');
    }
protected function instantiateLanguages()
    {
        //  Define default language
        $oLanguageService = Factory::service('Language');
        $oDefault         = $oLanguageService->getDefault();

        if (empty($oDefault)) {
            throw new NailsException('No default language has been set, or it\'s been set incorrectly.');
        }

        Functions::define('APP_DEFAULT_LANG_CODE', $oDefault->code);
        Functions::define('APP_DEFAULT_LANG_LABEL', $oDefault->label);

        // --------------------------------------------------------------------------

        /**
         * Set any global preferences for this user, e.g languages, fall back to the
         * app's default language (defined in config.php).
         */

        $sUserLangCode = activeUser('language');

        if (!empty($sUserLangCode)) {
            Functions::define('RENDER_LANG_CODE', $sUserLangCode);
        } else {
            Functions::define('RENDER_LANG_CODE', APP_DEFAULT_LANG_CODE);
        }

        //  Set the language config item which CodeIgniter will use.
        $oConfig = Factory::service('Config');
        $oConfig->set_item('language', RENDER_LANG_CODE);

        //  Load the Nails. generic lang file
        $this->lang->load('nails');
    }
protected function instantiateLanguages ( ) { //  Define default language $ oLanguageService = Factory :: service ( 'Language' ) ; $ oDefault = $ oLanguageService -> getDefault ( ) ; if ( empty ( $ oDefault ) ) { throw new NailsException ( 'No default language has been set, or it\'s been set incorrectly.' ) ; } Functions :: define ( 'APP_DEFAULT_LANG_CODE' , $ oDefault -> code ) ; Functions :: define ( 'APP_DEFAULT_LANG_LABEL' , $ oDefault -> label ) ; // -------------------------------------------------------------------------- /**
         * Set any global preferences for this user, e.g languages, fall back to the
         * app's default language (defined in config.php).
         */ $ sUserLangCode = activeUser ( 'language' ) ; if ( ! empty ( $ sUserLangCode ) ) { Functions :: define ( 'RENDER_LANG_CODE' , $ sUserLangCode ) ; } else { Functions :: define ( 'RENDER_LANG_CODE' , APP_DEFAULT_LANG_CODE ) ; } //  Set the language config item which CodeIgniter will use. $ oConfig = Factory :: service ( 'Config' ) ; $ oConfig -> set_item ( 'language' , RENDER_LANG_CODE ) ; //  Load the Nails. generic lang file $ this -> lang -> load ( 'nails' ) ; }
Sets up language handling

@return void
Sets up language handling