FORUMS CLOSED DUE TO SPAM. YOU STILL CAN ADD POST!

Translation Template Generator function in Frog

Feed 8 posts, 4 voices

Avatar
651 posts

For those interested in helping out with translating Frog:

Starting from Frog release 0.9.5, a new Translation Template Generator function will be available to translators. This function will generate a template with all texts that are translatable in Frog or a plugin.

To use this function:

  • go to the “Administration” section in Frog.
  • select the “Settings” tab.
  • click on the “translate Frog” link on the right side.
  • please read and follow the instructions that are displayed on the screen.

For those who can’t wait until the release of Frog 0.9.5, this function was added in SVN revision 260 (http://code.google.com/p/madebyfrogs/source/detail?r=260)

 
Avatar
10 posts

Great! I will add a danish translation as soon as this is realeased.

 
Avatar
1493 posts

@mvdkleijn – I just installed a bleeding-edge hot-from-SVN Frog 0.9.4.r285 on localhost. That “Help us translate Frog” thing is … well … kind of awesome! :)

Does it meant that current i18n files will need to be converted to the new format that (e.g.) “Create core template” file appears in?

 
Avatar
651 posts

The reason I created the feature is because the current system is very labor intensive to keep up-to-date.

For the new system to be the easiest to keep up-to-date, you would have to use something like the diff utility (or “beyond compare” on windows) to highlight changes between the new and old versions.

So: yes.. to be most effective, we’ll have to update the layout of existing i18n files to the new format.

I’ve already done this for the file manager plugin by the way.

 
Avatar
316 posts

I’d be more than happy to update my Pinger plugin too, what are the requirements?

 
Avatar
651 posts

@mtylerb

Not a lot. Basically, if you have any translatable text, the translation template generator will automatically detect it if the plugin is installed on the filesystem.

So you:

1. Make translatable text by using:

<?php echo __('This is my translatable text.'); ?>

2. Add an empty directory to the root of your plugin called “i18n”.

That’s it. Any translations you get from people should be called “nl-message.php” where the nl bit is the language code. That file should be placed in your plugin’s i18n directory.

 
Avatar
316 posts

Ahhh, ok, I created a file en-message.php.template with all the translatable text in it. Easy enough for others to use, and similar to what I found in one of the core plugins. If your system will find it on it’s own, then great. I’ll leave it as it is for now. :-)

 
Avatar
651 posts

The new system means en-message.php.template is deprecated. It has been removed from SVN for the Frog core.

The new system scans all php and view files for strings based on the __('') usage and automatically creates a template for translators to use.

 
Avatar
316 posts

Great, I’ll remove the deprecated file after release! You guys are doing great!