2012-11-08 63 views
1

我在這裏閱讀答案關於雙語ATK的問題,但我不知道是否該框架適用於國際使用?敏捷工具包本地化

我測試CRUD功能(V 4.2),並且不能看到例如按鈕的標籤(Add,Edit,Delete)通過_()函數運行。

對於什麼計劃嗎?如果需要和ATK是正確的道路,我可以協助嗎?如果是這樣如何?

+0

你是對的,他們沒有,他們是硬編碼的,但你總是可以用你自己的CRUD替換默認的CRUD(請正確地做,這個網站上有說明如何擴展),並替換包含(在這種情況下爲init): $ this-> add_button = $ this-> grid-> addButton('Add'); 到 $ this-> add_button = $ this-> grid-> addButton('Add') - > setLabel(_('Add')); 我從內存中做這個,所以請讓我知道,如果錯了。 –

+0

提高了我的答案。 – romaninsh

+0

另請參閱http://stackoverflow.com/questions/9252573/a-bilingual-application-on-agile-toolkit-with-language-selector-for-the-user?rq=1 – romaninsh

回答

1

這裏是最近的本地化分支。

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

他們調用$這個 - > API - > _(),你可以重寫,使其調用_()或任何其他方式。

$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'); 

如果您使用的調試參數的翻譯器,它會添加表情到所有的非本地化字符串:

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

記錄它沒有翻譯將在模型中自動添加。

+0

這現在已被拉入主。這裏是適當的附加:https://github.com/atk4/atk4-addons/tree/master/translation – romaninsh