Commit 3a0f4b72 authored by Dries's avatar Dries

- Included Moshe's guidelines on the use of t().
parent 891cad97
......@@ -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("&amp;", $t);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment