Skip to content
This repository
Browse code

Making DEFAULT_LANGUAGE also set $language var which sets Config.lang…

…uage to a correct value. Fixes #228
  • Loading branch information...
commit ae4a31f0700deed0af993c8d2b05a305195f1eab 1 parent 96fd0bf
Mark Story authored January 20, 2010
2  cake/libs/l10n.php
@@ -352,7 +352,7 @@ function __setLanguage($language = null) {
352 352
 		} else if ($language !== null && isset($this->__l10nCatalog[$language])) {
353 353
 			$langKey = $language;
354 354
 		} else if (defined('DEFAULT_LANGUAGE')) {
355  
-			$langKey = DEFAULT_LANGUAGE;
  355
+			$langKey = $language = DEFAULT_LANGUAGE;
356 356
 		}
357 357
 
358 358
 		if ($langKey !== null && isset($this->__l10nCatalog[$langKey])) {
5  cake/tests/cases/libs/l10n.test.php
@@ -99,6 +99,11 @@ function testGet() {
99 99
 		$expected = 'en_us';
100 100
 		$this->assertEqual($result, $expected);
101 101
 
  102
+		$l10n->get('es');
  103
+		$l10n->get('');
  104
+		$this->assertEqual($l10n->lang, 'en-us');
  105
+
  106
+
102 107
 		// Using $this->default
103 108
 		$l10n = new L10n();
104 109
 		$l10n->get('use_default');

0 notes on commit ae4a31f

Please sign in to comment.
Something went wrong with that request. Please try again.