[Mapbender-commits] r3591 - branches/2.5/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Feb 25 04:57:18 EST 2009


Author: christoph
Date: 2009-02-25 04:57:18 -0500 (Wed, 25 Feb 2009)
New Revision: 3591

Modified:
   branches/2.5/http/classes/class_locale.php
Log:
proper formatting

Modified: branches/2.5/http/classes/class_locale.php
===================================================================
--- branches/2.5/http/classes/class_locale.php	2009-02-25 09:23:59 UTC (rev 3590)
+++ branches/2.5/http/classes/class_locale.php	2009-02-25 09:57:18 UTC (rev 3591)
@@ -37,12 +37,12 @@
 
 	function Mb_locale($languageId) {
 		if (!$languageId) {
-		        $languageId = LANGUAGE;
+			$languageId = LANGUAGE;
 		}
 		$e = new Mb_notice("class_locale: setting locale to " . $languageId);
 		if (USE_I18N) {
 			if (!$this->setCurrentLocale($languageId)) {
-	    	    $e = new Mb_exception("Locale could not be set. Language ID: '" . $languageId . "'");
+				$e = new Mb_exception("Locale could not be set. Language ID: '" . $languageId . "'");
 			}
 		}
 		else {
@@ -51,12 +51,12 @@
 	}
 
     /**
-     * Get the current locale, evaluating GET/POST variables, browser languages
+	 * Get the current locale, evaluating GET/POST variables, browser languages
      * and a default locale (in that preference)
-     *
-     * @returns current locale
-     */
-    function setCurrentLocale($languageId) {
+	 *
+	 * @returns current locale
+	 */
+	function setCurrentLocale($languageId) {
 
 		// try to set the locale to $languageId
 		if ($this->checkAndSetLocale($languageId)) {
@@ -65,28 +65,28 @@
 		else {
 			$e = new Mb_notice("class_locale: no input parameter specified.");
 		}
-		
+
 		// determine the browser setting and try to set locale according to that
 		if ($this->browserLanguage == null) {
-	        $this->setBrowserLanguages();
+			$this->setBrowserLanguages();
 		}
 		foreach ($this->browserLanguages as $lang) {
-	        $e = new Mb_notice("trying browser setting " . $lang);
-	        if ($this->checkAndSetLocale($lang)) {
-                return true;
-	        }
+			$e = new Mb_notice("trying browser setting " . $lang);
+			if ($this->checkAndSetLocale($lang)) {
+				return true;
+			}
 		}
-		
+
 		// set to default language
 		$e = new Mb_notice("trying default language " . $this->defaultLanguage);
 		return $this->checkAndSetLocale($this->defaultLanguage);
 	}
 
 	/**
-	* checks if a locale is available; if yes, it is set via setlocale
-	*
-	* @returns true if the the locale is set successfully; otherwise false
-	*/
+	 * checks if a locale is available; if yes, it is set via setlocale
+	 *
+	 * @returns true if the the locale is set successfully; otherwise false
+	 */
 	function checkAndSetLocale($languageId) {
 		if ($this->os == null) {
 			$this->os = $this->guessHostOS();
@@ -168,43 +168,54 @@
          * determines the available Locales on this system
          */
         function setSystemLocales() {
-                $this->systemLocales['pt_PT'] = array('linux' => 'pt_PT.utf8',
-                                        'windows' => 'Portuguese_Portugal.1252',
-                                        'bsd' => 'pt_PT',
-                                        'posix' => 'pt_PT');
-                $this->systemLocales['fr_FR'] = array('linux' => 'fr_FR.utf8',
-                                        'windows' => 'French_France.1252',
-                                        'bsd' => 'fr_FR',
-                                        'posix' => 'fr_FR');
-                $this->systemLocales['es_ES'] = array('linux' => 'es_ES.utf8',
-                                        'windows' => 'Spanish_Spain.1252',
-                                        'bsd' => 'es_ES',
-                                        'posix' => 'es_ES');
-                $this->systemLocales['it_IT'] = array(
-										'linux' => 'it_IT.utf8',
-                                        'windows' => 'Italian_Italy.1252',
-                                        'bsd' => 'it_IT',
-                                        'posix' => 'it_IT');
-                $this->systemLocales['de_DE'] = array(
-										'linux' => 'de_DE.utf8',
-                                        'windows' => 'German_Germany.1252',
-                                        'bsd' => 'de_DE',
-                                        'posix' => 'de_DE');
-                $this->systemLocales['en_US'] = array(
-										'linux' => 'en_US.utf8',
-                                        'windows' => 'English_United States.1252',
-                                        'bsd' => 'en_US',
-                                        'posix' => 'en_US');
-                $this->systemLocales['bg_BG'] = array(
-										'linux' => 'bg_BG.utf8',
-                                        'windows' => 'Bulgarian_Bulgaria.1251',
-                                        'bsd' => 'bg_BG',
-                                        'posix' => 'bg_BG');
-                $this->systemLocales['el_GR'] = array(
-										'linux' => 'el_GR.utf8',
-                                        'windows' => 'Greek_Greece.1253',
-                                        'bsd' => 'el_GR',
-                                        'posix' => 'el_GR');
+			$this->systemLocales['pt_PT'] = array(
+				'linux' => 'pt_PT.utf8',
+				'windows' => 'Portuguese_Portugal.1252',
+				'bsd' => 'pt_PT',
+				'posix' => 'pt_PT'
+			);
+			$this->systemLocales['fr_FR'] = array(
+				'linux' => 'fr_FR.utf8',
+				'windows' => 'French_France.1252',
+				'bsd' => 'fr_FR',
+				'posix' => 'fr_FR'
+			);
+			$this->systemLocales['es_ES'] = array(
+				'linux' => 'es_ES.utf8',
+				'windows' => 'Spanish_Spain.1252',
+				'bsd' => 'es_ES',
+				'posix' => 'es_ES'
+			);
+			$this->systemLocales['it_IT'] = array(
+				'linux' => 'it_IT.utf8',
+				'windows' => 'Italian_Italy.1252',
+				'bsd' => 'it_IT',
+				'posix' => 'it_IT'
+			);
+			$this->systemLocales['de_DE'] = array(
+				'linux' => 'de_DE.utf8',
+				'windows' => 'German_Germany.1252',
+				'bsd' => 'de_DE',
+				'posix' => 'de_DE'
+			);
+			$this->systemLocales['en_US'] = array(
+				'linux' => 'en_US.utf8',
+				'windows' => 'English_United States.1252',
+				'bsd' => 'en_US',
+				'posix' => 'en_US'
+			);
+			$this->systemLocales['bg_BG'] = array(
+				'linux' => 'bg_BG.utf8',
+				'windows' => 'Bulgarian_Bulgaria.1251',
+				'bsd' => 'bg_BG',
+				'posix' => 'bg_BG'
+			);
+			$this->systemLocales['el_GR'] = array(
+				'linux' => 'el_GR.utf8',
+				'windows' => 'Greek_Greece.1253',
+				'bsd' => 'el_GR',
+				'posix' => 'el_GR'
+			);
         }
 
         /**



More information about the Mapbender_commits mailing list