How to create multilingual sites in Yii?
What are the basic concepts?
Where to store and how to load translations?
How to create multilingual sites in Yii?
What are the basic concepts?
Where to store and how to load translations?
Hi viter,
there a plenty of ways to do it, I do use my own db translation engine by making use of MultilingualActiveRecord and MultilingualActiveDataProvider extensions (search on extensions) but Yii has a internationalization message approach.
Please refer to its documentation here: i18n.
The way you store the messages is within your application’s protected/messages/languageID
The file saved refers to the category of the function Yii::t(‘filenameiscategoryID’,‘keyofthearray’);
The file returns an array that holds: ‘translationkey’=>‘translatedtext’ (i.e. ‘No records found’=>‘No se han encontrado registros’,
Hope I helped you
Best
Thank you for your hints, Antonio.
No problem, we are here to help… one day you may help me too