💾 Archived View for chirale.org › 2009-12-21_380.gmi captured on 2024-07-08 at 23:25:05. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2024-05-12)

-=-=-=-=-=-=-

How to automatically translate your Drupal module

You’ve created your module. But how to translate it into different languages?

Tested with:

Prerequisites:

If you use t() function correctly on your module, you can create your own translation using the handy Translation template extractor module.

Translation template extractor module

Download and install Translation template extractor module. Create a directory named “translations” within my_funny_module directory (your module directory) Go to admin/build/translate/extract Select your module from Directory lists Select “Language independent template” and click “Extract” Save file to my_funny_module/translations directory as my_funny_module.pot In the same screen, select “Template file for Italiano translations” (where Italiano is your destination language) If you’ve already translated some strings into Italiano language, check “Include translations” to include these strings Click “Extract”, and save file to my_funny_module/translations directory as it.po, where “it” is the ISO 639-2 code for Italiano language You can add information about translation changing the first part of both files (translator mail, name, etc.)

Translation template extractor module

ISO 639-2

Now, when you install your module translation strings will be added automatically. If you apply some changes to these files, and in any case the first time you complete this procedure on an active module, you have to refresh translation cache. To do this, go to admin/build/translate/refresh and use Refresh strings and Update translations after you’ve checked all boxes. If problem persists (strings are not updated or you got some weird errors), try to reinstall your module.

https://web.archive.org/web/20091221000000*/http://api.drupal.org/api/function/t/6

https://web.archive.org/web/20091221000000*/http://drupal.org/project/potx

https://web.archive.org/web/20091221000000*/http://drupal.org/project/potx

https://web.archive.org/web/20091221000000*/http://en.wikipedia.org/wiki/List_of_ISO_639-2_codes