I’ve made my own custom folder under messages called fi for finnish. I took the base of de (german) and translated the most important messages to finnish the ones the user is likely to see and added @@ marks arround the ones that appear when shit hits the fan the ones I end up reading.
Then I’ve under main.php protected/config/main.php defined the language as fi and
This wiki article has an example of how to use the message property of a validator.
Spontaneously I think what you tried to do in the first place should work.
Of course you also have the option to post a complete translated yii.php for inclusion in the framework. It probably will be added to SVN almost immediately. This thread is quite old but may be the right place for adding translations (or you can create a ticket)
I’ll have a look at it again first thing monday. I’ve been reading everything I can find about translating yii messages and I just assumed that if I make the translation file + tell yii to use it it would be used globally without having to use the t() function. In this case this app I need to publish well 2 weeks ago but realistically asap so I might have to do custom messages for this one and revisit this translation issue on my next project.
But thanks for all the help. It will most likely take a year or so to really take full benefit from using a framework after developing for 8+ years without one. BUt all in all it looks very promising.
I had a look at the errorSummary function in CHthml.php
$header='<p>'.Yii::t('yii','Please fix the following input errors:').'</p>';
So the translate function is there and apparently it should just work if the translation file is in messages and the language is either set in the application or in the main config file. I’ll make a ticket.
For completeness of the thread, would the answer be to use Yii:t() in the rules definition of the model as follows:-
public function rules()
array('Size,', 'numerical', 'min'=>0, 'max'=>3,
'tooBig'=>Yii::t('Validation','Size should be in meters in the format m.cm eg: 1.65'),
'tooSmall'=>Yii::t('Validation',('Size should be in meters in the format m.cm eg: 1.65'),
'message'=>Yii::t('Validation','Size should be a whole number')