summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJennifer Hodgdon2012-11-13 16:22:07 (GMT)
committer Jennifer Hodgdon2012-11-13 16:22:07 (GMT)
commita60b8dec7a59cfc73b50cdc55ff01be6310d028c (patch)
tree5e7affa223e415687a2ed079ea6a7e67d47d75c5
parenta6ecde70a999c54b5759d57f00c60de3995b041f (diff)
Issue #1837840 by amontero, tstoeckler: Add clarification to l() docs as to when to use t() instead
-rw-r--r--includes/common.inc8
1 files changed, 8 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 8276576..d521268 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -2379,6 +2379,14 @@ function drupal_attributes(array $attributes = array()) {
* internal links output by modules should be generated by this function if
* possible.
*
+ * However, for links enclosed in translatable text you should use t() and
+ * embed the HTML anchor tag directly in the translated string. For example:
+ * @code
+ * t('Visit the <a href="@url">settings</a> page', array('@url' => url('admin')));
+ * @endcode
+ * This keeps the context of the link title ('settings' in the example) for
+ * translators.
+ *
* @param string $text
* The translated link text for the anchor tag.
* @param string $path