My application has Contact model in app/models/contact.php. I have used _construct to add some list in array which its values should be translated using _('some text',true) as follows:
class Contact extends AppModel{
var $sex;
function __construct($id = false, $table = null, $ds = null) {
parent::__construct($id, $table, $ds);
$this->sex =array(
'U' => __('Choose Sex', true),
'M' => __('Male', true),
'F' => __('Female', true)
);
}
}
The above mentioned $sex variable is used to populate HTML select as follows:
// From contacts controller index function
function index(){
$this->set('sex', $this->Contact->sex);
.....
}
// From index view index.ctp
<?php echo $form->input('sex', array('type' => 'select', 'options' => $sex)); ?>
After running cake i18n, translating strings using Poedit version 1.5.5 and deleting files in app/tmp/cache, I have found that strings in the list still as it is without translation.
How could I solve this issue with translation strings in the model?
General Notes:
- CakePHP version 1.2.10
- XAMPP AMP package on Windows7 64 bit