Internationalization/Languages Page

From G2Image

Jump to: navigation, search

Contents

[edit] International Support

  • Gallery2 Image Chooser is designed be easily translated.
  • The language files are located in the /g2image/langs/ directory.
  • There is a Traditional Chinese (zh_TW) demo to show G2Image's localization capabilty. (Thanks to Stephen Chu for the translation.)

[edit] G2Image v3.0 Translations

[edit] To Make Your Own Translation

1. Open en.js and save it as xx.js, where xx is the language code for the translation.

2. Edit the files, replacing the phrases after the colons

tinyMCE.addToLang('g2image',{
    button_title : 'Gallery Images',
...
  • So that it looks like this (from the Spanish translation):
tinyMCE.addToLang('g2image',{
    button_title : 'Inserta una imagen desde Gallery2', 
...

3. Create a new xx.mo file by visiting the G2Image Launchpad Translations Page. You'll need to create a Launchpad account to go to any of the pages besides the Translation Status page.

image:Launchpad_translation_status_page.JPG

To edit an existing xx.po file, click on the language of interest to go to the translation page. You can select a filter next to "Show:" if you would like to only see untranslated phrases or phrases that someone else has marked for review.

image:Launchpad_translation_page.JPG

To create an xx.po file for a language not listed on the status page, click on "Select Languages" under "Your Languages" on the left of the screen. Select your native language, and then you'll see a new link to your language on the Translation Status page.

image:Launchpad_language_preferences_page.JPG

If you prefer to use poedit for an existing .po file, please go to your language's page and click on "Download". You will then have to option do download a .po file or a .mo file. The .po file is what you need to translate with poedit. The .mo file is the final output that you need to use with G2Image.

image:Launchpad_translation_download_page.JPG

If you would like to use poedit for a language that has not been started, please click on "Download Translations" from the Translations Status page. Select "The PO Template" to download g2image.pot.

image:Launchpad_template_download_page.JPG

4. After saving your new translations, you can use them by changing the language settings in /g2image/config.php and editor_plugin.js.

  • For /g2image/config.php, set $g2ic_language to the corresponding letters.
  • For /g2image/editor_plugin.js add your language to the second line with a preceding comma after the "zh_TW". For example Russian (ru) is added here:
    • tinyMCE.importPluginLanguagePack('g2image', 'de, en, es, fr, hu, it, ko, nb, nl, pl, zh_TW, ru');

[edit] Please share your translation

  • If you translate these files to your own language, please zip them and e-mail it to the author. Any new files that were not included in the original distribution will be made available for immediate download and will be included in future releases. Thanks!

[edit] Notes

  • The key is that the encoding for the TinyMCE language files has to be the same as the encoding for the WP .mo file.
  • Also, the name has to be identical. For example, TinyMCE comes with zh-tw.js, but the Traditional Chinese translation for WP is zh_TW.mo. So the zh_tw.js has to be changed to zh_TW.js.
Personal tools
Developers