Translating text from within a custom module

fidot - January 8, 2008 - 13:02

Client has a site with the core modules in /modules folder, some others in /sites/all/modules/contributed and some others in /sites/all/modules/custom.

All well and good. We are now attempting to make the site multi-lingual and have managed to provide content and menus in French, German, Spanish, Dutch and Italian.

We are using the Localization module and the "manage strings" tab, but we are having a problem finding the strings in any of the modules under /sites folder.

For example, I can find the "Rebuild permissions" string which is contained in the node.module but not the one in the acl.module (which is in the /sites/all/modules/contributed folder).

Is there something obvious that we are missing?

Any help appreciated - client is having a real downer on Drupal at the moment because of this issue.
Thanks
Terry

Personal experience

abautu - January 8, 2008 - 14:24

Hi. From my personal experience I can tell you that using the manage strings tab is not the best approach to translation.

I believe (aka I'm pretty sure) that untranslated strings appear in this section only if they were displayed at least once in your site. Even if a module has a string, if it never displayed a page which uses that string, it won't appear on manage strings page. This is ok if you want to translate only strings that are actually used on your site. The main disadvantage is that users may perform some task (that you never performed) which will display untranslated strings.

I used poEdit (available for Windows and Linux) to translate modules and then import the translation into Drupal. poEdit can extract strings from source files (ie. .module files), use it's translation memory to automatically translate many strings, then you translate the remaining strings and that's ok. I has other nice features too.

The Drupal Handbook on translation is a very useful place to get more information. You may check an example at http://csam.univ-ovidius.ro/~ebautu/

Best wishes,
Andrei.

 
 

Drupal is a registered trademark of Dries Buytaert.