1

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?

j0k
  • 22,600
  • 28
  • 79
  • 90
  • You are right, they do not, they are hard coded, but you can always replace the default CRUD with your own CRUD (please do this correctly, there are instructions on the website how to extend) and replace the function that contains (init in this case): $this->add_button = $this->grid->addButton('Add'); To $this->add_button = $this->grid->addButton('Add')->setLabel(_('Add')); I'm doing this from memory mostly so please let me know if wrong. – Omar Mir Nov 10 '12 at 05:54
  • see also http://stackoverflow.com/questions/9252573/a-bilingual-application-on-agile-toolkit-with-language-selector-for-the-user?rq=1 – romaninsh Nov 20 '12 at 01:10

1 Answers1

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.

romaninsh
  • 10,606
  • 4
  • 50
  • 70
  • this has now been pulled into master. Here is the appropriate add-on: https://github.com/atk4/atk4-addons/tree/master/translation – romaninsh Nov 20 '12 at 01:04