2

I want to write a widget, that allows admins to edit translations on a site, when they click on the "edit" button near some the text. I know how to get translations and have this code in my controller:

    $translator = $this->get('translator');
    $catalogue = new MessageCatalogue();
    $catalogue->set('message', 'updated translation message', 'messages');
    $translator->getCatalogue()->addCatalogue($catalogue);

I want to save this updated translation, but can't find a simple way to do this. Translations files stored in php array format. I can't use JmsTranslationBundle.

  • Which type of loader are you using? – Ragdata Sep 22 '15 at 08:45
  • PhpFileLoader, translations files stored in php array format. – Deniss Garanin Sep 22 '15 at 09:10
  • OK - I'd suggest you want to change that then. Would your messages be suitable for storage in YAML format? YamlFileLoader in conjunction with the YAML Component would make for an easy way to read and write your translations - AND you could still pass them around in array format. – Ragdata Sep 22 '15 at 09:27

0 Answers0