最初に以下のURLを参照してください
http://book.cakephp.org/2.0/en/core-libraries/internationalization-and-localization.html
また
これを試して
//アプリケーションの国際化
<h2><?php echo __('Posts'); ?></h2>
//The default domain is ‘default’, therefore your locale folder would look something like this:
/app/Locale/eng/LC_MESSAGES/default.po (English)
/app/Locale/fre/LC_MESSAGES/default.po (French)
/app/Locale/por/LC_MESSAGES/default.po (Portuguese)
<?php
// App Controller Code.
public function beforeFilter() {
$locale = Configure::read('Config.language');
if ($locale && file_exists(VIEWS . $locale . DS . $this->viewPath)) {
// e.g. use /app/View/fre/Pages/tos.ctp instead of /app/View/Pages/tos.ctp
$this->viewPath = $locale . DS . $this->viewPath;
}
}
また:
<?php
// View code
echo $this->element(Configure::read('Config.language') . '/tos');
//CakePHPでのローカリゼーション
<?php
Configure::write('Config.language', 'fre');
?>
<?php
$this->Session->write('Config.language', 'fre');
?>
<?php
class AppController extends Controller {
public function beforeFilter() {
Configure::write('Config.language', $this->Session->read('Config.language'));
}
}
?>
///モデル検証エラーの翻訳
<?php
class User extends AppModel {
public $validationDomain = 'validation';
public $validate = array(
'username' => array(
'length' => array(
'rule' => array('between', 2, 10),
'message' => 'Username should be between %d and %d characters'
)
)
)
}
?>
//Which will do the following internal call:
<?php
__d('validation', 'Username should be between %d and %d characters', array(2, 10));