From a60b8dec7a59cfc73b50cdc55ff01be6310d028c Mon Sep 17 00:00:00 2001 From: Jennifer Hodgdon Date: Tue, 13 Nov 2012 08:22:07 -0800 Subject: Issue #1837840 by amontero, tstoeckler: Add clarification to l() docs as to when to use t() instead --- includes/common.inc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'includes') diff --git a/includes/common.inc b/includes/common.inc index 8276576e0..d521268eb 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 settings 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 -- cgit v1.2.3