/** * Run this before every call * * @return void * @access public */ public function before() { // Profile the loader \Profiler::mark('Start of loader\'s before() function'); \Profiler::mark_memory($this, 'Start of loader\'s before() function'); // Set the environment parent::before(); // Load the config for Segment so we can process analytics data. \Config::load('segment', true); // Load the config file for event names. Having events names in one place keeps things synchronized. \Config::load('analyticsstrings', true); // Engine configuration \Config::load('engine', true); // Load the package configuration file. \Config::load('tiers', true); // Soccket connection configuration \Config::load('socket', true); /** * Ensure that all user language strings are appropriately translated. * * @link https://github.com/fuel/core/issues/1860#issuecomment-92022320 */ if (is_string(\Input::post('language', false))) { \Environment::set_language(\Input::post('language', 'en')); } // Load the error strings. \Lang::load('errors', true); }
public function test_set_language() { // Set the default to English \Config::set('language', 'en'); // Set it to eSpanish :) \Environment::set_language('es'); $this->assertSame('es', \Config::get('language', false)); // The next line of code shouldn't do anything to the value. \Environment::set_language(); $this->assertSame('es', \Config::get('language', false)); }
<?php // Bootstrap the framework DO NOT edit this require COREPATH . 'bootstrap.php'; Autoloader::add_classes(array('Presenter' => APPPATH . 'classes/presenter.php', 'Controller' => APPPATH . 'classes/controller.php', 'Log' => APPPATH . 'classes/log.php', 'HttpNotFoundException' => APPPATH . 'classes/httpexceptions.php', 'HttpServerErrorException' => APPPATH . 'classes/httpexceptions.php', 'HttpBadRequestException' => APPPATH . 'classes/httpexceptions.php')); // Register the autoloader Autoloader::register(); /** * Your environment. Can be set to any of the following: * * Fuel::DEVELOPMENT * Fuel::TEST * Fuel::STAGING * Fuel::PRODUCTION */ Fuel::$env = isset($_SERVER['FUEL_ENV']) ? $_SERVER['FUEL_ENV'] : 'private'; // Initialize the framework with the config file. Fuel::init('config.php'); // Make the debugger show all tree items expanded and up to the specified recursion level. Debug::$js_toggle_open = true; Debug::$max_nesting_level = 10; // Default is 5 // Set the timezone to the default display timezone. Customers may change this later. \Date::display_timezone('America/New_York'); // Rotate the session. \Session::rotate(); // Unique user ID for the current page load (Used by \Monolog\Processor\BitAPIHubProcessor) \Utility::unique_user(); // Set the language \Environment::set_language();