I am planing to translate this very useful module into Chinese but when I tried to extract the .pot file from the wiki.module, I encountered the following error:

Invalid marker content in wiki.module:136
* t($output)


Warning: array_merge(): Argument #1 is not an array in E:\php\extractor
.php on line 104

Warning: array_unique(): The argument should be an array in E:\php\extr
actor.php on line 104

Warning: join(): Bad arguments. in E:\php\extractor.php on line 121

Could you help me fix this? Or could you provide a .pot file for the module. Thanks!

Comments

veridicus’s picture

Chinese? Cool! I know nothing about .pot files and translations. But my guess is that the script has an issue with a variable being passed to t() instead of a direct string. I assume the script looks for anything passed into t() since all text output is supposed to be passed through that. How would I adjust the code to enable .pot extraction? Or how would I provide a .pot file myself?

Anonymous’s picture

I'm pretty sure that the Drupal community frowns upon passing variables to the t() function unless absolutely necessary. This, along with unnecessary complexity, is why the .pot extractor chokes on the module as-is. In your case, a quick glance at the code seems to suggest that you could split up the single t() on $output into three separate t() calls on each string literal. (The two that are always outputted and the one conditional for HTML)

BTW: Thank you for your work on this module. It needed it badly.

veridicus’s picture

Sorry for the delay, but it's now fixed in cvs head. I pass the strings directly to t(), so I assume that'll solve the problem. Update this ticket if not.

Anonymous’s picture