diff options
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/includes/common.inc b/includes/common.inc index adaf43dbc..30b022bc1 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -125,6 +125,18 @@ function locale_init() { function t($string, $args = 0) { global $languages; + /* + ** About the usage of t(). We try to keep strings whole as much as + ** possible and are unafraid of HTML markup within translation strings + ** if necessary. The suggested syntax for a link embedded within a + ** translation string is for example: + ** + ** $msg = t("You must login below or <a href=\"%url\">create a new + ** account</a> before viewing the next page.", array ("%url" + ** => drupal_url(array ("mod" => "user", "op" => "register"), + ** "module"))); + */ + $string = ($languages && function_exists("locale") ? locale($string) : $string); if (!$args) { @@ -626,8 +638,8 @@ function form_submit($value) { */ function drupal_url($args = array(), $script = "node") { $t = array(); - foreach ($args as $k => $v) { - $t[] = "$k=$v"; + foreach ($args as $key => $value) { + $t[] = "$key = $value"; } return "$script.php?". implode("&", $t); } |