Agile Toolkit localization

人走茶凉 提交于 2019-12-08 04:55:45

问题


I read the answer here for a question about bilingual atk, but I wonder if the framework is adapted for international use?

I tested the CRUD functionality (v 4.2) and cannot see that e.g. the labels of the buttons (Add, Edit, Delete) are run through the _() function.

Any plans for that? If needed and ATK is the right path, could I assist? If so how?


回答1:


Here is the most recent localization branch.

https://github.com/atk4/atk4/tree/locale

they call $this->api->_() which you can override and make it call _() or any other way.

$this->add('translation/Controller_Basic')
    ->setLocale('de')                      // default language
    ->setModel('translation/Translation'); // use your model if you wish

$this->routePages('translation');          // adds translation/admin page

$this->add('Button')->setLabel('Localization Test');

If you use the translation controller with debug argument, it will add smileys to all the non-localized strings:

$this->add('translation/Controller_Basic',array('debug'=>true))

Records which has no translation will be automatically added through the model.



来源:https://stackoverflow.com/questions/13295286/agile-toolkit-localization

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!