I am having problems with the language used by pagination component. My site is configured to use Spanish (‘language’=>‘es’ in config/main.php) and it works, since form validation messages are correctly displayed in Spanish. However, words shown by pagination component are still written in English.
I saw that messages/es/yii.php file contains correct translations for Previous, Next, etc. Why pagination doesn’t take language into account?
<?php echo Yii::t('yii', 'Please fix the following input errors:') . "<br>"?>
<?php echo Yii::t('yii', 'Next >') . "<br>"?>
<?php echo Yii::t('yii', 'Go to page: ') . "<br><br>"?>
The result was:
Por favor corrija los siguientes errores de ingreso:
Next >
Go to page:
The 3 messages are present in messages/es/yii.php. I have thought about file encoding, but both yii.php and admin.php (the file that has the problem) are encoded using UTF-8.
Yes, that’s very strange. Your yii.php is fine. I copied your code to my site/index view (set language to be es before the code), but the three strings are all translated correctly.
The problem was the file version. I installed YII 1.0.7 some time ago. In that time, I copied the es/yii.php file to protected/messages/es. I don’t remember why, maybe because I planned to make some modifications.
Well, later I upgraded to YII 1.0.8 which does have the pagination messages. I forgot to copy that message file to my protected folder. I’m wondering why Yii 1.0.7 message file does not have those messages. Pagination doesn’t exist in 1.0.7 version?