Diem plugins syndication

dmCoreTranslatorPlugin

Helps writing Diem translations

The dmCoreTranslatorPlugin is designed to help translators to provide Diem translations. It generates data/dm/i18n/en_**.yml files.

Missing translations are generated automatically using the Google Translate API.

Installation

  • In a console, from your project root dir, run:
git clone git://github.com/ornicar/dmCoreTranslatorPlugin.git plugins/dmCoreTranslatorPlugin  
  • In config/ProjectConfiguration.class.php, add dmCoreTranslatorPlugin to the list of enabled plugins:
class ProjectConfiguration extends dmProjectConfiguration
{  
  public function setup()  
  {  
    parent::setup();  
 
    $this->enablePlugins(array(  
      // your enabled plugins  
      'dmCoreTranslatorPlugin'  
    ));  
  • In a console, from your project root dir, run:
php symfony dm:setup  

Command Line Interface Usage

Suppose you want to add Japanese translations to Diem core. The Japanese i18n code is "ja". Run the task:

php symfony dm:translate-core ja  

It will find all missing Diem Japanese sentences, and ask Google an (approximative) translation for each of them.
When the task completes, a file containing all translations is added in

/data/dm/i18n/en_ja.yml  

As the Google translations are not very accurate, you now need to apply corrections to the file.
Automatically generated translations are commented by default with a #. Each time you review/fix a translation, remove the # to activate it.

To apply your file translations to Diem, run the task:

php symfony dm:data  

Then update the project with the "Update Project" button in front or admin application.

When you think your translation file is ready, please let us know in Diem Google group, or send a message to the webmaster, and it will be quickly included into Diem Core.

You can use this task to update an existing translation file. Missing translation are added to the end of the file.

  • Daniel LohseDecember 2, 2009 1:10 AM

    This is sooooo cool! :)

    A real shame this cannot be used without Diem. ;-)

  • Endre FejesJanuary 3, 2011 2:54 PM

    Is it just me or google translate seems to ban the script after few hundred queries? If not, an improvement could be to query more strings at once by imploding them with some unique separator string.

    It's still usable though stopping the script when starting to receive empty strings and restart it a while later.

  • AhmedApril 14, 2012 1:19 PM

    I don't find ar translation

Add a comment

Create an issue
Impossible to fetch issues for this plugin.
Impossible to get this plugin changelog.
See more commits

dmCoreTranslatorPlugin, created on December 1, 2009 by Thibault D, used by 2657 projects

Fork Diem on GitHub