Add localization for templates and vars, with CakePHP i18n table.#7
Add localization for templates and vars, with CakePHP i18n table.#7cruamps wants to merge 3 commits intobakkerij:masterfrom
Conversation
|
First of all, thank you for the Pull Request! I am glad to see you added tests of your code, but the build failed because of the codestandard. You should fix that ;) I would like to discuss about the fact that you created all kind of new methods. (with Good work! |
|
Thank you @bobmulder I saw this kind of methods (with I18n) in some CMS plugins, and I did not want to alter your code for my first pull request. |
|
Thats no problem @cruamps. If you have questions, feel free to ask! Well, when just thinking about how we would like to program, I was thinking about: The |
Notifier now accepts translated templates and vars.
Translated templates can be managed with
addI18nTemplate()andgetI18nTemplate().Translated vars are stored into i18n table :
http://book.cakephp.org/3.0/en/orm/behaviors/translate.html#initializing-the-i18n-database-table
Notification table did not change.
Notifications are saved with
notifyI18n().Title and body of translated notification can be retrieved with
$entity->getI18n('title', 'en')or$entity->getI18n('body', 'fr').