diff --git a/includes/common.inc b/includes/common.inc index adaf43dbc9c..30b022bc14e 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 create a new + ** account 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); }