Bad:

if (!module_exists('advanced_help')) {
 $vars['help'] .= '<br/>' . t('Note: Installing the !adv_help module will let you access more and better help.', array('!adv_help' => l('Advanced help', 'http://drupal.org/project/advanced_help')));
}

Good:

if (!module_exists('advanced_help')) {
 $vars['help'] .= '<br/>' . t('Note: Installing the <a href="!adv_help">Advanced help</a> module will let you access more and better help.', array('!adv_help' => 'http://drupal.org/project/advanced_help'));
}

Please never use the bad way... see the API docs about t().

CommentFileSizeAuthor
#2 cck_bugfix_for_141444.patch1012 byteshass

Comments

hass’s picture

hass’s picture

StatusFileSize
new1012 bytes

Patch attached.

yched’s picture

Status: Needs review » Closed (won't fix)

Not in this case, since the text inside the <a> tag is the module name ('Advanced help'), which should *not* be translated.
This is how view.module does this, BTW.

hass’s picture

Status: Closed (won't fix) » Needs review

This is not only for a translation of the module name, nevertheless it could be. It's also to help translators to understand the context of the missing word in the sentence. Translators are not in the module code - they are using translation server and they need to know what the word is that comes in the A tag next. In German I need to know if it's "der/die/das"... as this would show you if the word in A tag is male/female/it... other languages have other context sensitive translation issues, too. This is why we are changing all this context less strings into context sensitive ones. So, please commit :-).

Also please read http://api.drupal.org/api/function/t/6 -> jump to "Here is an example of incorrect usage of t():"

PS: Views module awaits a very big translation patch... that will also fix this bug. See #279073: Context sensitive translation issues.

yched’s picture

Status: Needs review » Fixed

OK, makes sense. Committed.
Thanks !

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.