public function setLocale(Locale $newLocale) {
		
		// apply some changes only if new Locale really differs
		if (!$this->currentLocale or ($this->currentLocale and $newLocale->id != $this->currentLocale->id)) {
			
			$this->currentLocale = $newLocale;
				
			// if new language code equals the default one, move lang-strings
			if ($this->defaultLocale and $newLocale->id == $this->defaultLocale->id) {

				$this->strings = $this->defaultStrings;
				$this->defaultStrings = NULL;
				
			// otherwise reload current strings
			} else {
			
				$this->strings = NULL;
				$this->loadStrings();
				
			}
			
		}
		
		// set current locale to all categories
		setlocale(LC_ALL, str_replace('-', '_', $newLocale->getRepresentation()) . '.UTF-8');
		
	}
public function setLocale(Locale $newLocale) {
		
		// apply some changes only if new Locale really differs
		if (!$this->currentLocale or ($this->currentLocale and $newLocale->id != $this->currentLocale->id)) {
			
			$this->currentLocale = $newLocale;
				
			// if new language code equals the default one, move lang-strings
			if ($this->defaultLocale and $newLocale->id == $this->defaultLocale->id) {

				$this->strings = $this->defaultStrings;
				$this->defaultStrings = NULL;
				
			// otherwise reload current strings
			} else {
			
				$this->strings = NULL;
				$this->loadStrings();
				
			}
			
		}
		
		// set current locale to all categories
		setlocale(LC_ALL, str_replace('-', '_', $newLocale->getRepresentation()) . '.UTF-8');
		
	}
public function setLocale ( Locale $ newLocale ) { // apply some changes only if new Locale really differs if ( ! $ this -> currentLocale or ( $ this -> currentLocale and $ newLocale -> id != $ this -> currentLocale -> id ) ) { $ this -> currentLocale = $ newLocale ; // if new language code equals the default one, move lang-strings if ( $ this -> defaultLocale and $ newLocale -> id == $ this -> defaultLocale -> id ) { $ this -> strings = $ this -> defaultStrings ; $ this -> defaultStrings = NULL ; // otherwise reload current strings } else { $ this -> strings = NULL ; $ this -> loadStrings ( ) ; } } // set current locale to all categories setlocale ( LC_ALL , str_replace ( '-' , '_' , $ newLocale -> getRepresentation ( ) ) . '.UTF-8' ) ; }
Set a new current locale by preparing its language strings.

@param	Locale	Locale object to set.
Set a new current locale by preparing its language strings .