Hi,
Take the example code:
$string = t('Some text !my_link foo bar wibble', array('!my_link' => l('Coder module', 'http://drupal.org/project/coder'))),
Currently Coder will generate an error like:
The $text argument to l() should be enclosed within t() so that it is translatable.
However, it isn't a simple matter of adding a t() around the first param of l(). Instead no placeholder should be used at all. If we were to just add in a call to t(), then no context is provided to the translator. Instead the anchor link html needs to be part of the string given to the translator. So the code needs to be changed to something like the following (example taken from user/user.module):
$output .= '<p>'. t('For more information, see the online handbook entry for <a href="@user">User module</a>.', array('@user' => 'http://drupal.org/handbook/modules/user/')) .'</p>';
Coder needs to be modified to check for this.
Cheers,
Stella
Comments
Comment #1
klausiCoder for Drupal 6 is now frozen and only security fixes will be applied. Feel free to update this issue and reopen against 7.x-2.x or 8.x-2.x.