Commit 38aaf5f3 authored by Dries's avatar Dries

- Added missing translations and the like.
parent b0ea30ed
......@@ -261,10 +261,10 @@ function search_data() {
foreach (module_list() as $name) {
if (module_hook($name, "search") && (!$edit["type"] || $edit["type"][$name]) && ($result = module_invoke($name, "search", check_query($keys)))) {
if ($name == "node" || $name == "comment") {
$output .= "<b>Matching ". $name ."s ranked in order of relevance</b><br />";
$output .= "<p><b>". t("Matching ". $name ."s ranked in order of relevance") .":</b></p>";
}
else {
$output .= "<b>Matching ". $name ."s</b><br />";
$output .= "<p><b>". t("Matching ". $name ."s") .":</b></p>";
}
foreach ($result as $entry) {
$output .= search_item($entry, $name);
......@@ -302,6 +302,11 @@ function search_type($type = 0, $action = 0, $query = 0, $options = 0) {
function drupal_goto($url) {
/*
** Translate &amp; to simply &
*/
$url = str_replace ("&amp;", "&", $url);
/*
** It is advised to use "drupal_goto()" instead of PHP's "header()" as
** "drupal_goto()" will append the user's session ID to the URI when PHP
......@@ -624,7 +629,12 @@ function drupal_url($args = array(), $script = "node", $anchor = 0) {
foreach ($args as $key => $value) {
$t[] = "$key=". urlencode($value);
}
return "$script.php?". implode("&amp;", $t) . ($anchor ? "#$anchor" : "");
if (count($t)) {
return "$script.php?". implode("&amp;", $t) . ($anchor ? "#$anchor" : "");
}
else {
return "$script.php". ($anchor ? "#$anchor" : "");
}
}
/**
......@@ -683,7 +693,7 @@ function link_page() {
return $custom_links;
}
else {
$links[] = "<a href=\"index.php\">". t("home") ."</a>";
$links[] = l(t("home"), array(), "index", "", array("title" => t("Return to the main page.")));
foreach (module_list() as $name) {
if (module_hook($name, "link")) {
$links = array_merge($links, module_invoke($name, "link", "page"));
......
......@@ -267,7 +267,7 @@ function block_user($type, &$edit, &$user) {
}
if (isset($form)) {
return form_item(t("Block configuration"), '<table border="0" cellpadding="2" cellspacing="2">'. $form .'</table>', "Enable the blocks you would like to see displayed in the side bars.");
return form_item(t("Block configuration"), '<table border="0" cellpadding="2" cellspacing="2">'. $form .'</table>', t("Enable the blocks you would like to see displayed in the side bars."));
}
}
......
......@@ -267,7 +267,7 @@ function block_user($type, &$edit, &$user) {
}
if (isset($form)) {
return form_item(t("Block configuration"), '<table border="0" cellpadding="2" cellspacing="2">'. $form .'</table>', "Enable the blocks you would like to see displayed in the side bars.");
return form_item(t("Block configuration"), '<table border="0" cellpadding="2" cellspacing="2">'. $form .'</table>', t("Enable the blocks you would like to see displayed in the side bars."));
}
}
......
......@@ -43,7 +43,7 @@ function blog_user($type, &$edit, &$user) {
switch ($type) {
case "view_public":
case "view_private":
return form_item("Blog", lm(t("View recent entries."), array("mod" => "blog", "id" => $user->uid)) ."<br />". lm(t("View all entries."), array("mod" => "blog", "id" => $user->uid, "all" => 1)));
return form_item(t("Blog"), lm(t("view recent entries"), array("mod" => "blog", "id" => $user->uid), "", array("title" => t("View recent blog entries."))) ."<br />". lm(t("view all entries"), array("mod" => "blog", "id" => $user->uid, "all" => 1), "", array("title" => t("View all blog entries."))));
}
}
......@@ -170,7 +170,7 @@ function blog_page_user($uid = 0, $date = 0, $all = 0) {
$links = link_node($blog, 1);
$output .= "<tr><td><div style=\"margin-left: 20px;\"><b>". check_output($blog->title) ."</b></div></td><td align=\"right\">". $theme->links($links) ."</td><td>". l('<img src="misc/blog.gif" width="12" height="16" border="0" align="top">', array("id" => $node->nid), "node", "", array("title" => t("Permanent link to this blog entry"))) ."</td></tr>";
$output .= "<tr><td><div style=\"margin-left: 20px;\"><b>". check_output($blog->title) ."</b></div></td><td align=\"right\">". $theme->links($links) ."</td><td>". l('<img src="misc/blog.gif" width="12" height="16" border="0" align="top">', array("id" => $node->nid), "node", "", array("title" => t("Permanent link to this blog entry."))) ."</td></tr>";
$output .= "<tr><td colspan=\"3\"><div style=\"margin-left: 40px;\">". check_output($blog->teaser, 1) ."</div><br /></td></tr>";
}
......@@ -178,10 +178,10 @@ function blog_page_user($uid = 0, $date = 0, $all = 0) {
$output .= "</table>";
$output .= lm("<img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", array("mod" => "blog", "op" => "feed", "id" => $account->uid), "", array("title" => t("Read the XML version of this page."))) ."\n";
if (!$all && $date) {
$output .= lm(t("show all blogs"), array("mod" => "blog", "op" => "view", "id" => $account->uid, "all" => 1), "", array("title" => t("Show all blogs by this user")));
$output .= lm(t("show all blogs"), array("mod" => "blog", "op" => "view", "id" => $account->uid, "all" => 1), "", array("title" => t("Show all blogs by this user.")));
}
else {
$output .= lm(t("show recent blogs"), array("mod" => "blog", "op" => "view", "id" => $account->uid), "", array("title" => t("Show recent blogs by this user")));
$output .= lm(t("show recent blogs"), array("mod" => "blog", "op" => "view", "id" => $account->uid), "", array("title" => t("Show recent blogs by this user.")));
}
$theme->box(t("%u's blog", array("%u" => $account->name)), $output);
......
......@@ -43,7 +43,7 @@ function blog_user($type, &$edit, &$user) {
switch ($type) {
case "view_public":
case "view_private":
return form_item("Blog", lm(t("View recent entries."), array("mod" => "blog", "id" => $user->uid)) ."<br />". lm(t("View all entries."), array("mod" => "blog", "id" => $user->uid, "all" => 1)));
return form_item(t("Blog"), lm(t("view recent entries"), array("mod" => "blog", "id" => $user->uid), "", array("title" => t("View recent blog entries."))) ."<br />". lm(t("view all entries"), array("mod" => "blog", "id" => $user->uid, "all" => 1), "", array("title" => t("View all blog entries."))));
}
}
......@@ -170,7 +170,7 @@ function blog_page_user($uid = 0, $date = 0, $all = 0) {
$links = link_node($blog, 1);
$output .= "<tr><td><div style=\"margin-left: 20px;\"><b>". check_output($blog->title) ."</b></div></td><td align=\"right\">". $theme->links($links) ."</td><td>". l('<img src="misc/blog.gif" width="12" height="16" border="0" align="top">', array("id" => $node->nid), "node", "", array("title" => t("Permanent link to this blog entry"))) ."</td></tr>";
$output .= "<tr><td><div style=\"margin-left: 20px;\"><b>". check_output($blog->title) ."</b></div></td><td align=\"right\">". $theme->links($links) ."</td><td>". l('<img src="misc/blog.gif" width="12" height="16" border="0" align="top">', array("id" => $node->nid), "node", "", array("title" => t("Permanent link to this blog entry."))) ."</td></tr>";
$output .= "<tr><td colspan=\"3\"><div style=\"margin-left: 40px;\">". check_output($blog->teaser, 1) ."</div><br /></td></tr>";
}
......@@ -178,10 +178,10 @@ function blog_page_user($uid = 0, $date = 0, $all = 0) {
$output .= "</table>";
$output .= lm("<img src=\"". $theme->image("xml.gif") ."\" width=\"36\" height=\"14\" align=\"right\" border=\"0\" />", array("mod" => "blog", "op" => "feed", "id" => $account->uid), "", array("title" => t("Read the XML version of this page."))) ."\n";
if (!$all && $date) {
$output .= lm(t("show all blogs"), array("mod" => "blog", "op" => "view", "id" => $account->uid, "all" => 1), "", array("title" => t("Show all blogs by this user")));
$output .= lm(t("show all blogs"), array("mod" => "blog", "op" => "view", "id" => $account->uid, "all" => 1), "", array("title" => t("Show all blogs by this user.")));
}
else {
$output .= lm(t("show recent blogs"), array("mod" => "blog", "op" => "view", "id" => $account->uid), "", array("title" => t("Show recent blogs by this user")));
$output .= lm(t("show recent blogs"), array("mod" => "blog", "op" => "view", "id" => $account->uid), "", array("title" => t("Show recent blogs by this user.")));
}
$theme->box(t("%u's blog", array("%u" => $account->name)), $output);
......
......@@ -332,14 +332,14 @@ function comment_threshold($threshold) {
function comment_mode($mode) {
global $cmodes;
foreach ($cmodes as $key => $value) $options .= " <option value=\"$key\"". ($mode == $key ? " selected=\"selected\"" : "") .">$value</option>\n";
foreach ($cmodes as $key => $value) $options .= " <option value=\"$key\"". ($mode == $key ? " selected=\"selected\"" : "") .">". t($value) ."</option>\n";
return "<select name=\"mode\">$options</select>\n";
}
function comment_order($order) {
global $corder;
foreach ($corder as $key=>$value) $options .= " <option value=\"$key\"". ($order == $key ? " selected=\"selected\"" : "") .">$value</option>\n";
foreach ($corder as $key=>$value) $options .= " <option value=\"$key\"". ($order == $key ? " selected=\"selected\"" : "") .">". t($value) ."</option>\n";
return "<select name=\"order\">$options</select>\n";
}
......@@ -418,7 +418,7 @@ function comment_view($comment, $folded = 0) {
$theme->comment($comment, $folded);
}
else {
print l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid), "node", $comment->cid) ." by ". format_name($comment) ."</small><p />";
print l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid), "node", $comment->cid) ." ". t("by") ." ". format_name($comment) ."</small><p />";
}
}
......@@ -518,10 +518,10 @@ function comment_render($nid, $cid = 0) {
if ($mode == 1) {
if (db_result($result)) {
print "<table border=\"0\" cellpadding=\"2\" cellspacing=\"2\">\n";
print " <tr><th>Subject</th><th>Author</th><th>Date</th><th>Score</th></tr>\n";
print " <tr><th>". t("Subject") ."</th><th>". t("Author") ."</th><th>". t("Date") ."</th></tr>\n";
while ($comment = db_fetch_object($result)) {
if (comment_visible($comment, $threshold)) {
print " <tr><td>". l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid), "node", $comment->cid) ."</td><td>". format_name($comment) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>$comment->score</td></tr>\n";
print " <tr><td>". l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid), "node", $comment->cid) ."</td><td>". format_name($comment) ."</td><td>". format_date($comment->timestamp, "small") ."</td></tr>\n";
}
}
print "</table>\n";
......@@ -702,7 +702,7 @@ function comment_page() {
case t("Update settings"):
global $mode, $order, $threshold;
comment_settings(check_query($mode), check_query($order), check_query($threshold));
drupal_goto(drupal_url(array("id" => $edit["nid"]), "node"));
drupal_goto(drupal_url(array("id" => $edit["nid"], "mode" => $mode, "order" => $order), "node"));
break;
default:
}
......
......@@ -332,14 +332,14 @@ function comment_threshold($threshold) {
function comment_mode($mode) {
global $cmodes;
foreach ($cmodes as $key => $value) $options .= " <option value=\"$key\"". ($mode == $key ? " selected=\"selected\"" : "") .">$value</option>\n";
foreach ($cmodes as $key => $value) $options .= " <option value=\"$key\"". ($mode == $key ? " selected=\"selected\"" : "") .">". t($value) ."</option>\n";
return "<select name=\"mode\">$options</select>\n";
}
function comment_order($order) {
global $corder;
foreach ($corder as $key=>$value) $options .= " <option value=\"$key\"". ($order == $key ? " selected=\"selected\"" : "") .">$value</option>\n";
foreach ($corder as $key=>$value) $options .= " <option value=\"$key\"". ($order == $key ? " selected=\"selected\"" : "") .">". t($value) ."</option>\n";
return "<select name=\"order\">$options</select>\n";
}
......@@ -418,7 +418,7 @@ function comment_view($comment, $folded = 0) {
$theme->comment($comment, $folded);
}
else {
print l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid), "node", $comment->cid) ." by ". format_name($comment) ."</small><p />";
print l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid), "node", $comment->cid) ." ". t("by") ." ". format_name($comment) ."</small><p />";
}
}
......@@ -518,10 +518,10 @@ function comment_render($nid, $cid = 0) {
if ($mode == 1) {
if (db_result($result)) {
print "<table border=\"0\" cellpadding=\"2\" cellspacing=\"2\">\n";
print " <tr><th>Subject</th><th>Author</th><th>Date</th><th>Score</th></tr>\n";
print " <tr><th>". t("Subject") ."</th><th>". t("Author") ."</th><th>". t("Date") ."</th></tr>\n";
while ($comment = db_fetch_object($result)) {
if (comment_visible($comment, $threshold)) {
print " <tr><td>". l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid), "node", $comment->cid) ."</td><td>". format_name($comment) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>$comment->score</td></tr>\n";
print " <tr><td>". l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid), "node", $comment->cid) ."</td><td>". format_name($comment) ."</td><td>". format_date($comment->timestamp, "small") ."</td></tr>\n";
}
}
print "</table>\n";
......@@ -702,7 +702,7 @@ function comment_page() {
case t("Update settings"):
global $mode, $order, $threshold;
comment_settings(check_query($mode), check_query($order), check_query($threshold));
drupal_goto(drupal_url(array("id" => $edit["nid"]), "node"));
drupal_goto(drupal_url(array("id" => $edit["nid"], "mode" => $mode, "order" => $order), "node"));
break;
default:
}
......
......@@ -59,7 +59,7 @@ function forum_form(&$node, &$help, &$error) {
$output = implode("", taxonomy_node_form("forum", $node));
}
$output .= form_textarea("Body", "body", $node->body, 60, 10);
$output .= form_textarea(t("Body"), "body", $node->body, 60, 10);
return $output;
}
......
......@@ -59,7 +59,7 @@ function forum_form(&$node, &$help, &$error) {
$output = implode("", taxonomy_node_form("forum", $node));
}
$output .= form_textarea("Body", "body", $node->body, 60, 10);
$output .= form_textarea(t("Body"), "body", $node->body, 60, 10);
return $output;
}
......
......@@ -162,11 +162,11 @@ function jabber_user($type, $edit, $user) {
switch ($type) {
case "view_private":
$result = user_get_authname($user, $module);
$output .= form_item("$name ID", $result);
$output .= form_item(t("$name ID"), $result);
return $output;
case "edit_form":
$result = user_get_authname($user, $module);
$output .= form_textfield("$name ID", "authname_" . $module, $result, 30, 55, t("You may login to %s using a valid %id.", array("%s" => variable_get("site_name", "this web site"), "%id" => lm("$name ID", array("mod" => "user", "op" => "help"), $module))));
$output .= form_textfield(t("$name ID"), "authname_" . $module, $result, 30, 55, t("You may login to %s using a valid %id.", array("%s" => variable_get("site_name", "this web site"), "%id" => lm("$name ID", array("mod" => "user", "op" => "help"), $module))));
return $output;
case "edit_validate":
return user_validate_authmap($user, $edit["authname_$module"], $module);
......
......@@ -144,9 +144,9 @@ function page_form(&$node, &$help, &$error) {
$output .= implode("", taxonomy_node_form("page", $node));
}
$output .= form_textarea("Body", "body", $node->body, 60, 20);
$output .= form_textfield("Navigation link header", "link", $node->link, 60, 64, "To make the page show up on the navigation links enter the name of the link, otherwise leave blank.");
$output .= form_select("Type", "format", $node->format, array(0 => "HTML / text", 1 => "PHP"));
$output .= form_textarea(t("Body"), "body", $node->body, 60, 20);
$output .= form_textfield(t("Navigation link header"), "link", $node->link, 60, 64, t("To make the page show up on the navigation links enter the name of the link, otherwise leave blank."));
$output .= form_select(t("Type"), "format", $node->format, array(0 => "HTML / text", 1 => "PHP"));
return $output;
}
......
......@@ -144,9 +144,9 @@ function page_form(&$node, &$help, &$error) {
$output .= implode("", taxonomy_node_form("page", $node));
}
$output .= form_textarea("Body", "body", $node->body, 60, 20);
$output .= form_textfield("Navigation link header", "link", $node->link, 60, 64, "To make the page show up on the navigation links enter the name of the link, otherwise leave blank.");
$output .= form_select("Type", "format", $node->format, array(0 => "HTML / text", 1 => "PHP"));
$output .= form_textarea(t("Body"), "body", $node->body, 60, 20);
$output .= form_textfield(t("Navigation link header"), "link", $node->link, 60, 64, t("To make the page show up on the navigation links enter the name of the link, otherwise leave blank."));
$output .= form_select(t("Type"), "format", $node->format, array(0 => "HTML / text", 1 => "PHP"));
return $output;
}
......
......@@ -244,14 +244,15 @@ function taxonomy_form($vocabulary_id, $value = 0) {
}
else {
$verb = "can";
$blank = "<none>";
$blank = t("<none>");
}
if ($vocabulary->multiple) {
$description = "You $verb choose one or more terms for this node";
$description = t("You $verb choose one or more terms for this node.");
$multiple = 1;
}
else {
$description = "You $verb choose one term for this node";
$description = t("You $verb choose one term for this node.");
$multiple = 0;
}
return _taxonomy_term_select($vocabulary->name, "taxonomy", $value, $vocabulary_id, $description, $multiple, $blank);
......
......@@ -244,14 +244,15 @@ function taxonomy_form($vocabulary_id, $value = 0) {
}
else {
$verb = "can";
$blank = "<none>";
$blank = t("<none>");
}
if ($vocabulary->multiple) {
$description = "You $verb choose one or more terms for this node";
$description = t("You $verb choose one or more terms for this node.");
$multiple = 1;
}
else {
$description = "You $verb choose one term for this node";
$description = t("You $verb choose one term for this node.");
$multiple = 0;
}
return _taxonomy_term_select($vocabulary->name, "taxonomy", $value, $vocabulary_id, $description, $multiple, $blank);
......
......@@ -43,7 +43,7 @@ function tracker_comments($id = 0) {
$output .= "<ul>";
while ($comment = db_fetch_object($cresult)) {
$output .= " <li>". l(check_output($comment->subject), array("id" => $node->nid, "cid" => $comment->cid, "pid" => $comment->pid), "node", $comment->cid) ." by ". format_name($comment) ." (". t("replies") .": ". comment_num_replies($comment->cid) .") ". (comment_is_new($comment) ? "<span style=\"color: red;\">*</span>" : "") ."</li>\n";
$output .= " <li>". l(check_output($comment->subject), array("id" => $node->nid, "cid" => $comment->cid, "pid" => $comment->pid), "node", $comment->cid) ." ". t("by") ." ". format_name($comment) ." (". t("replies") .": ". comment_num_replies($comment->cid) .") ". (comment_is_new($comment) ? "<span style=\"color: red;\">*</span>" : "") ."</li>\n";
}
$output .= " </ul>\n";
}
......@@ -92,7 +92,7 @@ function tracker_user($type, &$edit, &$user) {
case "view_public":
case "view_private":
if (user_access("access comments")) {
return form_item(t("Comments"), lm(t("View recent comments."), array("mod" => "tracker", "id" => $user->uid)));
return form_item(t("Comments"), lm(t("view recent comments"), array("mod" => "tracker", "id" => $user->uid), "", array("title" => t("View recent comments."))));
}
}
}
......
......@@ -43,7 +43,7 @@ function tracker_comments($id = 0) {
$output .= "<ul>";
while ($comment = db_fetch_object($cresult)) {
$output .= " <li>". l(check_output($comment->subject), array("id" => $node->nid, "cid" => $comment->cid, "pid" => $comment->pid), "node", $comment->cid) ." by ". format_name($comment) ." (". t("replies") .": ". comment_num_replies($comment->cid) .") ". (comment_is_new($comment) ? "<span style=\"color: red;\">*</span>" : "") ."</li>\n";
$output .= " <li>". l(check_output($comment->subject), array("id" => $node->nid, "cid" => $comment->cid, "pid" => $comment->pid), "node", $comment->cid) ." ". t("by") ." ". format_name($comment) ." (". t("replies") .": ". comment_num_replies($comment->cid) .") ". (comment_is_new($comment) ? "<span style=\"color: red;\">*</span>" : "") ."</li>\n";
}
$output .= " </ul>\n";
}
......@@ -92,7 +92,7 @@ function tracker_user($type, &$edit, &$user) {
case "view_public":
case "view_private":
if (user_access("access comments")) {
return form_item(t("Comments"), lm(t("View recent comments."), array("mod" => "tracker", "id" => $user->uid)));
return form_item(t("Comments"), lm(t("view recent comments"), array("mod" => "tracker", "id" => $user->uid), "", array("title" => t("View recent comments."))));
}
}
}
......
......@@ -109,7 +109,7 @@ function node($node, $main = 0) {
}
$taxo = $this->links($taxlinks);
}
}
}
print "<TD WIDTH=\"70%\" BGCOLOR=\"$this->bgcolor2\"><SMALL>" . t("Submitted by %a on %b", array("%a" => format_name($node), "%b" => format_date($node->created, "large"))) . "</TD><TD WIDTH=\"30%\" BGCOLOR=\"$this->bgcolor2\" ALIGN=\"center\" NOWRAP><B>". $taxo ."</B>";
?>
</TD>
......
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