summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJennifer Hodgdon2012-11-26 21:00:12 (GMT)
committer Jennifer Hodgdon2012-11-26 21:00:12 (GMT)
commitc833735d19413875d0b13cb6eca519e92dbe3798 (patch)
tree42ec67cee01520d1fcd23b67bc0d4bff1879e278
parentc7d5a9a135f4c0ea562ce17c88a5c034351172b7 (diff)
Issue #1837840 by amontero: Add clarification to l() function docs
-rw-r--r--includes/common.inc8
1 files changed, 8 insertions, 0 deletions
diff --git a/includes/common.inc b/includes/common.inc
index cd694fd..ea353d1 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -1596,6 +1596,14 @@ function drupal_attributes($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 $text
* The link text for the anchor tag.
* @param $path