[development] t() API documentation

sivaji j.g sivaji2009 at gmail.com
Tue Feb 15 09:55:16 UTC 2011


Hello,

t() API documentation reads "Avoid escaping quotation marks wherever possible".

Below is the snippet from
http://api.drupal.org/api/drupal/includes--common.inc/function/t/6

Incorrect:
<?php
  $output .= t('Don\'t click me.');
?>

Correct:
<?php
  $output .= t("Don't click me.");
?>

However the core user module's hook_block implementation is following
incorrect style. The same is the case with D7 user module as well.

I think the purpose of avoiding t('Don\'t click me.'); style is just
to make it more readable and easier for translation.

Is there any reasons for encouraging incorrect style in core. Please
enlighten me on this.


-- 
Sivaji
+91 9941 571 690


More information about the development mailing list