Skip to content

Commit

Permalink
Making DEFAULT_LANGUAGE also set $language var which sets Config.lang…
Browse files Browse the repository at this point in the history
…uage to a correct value. Fixes #228
  • Loading branch information
markstory committed Jan 20, 2010
1 parent 96fd0bf commit ae4a31f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cake/libs/l10n.php
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ function __setLanguage($language = null) {
} else if ($language !== null && isset($this->__l10nCatalog[$language])) {
$langKey = $language;
} else if (defined('DEFAULT_LANGUAGE')) {
$langKey = DEFAULT_LANGUAGE;
$langKey = $language = DEFAULT_LANGUAGE;
}

if ($langKey !== null && isset($this->__l10nCatalog[$langKey])) {
Expand Down
5 changes: 5 additions & 0 deletions cake/tests/cases/libs/l10n.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ function testGet() {
$expected = 'en_us';
$this->assertEqual($result, $expected);

$l10n->get('es');
$l10n->get('');
$this->assertEqual($l10n->lang, 'en-us');


// Using $this->default
$l10n = new L10n();
$l10n->get('use_default');
Expand Down

0 comments on commit ae4a31f

Please sign in to comment.