Browse Source

Merge pull request #7896 from cakephp/issue-7895

Preserve language case.
José Lorenzo Rodríguez 10 years ago
parent
commit
eba7993ac6
2 changed files with 4 additions and 6 deletions
  1. 1 3
      src/Shell/I18nShell.php
  2. 3 3
      tests/TestCase/Shell/I18nShellTest.php

+ 1 - 3
src/Shell/I18nShell.php

@@ -1,7 +1,5 @@
 <?php
 /**
- * Internationalization Management Shell
- *
  * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  *
@@ -79,7 +77,7 @@ class I18nShell extends Shell
     public function init($language = null)
     {
         if (!$language) {
-            $language = strtolower($this->in('Please specify language code, e.g. `en`, `eng`, `en_US` etc.'));
+            $language = $this->in('Please specify language code, e.g. `en`, `eng`, `en_US` etc.');
         }
         if (strlen($language) < 2) {
             return $this->error('Invalid language code. Valid is `en`, `eng`, `en_US` etc.');

+ 3 - 3
tests/TestCase/Shell/I18nShellTest.php

@@ -48,7 +48,7 @@ class I18nShellTest extends TestCase
     {
         parent::tearDown();
 
-        $deDir = $this->localeDir . 'de' . DS;
+        $deDir = $this->localeDir . 'de_DE' . DS;
 
         unlink($this->localeDir . 'default.pot');
         unlink($this->localeDir . 'cake.pot');
@@ -64,7 +64,7 @@ class I18nShellTest extends TestCase
      */
     public function testInit()
     {
-        $deDir = $this->localeDir . 'de' . DS;
+        $deDir = $this->localeDir . 'de_DE' . DS;
         if (!is_dir($deDir)) {
             mkdir($deDir, 0770, true);
         }
@@ -79,7 +79,7 @@ class I18nShellTest extends TestCase
 
         $this->shell->io()->expects($this->at(0))
             ->method('ask')
-            ->will($this->returnValue('de'));
+            ->will($this->returnValue('de_DE'));
         $this->shell->io()->expects($this->at(1))
             ->method('ask')
             ->will($this->returnValue($this->localeDir));