-
Notifications
You must be signed in to change notification settings - Fork 31
Multilingual Behavior
Instructions on how to use Multilingual behavior
CakePHP core comes with a Translation behavior, but that is solution is implemented using an i18n table with the data stored vertically. This behavior works in much the same way as the Revision and Drafted behaviors by employing a shadow table. Another major difference is the concept of a default language. With Multilingual behavior, your model and table acts completely normal whenever you access the default language. The translated data is kept horizontally in the locales table where one row here represent one of the possible translations of the associated row in the main model.
- Make sure you have the latest version of Multilingual behavior (/app/models/behavior/multilingual.php)
- Add it the model’s actsAs array
- Create a `_`locales table
The _locales
table should be named the same as the live table with ‘_locales’ added a the end. It should contain these fields :
- trans_id – int – autoincrement – primarykey
- locale – varchar
- plus fields identical to the ones you want translated
comming soon!