I’ve just created a module. For sake of argument, everything works and it’s got a number of places where it has used the t('this is the english version') function.
The t('foo') function appears in both the mymodule.module file as well as the mymodule.tpl.php file.
In my drupal server configuration, I have loaded the LOCALE and a bunch of other module that look like they’re needed:
Internationalization (enabled),
String translation (enabled),
Block languages (enabled),
Contact translation (disabled),
Field translation (enabled),
Translation sets (enabled),
Taxonomy translation (enabled),
Content translation (enabled),
Multilingual content (enabled),
Multilingual forum (disabled),
Menu translation (enabled),
Path translation (disabled),
Translation redirect (disabled),
Multilingual select (enabled),
Synchronize translations (enabled),
Variable translation (disabled),
Translation table (enabled)
(sorry, it’s a huge list but I don’t want to leave anything out that matters)
I’ve loaded the translation interface, and looked for the strings under the that my Block uses, “translate table” & “translate interface” but they’re not there.
I’ve tried reloading strings from the strings menu (under translate) – no luck.
I’ve tried disabling and re-enabling the block itself…
I’ve loaded block configuration and chosen “save and translate” (where I’ve only got the TITLE option under drupal configuration)
What am I missing?
Does my block have to have additional variable added to mymodule_block_info()
Do I have to create a mymodule_block_install() function?
Anyone?
Drupal uses ‘just-in-time’ translation for optimization reasons.
In order to load the string translations in Drupal, you typically have to visit the pages with those strings in the target language. I.e., if the block is on your “Contact” page and in Chinese, visit your Contact page using http://mysite.com/zh-hans/node/blah-blah.
Click around a little bit around the pages with untranslated strings, then visit the Translated Strings page again – you should see a difference.