Skip to content
Permalink
Browse files

Preserve language case.

Initializing a new language should perserve the case of the input value.

Refs #7895
  • Loading branch information...
markstory committed Dec 23, 2015
1 parent 83fe3f5 commit e8734f2828a73859532059d2f1002fb068297640
Showing with 4 additions and 6 deletions.
  1. +1 −3 src/Shell/I18nShell.php
  2. +3 −3 tests/TestCase/Shell/I18nShellTest.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 @@ public function main()
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.');
@@ -48,7 +48,7 @@ public function tearDown()
{
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 @@ public function tearDown()
*/
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 @@ public function testInit()
$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));

0 comments on commit e8734f2

Please sign in to comment.
You can’t perform that action at this time.