translation changes for tests.

excludes basics and i18n
This commit is contained in:
AD7six 2011-03-12 20:08:25 +01:00
parent 28eae99ecb
commit a204ac7005
11 changed files with 77 additions and 77 deletions

View file

@ -12,7 +12,7 @@ class HelpFormatterTest extends CakeTestCase {
*/
function testWidthFormatting() {
$parser = new ConsoleOptionParser('test', false);
$parser->description(__('This is fifteen This is fifteen This is fifteen'))
$parser->description(__d('cake', 'This is fifteen This is fifteen This is fifteen'))
->addOption('four', array('help' => 'this is help text this is help text'))
->addArgument('four', array('help' => 'this is help text this is help text'))
->addSubcommand('four', array('help' => 'this is help text this is help text'));

View file

@ -337,20 +337,20 @@ class ControllerTaskTest extends CakeTestCase {
$this->assertContains("\$this->set('bakeArticles', \$this->paginate());", $result);
$this->assertContains('function view($id = null)', $result);
$this->assertContains("throw new NotFoundException(__('Invalid bake article'));", $result);
$this->assertContains("throw new NotFoundException(__d('cake', 'Invalid bake article'));", $result);
$this->assertContains("\$this->set('bakeArticle', \$this->BakeArticle->read(null, \$id)", $result);
$this->assertContains('function add()', $result);
$this->assertContains("if (\$this->request->is('post'))", $result);
$this->assertContains('if ($this->BakeArticle->save($this->request->data))', $result);
$this->assertContains("\$this->Session->setFlash(__('The bake article has been saved'));", $result);
$this->assertContains("\$this->Session->setFlash(__d('cake', 'The bake article has been saved'));", $result);
$this->assertContains('function edit($id = null)', $result);
$this->assertContains("\$this->Session->setFlash(__('The bake article could not be saved. Please, try again.'));", $result);
$this->assertContains("\$this->Session->setFlash(__d('cake', 'The bake article could not be saved. Please, try again.'));", $result);
$this->assertContains('function delete($id = null)', $result);
$this->assertContains('if ($this->BakeArticle->delete())', $result);
$this->assertContains("\$this->Session->setFlash(__('Bake article deleted'));", $result);
$this->assertContains("\$this->Session->setFlash(__d('cake', 'Bake article deleted'));", $result);
$result = $this->Task->bakeActions('BakeArticles', 'admin_', true);
@ -379,14 +379,14 @@ class ControllerTaskTest extends CakeTestCase {
$this->assertContains("\$this->set('bakeArticles', \$this->paginate());", $result);
$this->assertContains('function view($id = null)', $result);
$this->assertContains("throw new NotFoundException(__('Invalid bake article'));", $result);
$this->assertContains("throw new NotFoundException(__d('cake', 'Invalid bake article'));", $result);
$this->assertContains("\$this->set('bakeArticle', \$this->BakeArticle->read(null, \$id)", $result);
$this->assertContains('function add()', $result);
$this->assertContains("if (\$this->request->is('post'))", $result);
$this->assertContains('if ($this->BakeArticle->save($this->request->data))', $result);
$this->assertContains("\$this->flash(__('The bake article has been saved.'), array('action' => 'index'))", $result);
$this->assertContains("\$this->flash(__d('cake', 'The bake article has been saved.'), array('action' => 'index'))", $result);
$this->assertContains('function edit($id = null)', $result);
$this->assertContains("\$this->BakeArticle->BakeTag->find('list')", $result);
@ -394,7 +394,7 @@ class ControllerTaskTest extends CakeTestCase {
$this->assertContains('function delete($id = null)', $result);
$this->assertContains('if ($this->BakeArticle->delete())', $result);
$this->assertContains("\$this->flash(__('Bake article deleted'), array('action' => 'index'))", $result);
$this->assertContains("\$this->flash(__d('cake', 'Bake article deleted'), array('action' => 'index'))", $result);
}
/**

View file

@ -57,7 +57,7 @@ class TestsuiteShellTest extends CakeTestCase {
public function testAvailableWithEmptyList() {
$this->Shell->startup();
$this->Shell->args = array('unexistant-category');
$this->Shell->expects($this->at(0))->method('out')->with(__("No test cases available \n\n"));
$this->Shell->expects($this->at(0))->method('out')->with(__d('cake', "No test cases available \n\n"));
$this->Shell->OptionParser->expects($this->once())->method('help');
$this->Shell->available();
}
@ -77,7 +77,7 @@ class TestsuiteShellTest extends CakeTestCase {
->with(new PHPUnit_Framework_Constraint_PCREMatch('/\[2\].*/'));
$this->Shell->expects($this->once())->method('in')
->with(__('What test case would you like to run?'), null, 'q')
->with(__d('cake', 'What test case would you like to run?'), null, 'q')
->will($this->returnValue('1'));
$this->Shell->expects($this->once())->method('run');

View file

@ -174,7 +174,7 @@ class CakeSocketTest extends CakeTestCase {
$this->Socket = new CakeSocket($config);
$this->assertTrue($this->Socket->connect());
$this->assertFalse($this->Socket->read(1024 * 1024));
$this->assertEqual($this->Socket->lastError(), '2: ' . __('Connection timed out'));
$this->assertEqual($this->Socket->lastError(), '2: ' . __d('cake', 'Connection timed out'));
$config = array('host' => 'cakephp.org', 'port' => 80, 'timeout' => 20);
$this->Socket = new CakeSocket($config);

View file

View file

@ -482,7 +482,7 @@ class FileTest extends CakeTestCase {
$assertLine = $assertLine->traceMethod();
$shortPath = substr($tmpFile, strlen(ROOT));
$message = __('[FileTest] Skipping %s because "%s" not writeable!', $caller, $shortPath).$assertLine;
$message = __d('cake', '[FileTest] Skipping %s because "%s" not writeable!', $caller, $shortPath).$assertLine;
$this->_reporter->paintSkip($message);
}
return false;

0
lib/Cake/tests/cases/libs/model/model_read.test.php Executable file → Normal file
View file

View file

View file

@ -22,7 +22,7 @@ $this->loadHelper('Html');
<head>
<?php echo $this->Html->charset();?>
<title>
<?php __('CakePHP: the rapid development php framework:'); ?>
<?php __d('cake', 'CakePHP: the rapid development php framework:'); ?>
<?php echo $title_for_layout;?>
</title>
@ -32,7 +32,7 @@ $this->loadHelper('Html');
<body>
<div id="container">
<div id="header">
<h1><?php echo $this->Html->link(__('CakePHP: the rapid development php framework'), 'http://cakephp.org');?></h1>
<h1><?php echo $this->Html->link(__d('cake', 'CakePHP: the rapid development php framework'), 'http://cakephp.org');?></h1>
</div>
<div id="content">
@ -41,7 +41,7 @@ $this->loadHelper('Html');
</div>
<div id="footer">
<?php echo $this->Html->link(
$this->Html->image('cake.power.gif', array('alt'=> __("CakePHP: the rapid development php framework"), 'border'=>"0")),
$this->Html->image('cake.power.gif', array('alt'=> __d('cake', "CakePHP: the rapid development php framework"), 'border'=>"0")),
'http://www.cakephp.org/',
array('target'=>'_blank'), null, false
);

View file

@ -3,11 +3,11 @@
<?php
if (is_writable(TMP)):
echo '<span class="notice success">';
echo __('Your tmp directory is writable.');
echo __d('cake', 'Your tmp directory is writable.');
echo '</span>';
else:
echo '<span class="notice">';
echo __('Your tmp directory is NOT writable.');
echo __d('cake', 'Your tmp directory is NOT writable.');
echo '</span>';
endif;
?>
@ -17,11 +17,11 @@
$settings = array();
if (!empty($settings)):
echo '<span class="notice success">';
echo __('The %s is being used for caching. To change the config edit APP/config/core.php ', '<em>'. $settings['engine'] . 'Engine</em>');
echo __d('cake', 'The %s is being used for caching. To change the config edit APP/config/core.php ', '<em>'. $settings['engine'] . 'Engine</em>');
echo '</span>';
else:
echo '<span class="notice">';
echo __('Your cache is NOT working. Please check the settings in APP/config/core.php');
echo __d('cake', 'Your cache is NOT working. Please check the settings in APP/config/core.php');
echo '</span>';
endif;
?>
@ -31,14 +31,14 @@
$filePresent = null;
if (file_exists(CONFIGS . 'database.php')):
echo '<span class="notice success">';
echo __('Your database configuration file is present.');
echo __d('cake', 'Your database configuration file is present.');
$filePresent = true;
echo '</span>';
else:
echo '<span class="notice">';
echo __('Your database configuration file is NOT present.');
echo __d('cake', 'Your database configuration file is NOT present.');
echo '<br/>';
echo __('Rename config/database.php.default to config/database.php');
echo __d('cake', 'Rename config/database.php.default to config/database.php');
echo '</span>';
endif;
?>
@ -53,20 +53,20 @@ if (!empty($filePresent)):
<?php
if (true):
echo '<span class="notice success">';
echo __('Cake is able to connect to the database.');
echo __d('cake', 'Cake is able to connect to the database.');
echo '</span>';
else:
echo '<span class="notice">';
echo __('Cake is NOT able to connect to the database.');
echo __d('cake', 'Cake is NOT able to connect to the database.');
echo '</span>';
endif;
?>
</p>
<?php endif;?>
<h3><?php echo __('Editing this Page') ?></h3>
<h3><?php echo __d('cake', 'Editing this Page') ?></h3>
<p>
<?php
echo __('To change the content of this page, edit: %s
echo __d('cake', 'To change the content of this page, edit: %s
To change its layout, edit: %s
You can also add some CSS styles for your pages at: %s',
APP . 'views' . DS . 'pages' . DS . 'home.ctp.<br />', APP . 'views' . DS . 'layouts' . DS . 'default.ctp.<br />', APP . 'webroot' . DS . 'css');

View file

@ -20,11 +20,11 @@
<!--nocache-->
<span class="notice">
<?php
echo __('Your tmp directory is ');
echo __d('cake', 'Your tmp directory is ');
if (is_writable(TMP)):
echo __('writable.');
echo __d('cake', 'writable.');
else:
echo __('NOT writable.');
echo __d('cake', 'NOT writable.');
endif;
?>
</span>
@ -33,12 +33,12 @@
<p>
<span class="notice">
<?php
echo __('Your cache is ');
echo __d('cake', 'Your cache is ');
if (Cache::isInitialized('default')):
echo __('set up and initialized properly.');
echo __d('cake', 'set up and initialized properly.');
$settings = Cache::settings();
echo '<p>' . $settings['engine'];
echo __(' is being used to cache, to change this edit config/core.php ');
echo __d('cake', ' is being used to cache, to change this edit config/core.php ');
echo '</p>';
echo 'Settings: <ul>';
@ -48,10 +48,10 @@
echo '</ul>';
else:
echo __('NOT working.');
echo __d('cake', 'NOT working.');
echo '<br />';
if (is_writable(TMP)):
echo __('Edit: config/core.php to insure you have the newset version of this file and the variable $cakeCache set properly');
echo __d('cake', 'Edit: config/core.php to insure you have the newset version of this file and the variable $cakeCache set properly');
endif;
endif;
?>
@ -60,15 +60,15 @@
<p>
<span class="notice">
<?php
echo __('Your database configuration file is ');
echo __d('cake', 'Your database configuration file is ');
$filePresent = null;
if (file_exists(CONFIGS.'database.php')):
echo __('present.');
echo __d('cake', 'present.');
$filePresent = true;
else:
echo __('NOT present.');
echo __d('cake', 'NOT present.');
echo '<br/>';
echo __('Rename config/database.php.default to config/database.php');
echo __d('cake', 'Rename config/database.php.default to config/database.php');
endif;
?>
</span>
@ -83,60 +83,60 @@ if (!empty($filePresent)):
<p>
<span class="notice">
<?php
__('Cake');
__d('cake', 'Cake');
if ($connected->isConnected()):
__(' is able to ');
__d('cake', ' is able to ');
else:
__(' is NOT able to ');
__d('cake', ' is NOT able to ');
endif;
__('connect to the database.');
__d('cake', 'connect to the database.');
?>
</span>
</p>
<?php endif; ?>
<h2><?php echo __('Release Notes for CakePHP %s.', Configure::version()); ?></h2>
<a href="https://trac.cakephp.org/wiki/notes/1.2.x.x"><?php __('Read the release notes and get the latest version'); ?> </a>
<h2><?php __('Editing this Page'); ?></h2>
<h2><?php echo __d('cake', 'Release Notes for CakePHP %s.', Configure::version()); ?></h2>
<a href="https://trac.cakephp.org/wiki/notes/1.2.x.x"><?php __d('cake', 'Read the release notes and get the latest version'); ?> </a>
<h2><?php __d('cake', 'Editing this Page'); ?></h2>
<p>
<?php __('To change the content of this page, create: /app/views/pages/home.ctp.'); ?><br />
<?php __('To change its layout, create: /app/views/layouts/default.ctp.'); ?><br />
<a href="http://manual.cakephp.org/"><?php __('See the views section of the manual for more info.'); ?> </a><br />
<?php __('You can also add some CSS styles for your pages at: app/webroot/css/.'); ?>
<?php __d('cake', 'To change the content of this page, create: /app/views/pages/home.ctp.'); ?><br />
<?php __d('cake', 'To change its layout, create: /app/views/layouts/default.ctp.'); ?><br />
<a href="http://manual.cakephp.org/"><?php __d('cake', 'See the views section of the manual for more info.'); ?> </a><br />
<?php __d('cake', 'You can also add some CSS styles for your pages at: app/webroot/css/.'); ?>
</p>
<h2><?php __('Getting Started'); ?></h2>
<h2><?php __d('cake', 'Getting Started'); ?></h2>
<p>
<a href="http://manual.cakephp.org/appendix/blog_tutorial"><?php __('The 15 min Blog Tutorial'); ?></a><br />
<a href="http://www-128.ibm.com/developerworks/edu/os-dw-os-php-cake1.html"><?php __('Cook up Web sites fast with CakePHP'); ?></a><br />
<a href="http://www-128.ibm.com/developerworks/edu/os-dw-os-php-wiki1.html"><?php __('Create an interactive production wiki using PHP'); ?></a>
<a href="http://manual.cakephp.org/appendix/blog_tutorial"><?php __d('cake', 'The 15 min Blog Tutorial'); ?></a><br />
<a href="http://www-128.ibm.com/developerworks/edu/os-dw-os-php-cake1.html"><?php __d('cake', 'Cook up Web sites fast with CakePHP'); ?></a><br />
<a href="http://www-128.ibm.com/developerworks/edu/os-dw-os-php-wiki1.html"><?php __d('cake', 'Create an interactive production wiki using PHP'); ?></a>
</p>
<h2><?php __('More about Cake'); ?></h2>
<h2><?php __d('cake', 'More about Cake'); ?></h2>
<p>
<?php __('CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.'); ?>
<?php __d('cake', 'CakePHP is a rapid development framework for PHP which uses commonly known design patterns like Active Record, Association Data Mapping, Front Controller and MVC.'); ?>
</p>
<p>
<?php __('Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.'); ?>
<?php __d('cake', 'Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility.'); ?>
</p>
<ul>
<li><a href="http://cakefoundation.org/"><?php __('Cake Software Foundation'); ?> </a>
<ul><li><?php __('Promoting development related to CakePHP'); ?></li></ul></li>
<li><a href="http://bakery.cakephp.org"><?php __('The Bakery'); ?> </a>
<ul><li><?php __('Everything CakePHP'); ?></li></ul></li>
<li><a href="http://astore.amazon.com/cakesoftwaref-20/"><?php __('Book Store'); ?> </a>
<ul><li><?php __('Recommended Software Books'); ?></li></ul></li>
<li><a href="http://www.cafepress.com/cakefoundation"><?php __('CakeSchwag'); ?> </a>
<ul><li><?php __('Get your own CakePHP gear - Doughnate to Cake'); ?></li></ul></li>
<li><a href="http://www.cakephp.org"><?php __('CakePHP'); ?> </a>
<ul><li><?php __('The Rapid Development Framework'); ?></li></ul></li>
<li><a href="http://manual.cakephp.org"><?php __('CakePHP Manual'); ?> </a>
<ul><li><?php __('Your Rapid Development Cookbook'); ?></li></ul></li>
<li><a href="http://api.cakephp.org"><?php __('CakePHP API'); ?> </a>
<ul><li><?php __('Docblock Your Best Friend'); ?></li></ul></li>
<li><a href="http://www.cakeforge.org"><?php __('CakeForge'); ?> </a>
<ul><li><?php __('Open Development for CakePHP'); ?></li></ul></li>
<li><a href="https://trac.cakephp.org/"><?php __('CakePHP Trac'); ?> </a>
<ul><li><?php __('For the Development of CakePHP (Tickets, SVN browser, Roadmap, Changelogs)'); ?></li></ul></li>
<li><a href="http://groups-beta.google.com/group/cake-php"><?php __('CakePHP Google Group'); ?> </a>
<ul><li><?php __('Community mailing list'); ?></li></ul></li>
<li><a href="http://cakefoundation.org/"><?php __d('cake', 'Cake Software Foundation'); ?> </a>
<ul><li><?php __d('cake', 'Promoting development related to CakePHP'); ?></li></ul></li>
<li><a href="http://bakery.cakephp.org"><?php __d('cake', 'The Bakery'); ?> </a>
<ul><li><?php __d('cake', 'Everything CakePHP'); ?></li></ul></li>
<li><a href="http://astore.amazon.com/cakesoftwaref-20/"><?php __d('cake', 'Book Store'); ?> </a>
<ul><li><?php __d('cake', 'Recommended Software Books'); ?></li></ul></li>
<li><a href="http://www.cafepress.com/cakefoundation"><?php __d('cake', 'CakeSchwag'); ?> </a>
<ul><li><?php __d('cake', 'Get your own CakePHP gear - Doughnate to Cake'); ?></li></ul></li>
<li><a href="http://www.cakephp.org"><?php __d('cake', 'CakePHP'); ?> </a>
<ul><li><?php __d('cake', 'The Rapid Development Framework'); ?></li></ul></li>
<li><a href="http://manual.cakephp.org"><?php __d('cake', 'CakePHP Manual'); ?> </a>
<ul><li><?php __d('cake', 'Your Rapid Development Cookbook'); ?></li></ul></li>
<li><a href="http://api.cakephp.org"><?php __d('cake', 'CakePHP API'); ?> </a>
<ul><li><?php __d('cake', 'Docblock Your Best Friend'); ?></li></ul></li>
<li><a href="http://www.cakeforge.org"><?php __d('cake', 'CakeForge'); ?> </a>
<ul><li><?php __d('cake', 'Open Development for CakePHP'); ?></li></ul></li>
<li><a href="https://trac.cakephp.org/"><?php __d('cake', 'CakePHP Trac'); ?> </a>
<ul><li><?php __d('cake', 'For the Development of CakePHP (Tickets, SVN browser, Roadmap, Changelogs)'); ?></li></ul></li>
<li><a href="http://groups-beta.google.com/group/cake-php"><?php __d('cake', 'CakePHP Google Group'); ?> </a>
<ul><li><?php __d('cake', 'Community mailing list'); ?></li></ul></li>
<li><a href="irc://irc.freenode.net/cakephp">irc.freenode.net #cakephp</a>
<ul><li><?php __('Live chat about CakePHP'); ?></li></ul></li>
<ul><li><?php __d('cake', 'Live chat about CakePHP'); ?></li></ul></li>
</ul>