summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2002-11-01 10:47:20 +0000
committerDries Buytaert <dries@buytaert.net>2002-11-01 10:47:20 +0000
commitcc381c14613b4c4539d74f38ec58196f6dfcdaa0 (patch)
tree34c44d95ed24402bca4736765ba7a0d53e458ac5 /modules
parent74c722502bf274cc59b3b6fd871db9d96defba4f (diff)
downloadbrdo-cc381c14613b4c4539d74f38ec58196f6dfcdaa0.tar.gz
brdo-cc381c14613b4c4539d74f38ec58196f6dfcdaa0.tar.bz2
- Fixed glitch in block module: the admin links were not composed
correctly. Patch by Stefan. - Added missing t() functions and improved the %x directives for better readability and to ease the process of translating your site. Patches by Stefan. - Made two small additions to the 'code-clean.sh' script; it will now remove patch related junk. NOTES: - I removed the &middot; related bits. Let's tackle these later on in a separate patch after we got some sort of consensus. - I removed the 'module_exist("drupal")' check in the user module; I *think* it is incomplete and therefore incorrect. - Stefan, try using quotes in your translations and check whether everything still works. Example: translate the "Create account" button to "Create \"haha\" account \'hihi\'" and see if you can still create new accounts. Maybe automate this using a quick hack in the locale module ...
Diffstat (limited to 'modules')
-rw-r--r--modules/block.module6
-rw-r--r--modules/block/block.module6
-rw-r--r--modules/blog.module9
-rw-r--r--modules/blog/blog.module9
-rw-r--r--modules/comment.module28
-rw-r--r--modules/comment/comment.module28
-rw-r--r--modules/forum.module6
-rw-r--r--modules/forum/forum.module6
-rw-r--r--modules/node.module2
-rw-r--r--modules/node/node.module2
-rw-r--r--modules/user.module96
-rw-r--r--modules/user/user.module96
-rw-r--r--modules/watchdog.module18
-rw-r--r--modules/watchdog/watchdog.module18
14 files changed, 168 insertions, 162 deletions
diff --git a/modules/block.module b/modules/block.module
index 0f4945256..12d42e42e 100644
--- a/modules/block.module
+++ b/modules/block.module
@@ -81,7 +81,7 @@ function block_admin_save($edit) {
/**
* update blocks db table with blocks currently exported by modules
- *
+ *
* @param array $order_by php array_multisort() style sort ordering, eg. "weight", SORT_ASC, SORT_STRING. see {@link http://www.php.net/manual/en/function.array-multisort.php}
* @return array blocks currently exported by modules, sorted by $order_by
* @access private
@@ -116,7 +116,7 @@ function _block_rehash($order_by = array("weight")) {
db_query("INSERT INTO blocks (module, delta, status, weight, region, path, custom) VALUES ('%s', '%d', '%d', '%d', '%d', '%s', '%d')", $block["module"], $block["delta"], $block["status"], $block["weight"], $block["region"], $block["path"], $block["custom"]);
$blocks[] = $block;
-
+
// build array to sort on
$order[$order_by[0]][] = $block[$order_by[0]];
}
@@ -139,7 +139,7 @@ function block_admin_display() {
foreach ($blocks as $block) {
$output .= "<tr>";
$output .= "<td>".$block["info"]."</td>";
- $output .= "<td>". (module_hook($block["module"], "admin") ? la($block["module"], array("mod" => $module), "", array("title" => t("Administer module"))) : $block["module"]) ."</td>";
+ $output .= "<td align=\"center\">". (module_hook($block["module"], "admin") ? la($block["module"], array("mod" => $block["module"]), "", array("title" => t("Administer module"))) : $block["module"]) ."</td>";
$output .= "<td align=\"center\">". form_checkbox(NULL, $block["module"]."][".$block["delta"]."][status", 1, $block["status"]) ."</td>";
$output .= "<td align=\"center\">". form_checkbox(NULL, $block["module"]."][".$block["delta"]."][custom", 1, $block["custom"]) ."</td>";
$output .= "<td>". form_weight(NULL, $block["module"]."][".$block["delta"]."][weight", $block["weight"]) ."</td>";
diff --git a/modules/block/block.module b/modules/block/block.module
index 0f4945256..12d42e42e 100644
--- a/modules/block/block.module
+++ b/modules/block/block.module
@@ -81,7 +81,7 @@ function block_admin_save($edit) {
/**
* update blocks db table with blocks currently exported by modules
- *
+ *
* @param array $order_by php array_multisort() style sort ordering, eg. "weight", SORT_ASC, SORT_STRING. see {@link http://www.php.net/manual/en/function.array-multisort.php}
* @return array blocks currently exported by modules, sorted by $order_by
* @access private
@@ -116,7 +116,7 @@ function _block_rehash($order_by = array("weight")) {
db_query("INSERT INTO blocks (module, delta, status, weight, region, path, custom) VALUES ('%s', '%d', '%d', '%d', '%d', '%s', '%d')", $block["module"], $block["delta"], $block["status"], $block["weight"], $block["region"], $block["path"], $block["custom"]);
$blocks[] = $block;
-
+
// build array to sort on
$order[$order_by[0]][] = $block[$order_by[0]];
}
@@ -139,7 +139,7 @@ function block_admin_display() {
foreach ($blocks as $block) {
$output .= "<tr>";
$output .= "<td>".$block["info"]."</td>";
- $output .= "<td>". (module_hook($block["module"], "admin") ? la($block["module"], array("mod" => $module), "", array("title" => t("Administer module"))) : $block["module"]) ."</td>";
+ $output .= "<td align=\"center\">". (module_hook($block["module"], "admin") ? la($block["module"], array("mod" => $block["module"]), "", array("title" => t("Administer module"))) : $block["module"]) ."</td>";
$output .= "<td align=\"center\">". form_checkbox(NULL, $block["module"]."][".$block["delta"]."][status", 1, $block["status"]) ."</td>";
$output .= "<td align=\"center\">". form_checkbox(NULL, $block["module"]."][".$block["delta"]."][custom", 1, $block["custom"]) ."</td>";
$output .= "<td>". form_weight(NULL, $block["module"]."][".$block["delta"]."][weight", $block["weight"]) ."</td>";
diff --git a/modules/blog.module b/modules/blog.module
index 9d698c44b..ef75b500d 100644
--- a/modules/blog.module
+++ b/modules/blog.module
@@ -8,8 +8,9 @@ function blog_system($field){
function blog_conf_options() {
- $output = form_textarea("Explanation or submission guidelines", "blog_help", variable_get("blog_help", ""), 55, 4, "This text is displayed at the top of the blog submission form. It's useful for helping or instructing your users.");
- $output .= form_select(t("Minimum number of words in a blog entry"), "minimum_blog_size", variable_get("minimum_blog_size", 0), array(0 => "0 words", 10 => "10 words", 25 => "25 words", 50 => "50 words", 75 => "75 words", 100 => "100 words", 125 => "125 words", 150 => "150 words", 175 => "175 words", 200 => "200 words"), t("The minimum number of words a personal blog entry should contain. This is useful to rule out submissions that do not meet the site's standards, such as short test posts."));
+ $output = form_textarea(t("Explanation or submission guidelines"), "blog_help", variable_get("blog_help", ""), 55, 4, t("This text is displayed at the top of the blog submission form. It's useful for helping or instructing your users."));
+ $words = t("words");
+ $output .= form_select(t("Minimum number of words in a blog entry"), "minimum_blog_size", variable_get("minimum_blog_size", 0), array(0 => "0 $words", 10 => "10 $words", 25 => "25 $words", 50 => "50 $words", 75 => "75 $words", 100 => "100 $words", 125 => "125 $words", 150 => "150 $words", 175 => "175 $words", 200 => "200 $words"), t("The minimum number of words a personal blog entry should contain. This is useful to rule out submissions that do not meet the site's standards, such as short test posts."));
return $output;
}
@@ -193,7 +194,7 @@ function blog_page_user($uid = 0, $date = 0, $all = 0) {
$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);
+ $theme->box(t("%username's blog", array("%username" => $account->name)), $output);
}
function blog_page_last() {
@@ -325,7 +326,7 @@ function blog_link($type, $node = 0, $main) {
$links[] = lm(t("edit this blog"), array("mod" => "node", "op" => "edit", "id" => $node->nid), "", array("title" => t("Edit this blog entry.")));
}
elseif ($op != "view" && !$id) {
- $links[] = lm(t("%u's blog", array("%u" => $node->name)), array("mod" => "blog", "op" => "view", "id" => $node->uid), "", array("title" => t("Read %u's latest blog entries.", array("%u" => $node->name))));
+ $links[] = lm(t("%username's blog", array("%username" => $node->name)), array("mod" => "blog", "op" => "view", "id" => $node->uid), "", array("title" => t("Read %username's latest blog entries.", array("%username" => $node->name))));
}
}
diff --git a/modules/blog/blog.module b/modules/blog/blog.module
index 9d698c44b..ef75b500d 100644
--- a/modules/blog/blog.module
+++ b/modules/blog/blog.module
@@ -8,8 +8,9 @@ function blog_system($field){
function blog_conf_options() {
- $output = form_textarea("Explanation or submission guidelines", "blog_help", variable_get("blog_help", ""), 55, 4, "This text is displayed at the top of the blog submission form. It's useful for helping or instructing your users.");
- $output .= form_select(t("Minimum number of words in a blog entry"), "minimum_blog_size", variable_get("minimum_blog_size", 0), array(0 => "0 words", 10 => "10 words", 25 => "25 words", 50 => "50 words", 75 => "75 words", 100 => "100 words", 125 => "125 words", 150 => "150 words", 175 => "175 words", 200 => "200 words"), t("The minimum number of words a personal blog entry should contain. This is useful to rule out submissions that do not meet the site's standards, such as short test posts."));
+ $output = form_textarea(t("Explanation or submission guidelines"), "blog_help", variable_get("blog_help", ""), 55, 4, t("This text is displayed at the top of the blog submission form. It's useful for helping or instructing your users."));
+ $words = t("words");
+ $output .= form_select(t("Minimum number of words in a blog entry"), "minimum_blog_size", variable_get("minimum_blog_size", 0), array(0 => "0 $words", 10 => "10 $words", 25 => "25 $words", 50 => "50 $words", 75 => "75 $words", 100 => "100 $words", 125 => "125 $words", 150 => "150 $words", 175 => "175 $words", 200 => "200 $words"), t("The minimum number of words a personal blog entry should contain. This is useful to rule out submissions that do not meet the site's standards, such as short test posts."));
return $output;
}
@@ -193,7 +194,7 @@ function blog_page_user($uid = 0, $date = 0, $all = 0) {
$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);
+ $theme->box(t("%username's blog", array("%username" => $account->name)), $output);
}
function blog_page_last() {
@@ -325,7 +326,7 @@ function blog_link($type, $node = 0, $main) {
$links[] = lm(t("edit this blog"), array("mod" => "node", "op" => "edit", "id" => $node->nid), "", array("title" => t("Edit this blog entry.")));
}
elseif ($op != "view" && !$id) {
- $links[] = lm(t("%u's blog", array("%u" => $node->name)), array("mod" => "blog", "op" => "view", "id" => $node->uid), "", array("title" => t("Read %u's latest blog entries.", array("%u" => $node->name))));
+ $links[] = lm(t("%username's blog", array("%username" => $node->name)), array("mod" => "blog", "op" => "view", "id" => $node->uid), "", array("title" => t("Read %username's latest blog entries.", array("%username" => $node->name))));
}
}
diff --git a/modules/comment.module b/modules/comment.module
index 6dc192c73..4c0dd1b64 100644
--- a/modules/comment.module
+++ b/modules/comment.module
@@ -23,20 +23,20 @@ function comment_system($field) {
function comment_conf_options() {
global $cmodes, $corder;
- $output .= form_select("Default display mode", "comment_default_mode", variable_get("comment_default_mode", 4), $cmodes, "The default view for comments. Expanded views display the body of the comment. Threaded views keep replies together.");
- $output .= form_select("Default display order", "comment_default_order", variable_get("comment_default_order", 1), $corder, "The default sorting for new users and anonymous users while viewing comments. These users may change their view using the comment control panel. For registered users, this change is remembered as a persistent user preference.");
- $output .= form_textfield("Default comments per page", "comment_default_per_page", variable_get("comment_default_per_page", "50"), 5, 5, "Default number of comments for each page; more comments are distributed in several pages.");
+ $output .= form_select(t("Default display mode"), "comment_default_mode", variable_get("comment_default_mode", 4), $cmodes, t("The default view for comments. Expanded views display the body of the comment. Threaded views keep replies together."));
+ $output .= form_select(t("Default display order"), "comment_default_order", variable_get("comment_default_order", 1), $corder, t("The default sorting for new users and anonymous users while viewing comments. These users may change their view using the comment control panel. For registered users, this change is remembered as a persistent user preference."));
+ $output .= form_textfield(t("Default comments per page"), "comment_default_per_page", variable_get("comment_default_per_page", "50"), 5, 5, t("Default number of comments for each page; more comments are distributed in several pages."));
$result = db_query("SELECT fid, filter FROM moderation_filters");
while ($filter = db_fetch_object($result)) {
$thresholds[$filter->fid] = ($filter->filter);
}
- $output .= form_select("Default threshold", "comment_default_threshold", variable_get("comment_default_threshold", 0), $thresholds, "Thresholds are values below which comments are hidden. These threshholds are useful for busy sites which wan tto hide poor comments from most users.");
+ $output .= form_select(t("Default threshold"), "comment_default_threshold", variable_get("comment_default_threshold", 0), $thresholds, t("Thresholds are values below which comments are hidden. These threshholds are useful for busy sites which wan tto hide poor comments from most users."));
- $output .= form_select("Preview comment", "comment_preview", variable_get("comment_preview", 1), array("optional", "required"), "Must users preview comments before submitting?");
- $output .= form_select("New comment form", "comment_new_form", variable_get("comment_new_form", 0), array("disabled", "enabled"), "New comment form in the node page?");
- $output .= form_select("Comment controls", "comment_controls", variable_get("comment_controls", 0), array("above comments", "below comments", "above and below"), "Position of the comment controls box.");
+ $output .= form_select(t("Preview comment"), "comment_preview", variable_get("comment_preview", 1), array(t("Optional"), t("Required")), t("Must users preview comments before submitting?"));
+ $output .= form_select(t("New comment form"), "comment_new_form", variable_get("comment_new_form", 0), array(t("Disabled"), t("Enabled")), t("New comment form in the node page?"));
+ $output .= form_select(t("Comment controls"), "comment_controls", variable_get("comment_controls", 0), array(t("Above comments"), t("Below comments"), t("Above and below")), t("Position of the comment controls box."));
return $output;
}
@@ -795,11 +795,11 @@ function comment_admin_overview($status = 0, $comment_page = 0) {
$start = $comment_page * $comments_per_page;
- $output .= $status ? "<h3>Non-published comments</h3>\n" : "<h3>Published comments</h3>";
+ $output .= $status ? "<h3>" . t("Non-published comments") . "</h3>\n" : "<h3>" . t("Published comments") . "</h3>";
$result = db_query("SELECT c.*, u.name, u.uid FROM comments c LEFT JOIN users u ON u.uid = c.uid WHERE c.status = '%d' ORDER BY timestamp DESC LIMIT $start, $comments_per_page", $status);
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
- $output .= " <tr><th>subject</th><th>author</th><th>date</th><th>published</th><th colspan=\"2\">operations</th></tr>\n";
+ $output .= " <tr><th>" . t("subject") . "</th><th>" . t("author") . "</th><th>" . t("date") . "</th><th>" . t("published") . "</th><th colspan=\"2\">" . t("operations") . "</th></tr>\n";
while ($comment = db_fetch_object($result)) {
$output .= " <tr><td>". l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid, "pid" => $comment->pid), "node", $comment->cid, array("title" => htmlentities($comment->comment))) ."</td><td>". format_name($comment) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>". ($comment->status == 0 ? "yes" : "no") ."</td><td>". la(t("edit comment"), array("mod" => "comment", "op" => "edit", "id" => $comment->cid)) ."</td><td>". la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid)) ."</td></tr>\n";
}
@@ -851,7 +851,7 @@ function comment_mod_matrix($edit) {
}
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
- $output .= " <tr><th>votes</th><th>". implode("</th><th>", array_values($role_names)) ."</th></tr>";
+ $output .= " <tr><th>" . t("votes") . "</th><th>". implode("</th><th>", array_values($role_names)) ."</th></tr>";
$result = db_query("SELECT mid, vote FROM moderation_votes ORDER BY weight");
while ($vote = db_fetch_object($result)) {
@@ -881,7 +881,7 @@ function comment_mod_roles($edit) {
$result = db_query("SELECT r.rid, r.name FROM role r, permission p WHERE r.rid = p.rid AND p.perm LIKE '%post comments%'");
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
- $output .= " <tr><th>user role</th><th>initial score</th></tr>";
+ $output .= " <tr><th>" . t("user role") . "</th><th>" . t("initial score") . "</th></tr>";
while ($role = db_fetch_object($result)) {
$output .= "<tr><td>$role->name</td>";
@@ -911,9 +911,9 @@ function comment_mod_votes($edit) {
$mid = 0;
}
- $output .= "<h3>Moderation votes overview</h3>";
+ $output .= "<h3>" . t("Moderation votes overview") . "</h3>";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
- $output .= " <tr><th>votes</th><th>weight</th><th>operations</th></tr>";
+ $output .= " <tr><th>" . t("votes") . "</th><th>" . t("weight") . "</th><th>" . t("operations") . "</th></tr>";
$result = db_query("SELECT mid, vote, weight FROM moderation_votes ORDER BY weight");
while ($vote = db_fetch_object($result)) {
@@ -960,7 +960,7 @@ function comment_mod_filters($edit) {
$output .= "<h3>Comment threshhold overview</h3>";
$output .= "<p><i>Optional</i>. If your site gets lots of comments, you may offer your users threshholds, which are used to hide all comments whose moderation score is lower than the threshhold. This cuts down on clutter while your readers view the site. These threshholds appear in the Comment Control Panel.</p>";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
- $output .= " <tr><th>name</th><th>minimum score</th><th>operations</th></tr>";
+ $output .= " <tr><th>" . t("name") . "</th><th>" . t("minimum score") . "</th><th>" . t("operations") . "</th></tr>";
$result = db_query("SELECT fid, filter, minimum FROM moderation_filters ORDER BY minimum");
while ($filter = db_fetch_object($result)) {
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 6dc192c73..4c0dd1b64 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -23,20 +23,20 @@ function comment_system($field) {
function comment_conf_options() {
global $cmodes, $corder;
- $output .= form_select("Default display mode", "comment_default_mode", variable_get("comment_default_mode", 4), $cmodes, "The default view for comments. Expanded views display the body of the comment. Threaded views keep replies together.");
- $output .= form_select("Default display order", "comment_default_order", variable_get("comment_default_order", 1), $corder, "The default sorting for new users and anonymous users while viewing comments. These users may change their view using the comment control panel. For registered users, this change is remembered as a persistent user preference.");
- $output .= form_textfield("Default comments per page", "comment_default_per_page", variable_get("comment_default_per_page", "50"), 5, 5, "Default number of comments for each page; more comments are distributed in several pages.");
+ $output .= form_select(t("Default display mode"), "comment_default_mode", variable_get("comment_default_mode", 4), $cmodes, t("The default view for comments. Expanded views display the body of the comment. Threaded views keep replies together."));
+ $output .= form_select(t("Default display order"), "comment_default_order", variable_get("comment_default_order", 1), $corder, t("The default sorting for new users and anonymous users while viewing comments. These users may change their view using the comment control panel. For registered users, this change is remembered as a persistent user preference."));
+ $output .= form_textfield(t("Default comments per page"), "comment_default_per_page", variable_get("comment_default_per_page", "50"), 5, 5, t("Default number of comments for each page; more comments are distributed in several pages."));
$result = db_query("SELECT fid, filter FROM moderation_filters");
while ($filter = db_fetch_object($result)) {
$thresholds[$filter->fid] = ($filter->filter);
}
- $output .= form_select("Default threshold", "comment_default_threshold", variable_get("comment_default_threshold", 0), $thresholds, "Thresholds are values below which comments are hidden. These threshholds are useful for busy sites which wan tto hide poor comments from most users.");
+ $output .= form_select(t("Default threshold"), "comment_default_threshold", variable_get("comment_default_threshold", 0), $thresholds, t("Thresholds are values below which comments are hidden. These threshholds are useful for busy sites which wan tto hide poor comments from most users."));
- $output .= form_select("Preview comment", "comment_preview", variable_get("comment_preview", 1), array("optional", "required"), "Must users preview comments before submitting?");
- $output .= form_select("New comment form", "comment_new_form", variable_get("comment_new_form", 0), array("disabled", "enabled"), "New comment form in the node page?");
- $output .= form_select("Comment controls", "comment_controls", variable_get("comment_controls", 0), array("above comments", "below comments", "above and below"), "Position of the comment controls box.");
+ $output .= form_select(t("Preview comment"), "comment_preview", variable_get("comment_preview", 1), array(t("Optional"), t("Required")), t("Must users preview comments before submitting?"));
+ $output .= form_select(t("New comment form"), "comment_new_form", variable_get("comment_new_form", 0), array(t("Disabled"), t("Enabled")), t("New comment form in the node page?"));
+ $output .= form_select(t("Comment controls"), "comment_controls", variable_get("comment_controls", 0), array(t("Above comments"), t("Below comments"), t("Above and below")), t("Position of the comment controls box."));
return $output;
}
@@ -795,11 +795,11 @@ function comment_admin_overview($status = 0, $comment_page = 0) {
$start = $comment_page * $comments_per_page;
- $output .= $status ? "<h3>Non-published comments</h3>\n" : "<h3>Published comments</h3>";
+ $output .= $status ? "<h3>" . t("Non-published comments") . "</h3>\n" : "<h3>" . t("Published comments") . "</h3>";
$result = db_query("SELECT c.*, u.name, u.uid FROM comments c LEFT JOIN users u ON u.uid = c.uid WHERE c.status = '%d' ORDER BY timestamp DESC LIMIT $start, $comments_per_page", $status);
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
- $output .= " <tr><th>subject</th><th>author</th><th>date</th><th>published</th><th colspan=\"2\">operations</th></tr>\n";
+ $output .= " <tr><th>" . t("subject") . "</th><th>" . t("author") . "</th><th>" . t("date") . "</th><th>" . t("published") . "</th><th colspan=\"2\">" . t("operations") . "</th></tr>\n";
while ($comment = db_fetch_object($result)) {
$output .= " <tr><td>". l(check_output($comment->subject), array("id" => $comment->nid, "cid" => $comment->cid, "pid" => $comment->pid), "node", $comment->cid, array("title" => htmlentities($comment->comment))) ."</td><td>". format_name($comment) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>". ($comment->status == 0 ? "yes" : "no") ."</td><td>". la(t("edit comment"), array("mod" => "comment", "op" => "edit", "id" => $comment->cid)) ."</td><td>". la(t("delete comment"), array("mod" => "comment", "op" => "delete", "id" => $comment->cid)) ."</td></tr>\n";
}
@@ -851,7 +851,7 @@ function comment_mod_matrix($edit) {
}
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
- $output .= " <tr><th>votes</th><th>". implode("</th><th>", array_values($role_names)) ."</th></tr>";
+ $output .= " <tr><th>" . t("votes") . "</th><th>". implode("</th><th>", array_values($role_names)) ."</th></tr>";
$result = db_query("SELECT mid, vote FROM moderation_votes ORDER BY weight");
while ($vote = db_fetch_object($result)) {
@@ -881,7 +881,7 @@ function comment_mod_roles($edit) {
$result = db_query("SELECT r.rid, r.name FROM role r, permission p WHERE r.rid = p.rid AND p.perm LIKE '%post comments%'");
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
- $output .= " <tr><th>user role</th><th>initial score</th></tr>";
+ $output .= " <tr><th>" . t("user role") . "</th><th>" . t("initial score") . "</th></tr>";
while ($role = db_fetch_object($result)) {
$output .= "<tr><td>$role->name</td>";
@@ -911,9 +911,9 @@ function comment_mod_votes($edit) {
$mid = 0;
}
- $output .= "<h3>Moderation votes overview</h3>";
+ $output .= "<h3>" . t("Moderation votes overview") . "</h3>";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
- $output .= " <tr><th>votes</th><th>weight</th><th>operations</th></tr>";
+ $output .= " <tr><th>" . t("votes") . "</th><th>" . t("weight") . "</th><th>" . t("operations") . "</th></tr>";
$result = db_query("SELECT mid, vote, weight FROM moderation_votes ORDER BY weight");
while ($vote = db_fetch_object($result)) {
@@ -960,7 +960,7 @@ function comment_mod_filters($edit) {
$output .= "<h3>Comment threshhold overview</h3>";
$output .= "<p><i>Optional</i>. If your site gets lots of comments, you may offer your users threshholds, which are used to hide all comments whose moderation score is lower than the threshhold. This cuts down on clutter while your readers view the site. These threshholds appear in the Comment Control Panel.</p>";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
- $output .= " <tr><th>name</th><th>minimum score</th><th>operations</th></tr>";
+ $output .= " <tr><th>" . t("name") . "</th><th>" . t("minimum score") . "</th><th>" . t("operations") . "</th></tr>";
$result = db_query("SELECT fid, filter, minimum FROM moderation_filters ORDER BY minimum");
while ($filter = db_fetch_object($result)) {
diff --git a/modules/forum.module b/modules/forum.module
index 0d1fbf6f6..4f5d0f5cb 100644
--- a/modules/forum.module
+++ b/modules/forum.module
@@ -94,7 +94,7 @@ function forum_block($op = "list", $delta = 0) {
if (variable_get("forum_cache", 0)) {
$content = cache_get("forum:block");
}
-
+
if (!$content) {
$content = "<b>". t("Active forum topics:") ."</b><br />";
$result = db_query("SELECT n.nid, n.title, n.body, GREATEST(n.created, MAX(c.timestamp)) AS sort FROM node n, forum f LEFT JOIN comments c ON c.nid = n.nid WHERE n.type = 'forum' AND n.nid = f.nid AND f.shadow = 0 AND n.status = 1 GROUP BY n.nid ORDER BY sort DESC LIMIT ". variable_get("forum_block_num", "5"));
@@ -108,11 +108,11 @@ function forum_block($op = "list", $delta = 0) {
while ($node = db_fetch_object($result)) {
$content .= "- ". l(check_output($node->title), array("id" => $node->nid), "node", "", array("title" => substr(strip_tags($node->body), 0, 100)."...")) ."<br />";
}
-
+
if ($content) {
$content .= "<div align=\"right\">". lm(t("more"), array("mod" => "forum")) ."</div>";
}
-
+
cache_set("forum:block", $content, time() + 60 * 3);
}
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index 0d1fbf6f6..4f5d0f5cb 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -94,7 +94,7 @@ function forum_block($op = "list", $delta = 0) {
if (variable_get("forum_cache", 0)) {
$content = cache_get("forum:block");
}
-
+
if (!$content) {
$content = "<b>". t("Active forum topics:") ."</b><br />";
$result = db_query("SELECT n.nid, n.title, n.body, GREATEST(n.created, MAX(c.timestamp)) AS sort FROM node n, forum f LEFT JOIN comments c ON c.nid = n.nid WHERE n.type = 'forum' AND n.nid = f.nid AND f.shadow = 0 AND n.status = 1 GROUP BY n.nid ORDER BY sort DESC LIMIT ". variable_get("forum_block_num", "5"));
@@ -108,11 +108,11 @@ function forum_block($op = "list", $delta = 0) {
while ($node = db_fetch_object($result)) {
$content .= "- ". l(check_output($node->title), array("id" => $node->nid), "node", "", array("title" => substr(strip_tags($node->body), 0, 100)."...")) ."<br />";
}
-
+
if ($content) {
$content .= "<div align=\"right\">". lm(t("more"), array("mod" => "forum")) ."</div>";
}
-
+
cache_set("forum:block", $content, time() + 60 * 3);
}
diff --git a/modules/node.module b/modules/node.module
index 8140914b1..a9c4863f9 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -500,7 +500,7 @@ function node_admin_nodes() {
$output .= "<small>". implode(" :: ", $links) ."</small><hr />";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
- $output .= " <tr><th>". t("title") ."</th><th>type</th><th>". t("author") ."</th><th>". t("status") ."</th><th colspan=\"2\">". t("operations") ."</th></tr>\n";
+ $output .= " <tr><th>". t("title") ."</th><th>". t("type") ."</th><th>". t("author") ."</th><th>". t("status") ."</th><th colspan=\"2\">". t("operations") ."</th></tr>\n";
while ($node = db_fetch_object($result)) {
$output .= "<tr><td>". l(check_output($node->title), array("id" => $node->nid)) ."</td><td>". module_invoke($node->type, "node", "name") ."</td><td nowrap=\"nowrap\">". format_name($node) ."</td><td>". ($node->status ? t("published") : t("not published")) ."</td><td nowrap=\"nowrap\">". la(t("edit node"), array("mod" => "node", "op" => "edit", "id" => $node->nid)) ."</td><td nowrap=\"nowrap\">". la(t("delete node"), array("mod" => "node", "op" => "delete", "id" => $node->nid)) ."</td></tr>";
}
diff --git a/modules/node/node.module b/modules/node/node.module
index 8140914b1..a9c4863f9 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -500,7 +500,7 @@ function node_admin_nodes() {
$output .= "<small>". implode(" :: ", $links) ."</small><hr />";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
- $output .= " <tr><th>". t("title") ."</th><th>type</th><th>". t("author") ."</th><th>". t("status") ."</th><th colspan=\"2\">". t("operations") ."</th></tr>\n";
+ $output .= " <tr><th>". t("title") ."</th><th>". t("type") ."</th><th>". t("author") ."</th><th>". t("status") ."</th><th colspan=\"2\">". t("operations") ."</th></tr>\n";
while ($node = db_fetch_object($result)) {
$output .= "<tr><td>". l(check_output($node->title), array("id" => $node->nid)) ."</td><td>". module_invoke($node->type, "node", "name") ."</td><td nowrap=\"nowrap\">". format_name($node) ."</td><td>". ($node->status ? t("published") : t("not published")) ."</td><td nowrap=\"nowrap\">". la(t("edit node"), array("mod" => "node", "op" => "edit", "id" => $node->nid)) ."</td><td nowrap=\"nowrap\">". la(t("delete node"), array("mod" => "node", "op" => "delete", "id" => $node->nid)) ."</td></tr>";
}
diff --git a/modules/user.module b/modules/user.module
index 70064130d..23fc80a4a 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -952,6 +952,7 @@ function user_edit($edit = array()) {
foreach (theme_list() as $key => $value) {
$options .= "<option value=\"$key\"". (($edit["theme"] == $key) ? " selected=\"selected\"" : "") .">$key - $value->description</option>\n";
}
+
$output .= form_item(t("Theme"), "<select name=\"edit[theme]\">$options</select>", t("Selecting a different theme will change the look and feel of the site."));
for ($zone = -43200; $zone <= 46800; $zone += 3600) $zones[$zone] = date("l, F dS, Y - h:i A", time() - date("Z") + $zone) ." (GMT ". $zone / 3600 .")";
$output .= form_select(t("Timezone"), "timezone", $edit["timezone"], $zones, t("Select what time you currently have and your timezone settings will be set appropriate."));
@@ -1096,13 +1097,14 @@ function user_conf_options() {
$output .= form_textarea("Welcome e-mail body", "user_mail_welcome_body", variable_get("user_mail_welcome_body", t("%username,\n\nThank you for registering at %site. You may now login to %uri". drupal_url(array("mod" => "user", "op" => "login"), "module") ." using the following username and password:\n\nusername: %username\npassword: %password\n\nAfter logging in, you may wish to change your password at %uri". drupal_url(array("mod" => "user", "op" => "edit"), "module") ."\n\nYour new %site membership also enables to you to login to other Drupal powered websites (e.g. http://www.drop.org/) without registering. Just use the following Drupal ID and password:\n\nDrupal ID: %username@%uri_brief\npassword: %password\n\n\n-- %site team")), 70, 10, "Customize the body of the welcome e-mail, which is sent to new members upon registering. Available variables are: %username, %site, %password, %uri, %uri_brief, %mailto");
$output .= form_textfield("Forgotten password e-mail subject", "user_mail_pass_subject", variable_get("user_mail_pass_subject", t("Replacement login information for %username at %site")), 80, 180, "Customize the Subject of your forgotten password e-mail. Available variables are: %username, %site, %password, %uri, %uri_brief, %mailto, %date");
$output .= form_textarea("Forgotten password e-mail body", "user_mail_pass_body", variable_get("user_mail_pass_body", t("%username,\n\nHere is your new password for %site. You may now login to %uri". drupal_url(array("mod" => "user", "op" => "login"), "module") ." using the following username and password:\n\nusername: %username\npassword: %password\n\nAfter logging in, you may wish to change your password at %uri". drupal_url(array("mod" => "user", "op" => "edit"), "module") ."\n\nYour new %site membership also enables to you to login to other Drupal powered websites (e.g. http://www.drop.org/) without registering. Just use the following Drupal ID and password:\n\nDrupal ID: %username@%uri_brief\npassword: %password\n\n\n-- %site team")), 70, 10, "Customize the body of the forgotten password e-mail. Available variables are: %username, %site, %password, %uri, %uri_brief, %mailto");
+
return $output;
}
function user_admin_settings($edit = array()) {
global $op;
- if ($op == "Save configuration") {
+ if ($op == t("Save configuration")) {
/*
** Save the configuration options:
*/
@@ -1110,7 +1112,7 @@ function user_admin_settings($edit = array()) {
foreach ($edit as $name => $value) variable_set($name, $value);
}
- if ($op == "Reset to defaults") {
+ if ($op == t("Reset to defaults")) {
/*
** Reset the configuration options to their default value:
*/
@@ -1119,8 +1121,8 @@ function user_admin_settings($edit = array()) {
}
$output .= user_conf_options();
- $output .= form_submit("Save configuration");
- $output .= form_submit("Reset to defaults");
+ $output .= form_submit(t("Save configuration"));
+ $output .= form_submit(t("Reset to defaults"));
return form($output);
@@ -1160,10 +1162,10 @@ function user_admin_create($edit = array()) {
$output .= theme_invoke("theme_error", check_output($error));
}
- $output .= form_textfield("Username", "name", $edit["name"], 30, 55);
- $output .= form_textfield("E-mail address", "mail", $edit["mail"], 30, 55);
- $output .= form_textfield("Password", "pass", $edit["pass"], 30, 55);
- $output .= form_submit("Create account");
+ $output .= form_textfield(t("Username"), "name", $edit["name"], 30, 55, t("Provide the username of the new account."));
+ $output .= form_textfield(t("E-mail address"), "mail", $edit["mail"], 30, 55, t("Provide the e-mail address associated with the new account."));
+ $output .= form_textfield(t("Password"), "pass", $edit["pass"], 30, 55, t("Provide a password for the new account."));
+ $output .= form_submit(t("Create account"));
return form($output);
}
@@ -1175,17 +1177,17 @@ function user_admin_access($edit = array()) {
$output .= "<small>". la(t("e-mail rules"), array("mod" => "user", "op" => "access", "type" => "mail")) ." :: ". la(t("username rules"), array("mod" => "user", "op" => "access", "type" => "user")) ."</small><hr />"; // irc rules, too!
if ($type != "user") {
- $output .= "<h3>E-mail rules</h3>";
+ $output .= "<h3>" . t("E-mail rules") . "</h3>";
$type = "mail";
}
else {
- $output .= "<h3>Username rules</h3>";
+ $output .= "<h3>" . t("Username rules") . "</h3>";
}
- if ($op == "Add rule") {
+ if ($op == t("Add rule")) {
db_query("INSERT INTO access (mask, type, status) VALUES ('%s', '%s', '%s')", $edit["mask"], $type, $edit["status"]);
}
- else if ($op == "Check") {
+ else if ($op == t("Check")) {
if (user_deny($type, $edit["test"])) {
$message = "<b>'". $edit["test"] ."' is not allowed.</b><p />";
}
@@ -1198,32 +1200,32 @@ function user_admin_access($edit = array()) {
}
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
- $output .= " <tr><th>type</th><th>mask</th><th>operations</th></tr>";
+ $output .= " <tr><th>" . t("type") . "</th><th>" . t("mask") . "</th><th>" . t("operations") . "</th></tr>";
$result = db_query("SELECT * FROM access WHERE type = '%s' AND status = '1' ORDER BY mask", $type);
while ($rule = db_fetch_object($result)) {
- $output .= "<tr><td align=\"center\">allow</td><td>". check_output($rule->mask) ."</td><td>". la(t("delete rule"), array("mod" => "user", "op" => "access", "type" => $type, "id" => $rule->aid)) ."</td></tr>";
+ $output .= "<tr><td align=\"center\">" . t("Allow") . "</td><td>". check_output($rule->mask) ."</td><td>". la(t("delete rule"), array("mod" => "user", "op" => "access", "type" => $type, "id" => $rule->aid)) ."</td></tr>";
}
$result = db_query("SELECT * FROM access WHERE type = '%s' AND status = '0' ORDER BY mask", $type);
while ($rule = db_fetch_object($result)) {
- $output .= "<tr><td align=\"center\">deny</td><td>". check_output($rule->mask) ."</td><td>". la(t("delete rule"), array("mod" => "user", "op" => "access", "type" => $type, "id" => $rule->aid)). "</td></tr>";
+ $output .= "<tr><td align=\"center\">" . t("Deny") . "</td><td>". check_output($rule->mask) ."</td><td>". la(t("delete rule"), array("mod" => "user", "op" => "access", "type" => $type, "id" => $rule->aid)). "</td></tr>";
}
- $output .= " <tr><td><select name=\"edit[status]\"><option value=\"1\">allow</option><option value=\"0\">deny</option></select></td><td><input size=\"32\" maxlength=\"64\" name=\"edit[mask]\" /></td><td><input type=\"submit\" name=\"op\" value=\"Add rule\" /></td></tr>";
+ $output .= " <tr><td><select name=\"edit[status]\"><option value=\"1\">" . t("Allow") . "</option><option value=\"0\">" . t("Deny") . "</option></select></td><td><input size=\"32\" maxlength=\"64\" name=\"edit[mask]\" /></td><td><input type=\"submit\" name=\"op\" value=\"" . t("Add rule") . "\" /></td></tr>";
$output .= "</table>";
- $output .= "<p><small>%: matches any number of characters, even zero characters.<br />_: matches exactly one character.</small></p>";
+ $output .= "<p><small>%: " . t("Matches any number of characters, even zero characters") . ".<br />_: " . t("Matches exactly one character.") . "</small></p>";
if ($type != "user") {
- $output .= "<h3>Check e-mail address</h3>";
+ $output .= "<h3>" . t("Check e-mail address") . "</h3>";
}
else {
- $output .= "<h3>Check username</h3>";
+ $output .= "<h3>" . t("Check username") . "</h3>";
}
- $output .= "$message<input size=\"32\" maxlength=\"64\" name=\"edit[test]\" value=\"". $edit["test"] ."\" /><input type=\"submit\" name=\"op\" value=\"Check\" />";
+ $output .= "$message<input size=\"32\" maxlength=\"64\" name=\"edit[test]\" value=\"". $edit["test"] ."\" /><input type=\"submit\" name=\"op\" value=\"" . t("Check") . "\" />";
return form($output);
}
@@ -1305,7 +1307,7 @@ function user_admin_perm($edit = array()) {
}
$output .= "</table>";
$output .= form_hidden("tid", $tid);
- $output .= form_submit("Save permissions");
+ $output .= form_submit(t("Save permissions"));
return form($output);
@@ -1314,14 +1316,14 @@ function user_admin_perm($edit = array()) {
function user_admin_role($edit = array()) {
global $op, $id;
- if ($op == "Save role") {
+ if ($op == t("Save role")) {
db_query("UPDATE role SET name = '%s' WHERE rid = '%s'", $edit["name"], $id);
}
- else if ($op == "Delete role") {
+ else if ($op == t("Delete role")) {
db_query("DELETE FROM role WHERE rid = '%s'", $id);
db_query("DELETE FROM permission WHERE rid = '%s'", $id);
}
- else if ($op == "Add role") {
+ else if ($op == t("Add role")) {
db_query("INSERT INTO role (name) VALUES ('%s')", $edit["name"]);
}
else if ($id) {
@@ -1331,9 +1333,9 @@ function user_admin_role($edit = array()) {
$role = db_fetch_object(db_query("SELECT * FROM role WHERE rid = '%s'", $id));
- $output .= form_textfield("Role name", "name", $role->name, 32, 64, "The name for this role. Example: 'moderator', 'editorial board', 'site architect'.");
- $output .= form_submit("Save role");
- $output .= form_submit("Delete role");
+ $output .= form_textfield(t("Role name"), "name", $role->name, 32, 64, t("The name for this role. Example: 'moderator', 'editorial board', 'site architect'."));
+ $output .= form_submit(t("Save role"));
+ $output .= form_submit(t("Delete role"));
$output = form($output);
}
@@ -1350,7 +1352,7 @@ function user_admin_role($edit = array()) {
while ($role = db_fetch_object($result)) {
$output .= "<tr><td>". check_output($role->name) ."</td><td>". la(t("edit role"), array("mod" => "user", "op" => "role", "id" => $role->rid)) ."</td></tr>";
}
- $output .= " <tr><td><input size=\"32\" maxlength=\"64\" name=\"edit[name]\" /></td><td><input type=\"submit\" name=\"op\" value=\"Add role\" /></td></tr>";
+ $output .= " <tr><td><input size=\"32\" maxlength=\"64\" name=\"edit[name]\" /></td><td><input type=\"submit\" name=\"op\" value=\"" . t("Add role") . "\" /></td></tr>";
$output .= "</table>";
$output = form($output);
@@ -1364,7 +1366,7 @@ function user_admin_edit($edit = array()) {
if ($account = user_load(array("uid" => $id))) {
- if ($op == "Save account") {
+ if ($op == t("Save account")) {
foreach (module_list() as $module) {
if (module_hook($module, "user")) {
$result = module_invoke($module, "user", "edit_validate", $edit, $account);
@@ -1415,7 +1417,7 @@ function user_admin_edit($edit = array()) {
$output .= theme_invoke("theme_error", check_output($error));
}
}
- else if ($op == "Delete account") {
+ else if ($op == t("Delete account")) {
if ($edit["status"] == 0) {
db_query("DELETE FROM users WHERE uid = '$account->uid'");
db_query("DELETE FROM authmap WHERE uid = '$account->uid'");
@@ -1430,7 +1432,7 @@ function user_admin_edit($edit = array()) {
** Display user form:
*/
- $output .= form_item("User ID", check_output($account->uid));
+ $output .= form_item(t("User ID"), check_output($account->uid));
$output .= form_textfield(t("Username"), "name", $account->name, 30, 55, t("Your full name or your prefered username: only letters, numbers and spaces are allowed."));
$output .= form_textfield(t("E-mail address"), "mail", $account->mail, 30, 55, t("Insert a valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail."));
@@ -1449,11 +1451,11 @@ function user_admin_edit($edit = array()) {
$output .= form_select(t("Timezone"), "timezone", $account->timezone, $zones, t("Select what time you currently have and your timezone settings will be set appropriate."));
$output .= form_select(t("Language"), "language", $account->language, $languages, t("Selecting a different language will change the language of the site."));
$output .= form_item(t("Password"), "<input type=\"password\" name=\"edit[pass1]\" size=\"12\" maxlength=\"24\" /> <input type=\"password\" name=\"edit[pass2]\" size=\"12\" maxlength=\"24\" />", t("Enter a new password twice if you want to change the current password for this user or leave it blank if you are happy with the current password."));
- $output .= form_select("Status", "status", $account->status, array("blocked", "active"));
- $output .= form_select("Role", "rid", $account->rid, user_roles(1));
+ $output .= form_select(t("Status"), "status", $account->status, array("blocked", "active"));
+ $output .= form_select(t("Role"), "rid", $account->rid, user_roles(1));
- $output .= form_submit("Save account");
- $output .= form_submit("Delete account");
+ $output .= form_submit(t("Save account"));
+ $output .= form_submit(t("Delete account"));
$output = form($output);
@@ -1482,7 +1484,7 @@ function user_admin_account() {
$output .= "<small>". implode(" :: ", $links) ."</small><hr />";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
- $output .= " <tr><th>username</th><th>last access</th><th>operations</th></tr>";
+ $output .= " <tr><th>" . t("username") . "</th><th>" . t("last access") . "</th><th>" . t("operations") . "</th></tr>";
while ($account = db_fetch_object($result)) {
$output .= " <tr><td>". format_name($account) ."</td><td>". format_date($account->timestamp, "small") ."</td><td align=\"center\">". la(t("edit account"), array("mod" => "user", "op" => "edit", "id" => $account->uid)) ."</td></tr>";
}
@@ -1536,32 +1538,32 @@ function user_admin() {
case "search":
print search_type("user", drupal_url(array("mod" => "user", "op" => "search"), "admin"));
break;
- case "Save configuration":
- case "Reset to defaults":
+ case t("Save configuration"):
+ case t("Reset to defaults"):
case "settings":
print user_admin_settings($edit);
break;
- case "Add rule":
- case "Check":
+ case t("Add rule"):
+ case t("Check"):
case "access":
print user_admin_access($edit);
break;
- case "Save permissions":
+ case t("Save permissions"):
case "permission":
print user_admin_perm($edit);
break;
- case "Create account":
+ case t("Create account"):
case "create":
print user_admin_create($edit);
break;
- case "Add role":
- case "Delete role":
- case "Save role":
+ case t("Add role"):
+ case t("Delete role"):
+ case t("Save role"):
case "role":
print user_admin_role($edit);
break;
- case "Delete account":
- case "Save account":
+ case t("Delete account"):
+ case t("Save account"):
case "edit":
print user_admin_edit($edit);
break;
diff --git a/modules/user/user.module b/modules/user/user.module
index 70064130d..23fc80a4a 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -952,6 +952,7 @@ function user_edit($edit = array()) {
foreach (theme_list() as $key => $value) {
$options .= "<option value=\"$key\"". (($edit["theme"] == $key) ? " selected=\"selected\"" : "") .">$key - $value->description</option>\n";
}
+
$output .= form_item(t("Theme"), "<select name=\"edit[theme]\">$options</select>", t("Selecting a different theme will change the look and feel of the site."));
for ($zone = -43200; $zone <= 46800; $zone += 3600) $zones[$zone] = date("l, F dS, Y - h:i A", time() - date("Z") + $zone) ." (GMT ". $zone / 3600 .")";
$output .= form_select(t("Timezone"), "timezone", $edit["timezone"], $zones, t("Select what time you currently have and your timezone settings will be set appropriate."));
@@ -1096,13 +1097,14 @@ function user_conf_options() {
$output .= form_textarea("Welcome e-mail body", "user_mail_welcome_body", variable_get("user_mail_welcome_body", t("%username,\n\nThank you for registering at %site. You may now login to %uri". drupal_url(array("mod" => "user", "op" => "login"), "module") ." using the following username and password:\n\nusername: %username\npassword: %password\n\nAfter logging in, you may wish to change your password at %uri". drupal_url(array("mod" => "user", "op" => "edit"), "module") ."\n\nYour new %site membership also enables to you to login to other Drupal powered websites (e.g. http://www.drop.org/) without registering. Just use the following Drupal ID and password:\n\nDrupal ID: %username@%uri_brief\npassword: %password\n\n\n-- %site team")), 70, 10, "Customize the body of the welcome e-mail, which is sent to new members upon registering. Available variables are: %username, %site, %password, %uri, %uri_brief, %mailto");
$output .= form_textfield("Forgotten password e-mail subject", "user_mail_pass_subject", variable_get("user_mail_pass_subject", t("Replacement login information for %username at %site")), 80, 180, "Customize the Subject of your forgotten password e-mail. Available variables are: %username, %site, %password, %uri, %uri_brief, %mailto, %date");
$output .= form_textarea("Forgotten password e-mail body", "user_mail_pass_body", variable_get("user_mail_pass_body", t("%username,\n\nHere is your new password for %site. You may now login to %uri". drupal_url(array("mod" => "user", "op" => "login"), "module") ." using the following username and password:\n\nusername: %username\npassword: %password\n\nAfter logging in, you may wish to change your password at %uri". drupal_url(array("mod" => "user", "op" => "edit"), "module") ."\n\nYour new %site membership also enables to you to login to other Drupal powered websites (e.g. http://www.drop.org/) without registering. Just use the following Drupal ID and password:\n\nDrupal ID: %username@%uri_brief\npassword: %password\n\n\n-- %site team")), 70, 10, "Customize the body of the forgotten password e-mail. Available variables are: %username, %site, %password, %uri, %uri_brief, %mailto");
+
return $output;
}
function user_admin_settings($edit = array()) {
global $op;
- if ($op == "Save configuration") {
+ if ($op == t("Save configuration")) {
/*
** Save the configuration options:
*/
@@ -1110,7 +1112,7 @@ function user_admin_settings($edit = array()) {
foreach ($edit as $name => $value) variable_set($name, $value);
}
- if ($op == "Reset to defaults") {
+ if ($op == t("Reset to defaults")) {
/*
** Reset the configuration options to their default value:
*/
@@ -1119,8 +1121,8 @@ function user_admin_settings($edit = array()) {
}
$output .= user_conf_options();
- $output .= form_submit("Save configuration");
- $output .= form_submit("Reset to defaults");
+ $output .= form_submit(t("Save configuration"));
+ $output .= form_submit(t("Reset to defaults"));
return form($output);
@@ -1160,10 +1162,10 @@ function user_admin_create($edit = array()) {
$output .= theme_invoke("theme_error", check_output($error));
}
- $output .= form_textfield("Username", "name", $edit["name"], 30, 55);
- $output .= form_textfield("E-mail address", "mail", $edit["mail"], 30, 55);
- $output .= form_textfield("Password", "pass", $edit["pass"], 30, 55);
- $output .= form_submit("Create account");
+ $output .= form_textfield(t("Username"), "name", $edit["name"], 30, 55, t("Provide the username of the new account."));
+ $output .= form_textfield(t("E-mail address"), "mail", $edit["mail"], 30, 55, t("Provide the e-mail address associated with the new account."));
+ $output .= form_textfield(t("Password"), "pass", $edit["pass"], 30, 55, t("Provide a password for the new account."));
+ $output .= form_submit(t("Create account"));
return form($output);
}
@@ -1175,17 +1177,17 @@ function user_admin_access($edit = array()) {
$output .= "<small>". la(t("e-mail rules"), array("mod" => "user", "op" => "access", "type" => "mail")) ." :: ". la(t("username rules"), array("mod" => "user", "op" => "access", "type" => "user")) ."</small><hr />"; // irc rules, too!
if ($type != "user") {
- $output .= "<h3>E-mail rules</h3>";
+ $output .= "<h3>" . t("E-mail rules") . "</h3>";
$type = "mail";
}
else {
- $output .= "<h3>Username rules</h3>";
+ $output .= "<h3>" . t("Username rules") . "</h3>";
}
- if ($op == "Add rule") {
+ if ($op == t("Add rule")) {
db_query("INSERT INTO access (mask, type, status) VALUES ('%s', '%s', '%s')", $edit["mask"], $type, $edit["status"]);
}
- else if ($op == "Check") {
+ else if ($op == t("Check")) {
if (user_deny($type, $edit["test"])) {
$message = "<b>'". $edit["test"] ."' is not allowed.</b><p />";
}
@@ -1198,32 +1200,32 @@ function user_admin_access($edit = array()) {
}
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
- $output .= " <tr><th>type</th><th>mask</th><th>operations</th></tr>";
+ $output .= " <tr><th>" . t("type") . "</th><th>" . t("mask") . "</th><th>" . t("operations") . "</th></tr>";
$result = db_query("SELECT * FROM access WHERE type = '%s' AND status = '1' ORDER BY mask", $type);
while ($rule = db_fetch_object($result)) {
- $output .= "<tr><td align=\"center\">allow</td><td>". check_output($rule->mask) ."</td><td>". la(t("delete rule"), array("mod" => "user", "op" => "access", "type" => $type, "id" => $rule->aid)) ."</td></tr>";
+ $output .= "<tr><td align=\"center\">" . t("Allow") . "</td><td>". check_output($rule->mask) ."</td><td>". la(t("delete rule"), array("mod" => "user", "op" => "access", "type" => $type, "id" => $rule->aid)) ."</td></tr>";
}
$result = db_query("SELECT * FROM access WHERE type = '%s' AND status = '0' ORDER BY mask", $type);
while ($rule = db_fetch_object($result)) {
- $output .= "<tr><td align=\"center\">deny</td><td>". check_output($rule->mask) ."</td><td>". la(t("delete rule"), array("mod" => "user", "op" => "access", "type" => $type, "id" => $rule->aid)). "</td></tr>";
+ $output .= "<tr><td align=\"center\">" . t("Deny") . "</td><td>". check_output($rule->mask) ."</td><td>". la(t("delete rule"), array("mod" => "user", "op" => "access", "type" => $type, "id" => $rule->aid)). "</td></tr>";
}
- $output .= " <tr><td><select name=\"edit[status]\"><option value=\"1\">allow</option><option value=\"0\">deny</option></select></td><td><input size=\"32\" maxlength=\"64\" name=\"edit[mask]\" /></td><td><input type=\"submit\" name=\"op\" value=\"Add rule\" /></td></tr>";
+ $output .= " <tr><td><select name=\"edit[status]\"><option value=\"1\">" . t("Allow") . "</option><option value=\"0\">" . t("Deny") . "</option></select></td><td><input size=\"32\" maxlength=\"64\" name=\"edit[mask]\" /></td><td><input type=\"submit\" name=\"op\" value=\"" . t("Add rule") . "\" /></td></tr>";
$output .= "</table>";
- $output .= "<p><small>%: matches any number of characters, even zero characters.<br />_: matches exactly one character.</small></p>";
+ $output .= "<p><small>%: " . t("Matches any number of characters, even zero characters") . ".<br />_: " . t("Matches exactly one character.") . "</small></p>";
if ($type != "user") {
- $output .= "<h3>Check e-mail address</h3>";
+ $output .= "<h3>" . t("Check e-mail address") . "</h3>";
}
else {
- $output .= "<h3>Check username</h3>";
+ $output .= "<h3>" . t("Check username") . "</h3>";
}
- $output .= "$message<input size=\"32\" maxlength=\"64\" name=\"edit[test]\" value=\"". $edit["test"] ."\" /><input type=\"submit\" name=\"op\" value=\"Check\" />";
+ $output .= "$message<input size=\"32\" maxlength=\"64\" name=\"edit[test]\" value=\"". $edit["test"] ."\" /><input type=\"submit\" name=\"op\" value=\"" . t("Check") . "\" />";
return form($output);
}
@@ -1305,7 +1307,7 @@ function user_admin_perm($edit = array()) {
}
$output .= "</table>";
$output .= form_hidden("tid", $tid);
- $output .= form_submit("Save permissions");
+ $output .= form_submit(t("Save permissions"));
return form($output);
@@ -1314,14 +1316,14 @@ function user_admin_perm($edit = array()) {
function user_admin_role($edit = array()) {
global $op, $id;
- if ($op == "Save role") {
+ if ($op == t("Save role")) {
db_query("UPDATE role SET name = '%s' WHERE rid = '%s'", $edit["name"], $id);
}
- else if ($op == "Delete role") {
+ else if ($op == t("Delete role")) {
db_query("DELETE FROM role WHERE rid = '%s'", $id);
db_query("DELETE FROM permission WHERE rid = '%s'", $id);
}
- else if ($op == "Add role") {
+ else if ($op == t("Add role")) {
db_query("INSERT INTO role (name) VALUES ('%s')", $edit["name"]);
}
else if ($id) {
@@ -1331,9 +1333,9 @@ function user_admin_role($edit = array()) {
$role = db_fetch_object(db_query("SELECT * FROM role WHERE rid = '%s'", $id));
- $output .= form_textfield("Role name", "name", $role->name, 32, 64, "The name for this role. Example: 'moderator', 'editorial board', 'site architect'.");
- $output .= form_submit("Save role");
- $output .= form_submit("Delete role");
+ $output .= form_textfield(t("Role name"), "name", $role->name, 32, 64, t("The name for this role. Example: 'moderator', 'editorial board', 'site architect'."));
+ $output .= form_submit(t("Save role"));
+ $output .= form_submit(t("Delete role"));
$output = form($output);
}
@@ -1350,7 +1352,7 @@ function user_admin_role($edit = array()) {
while ($role = db_fetch_object($result)) {
$output .= "<tr><td>". check_output($role->name) ."</td><td>". la(t("edit role"), array("mod" => "user", "op" => "role", "id" => $role->rid)) ."</td></tr>";
}
- $output .= " <tr><td><input size=\"32\" maxlength=\"64\" name=\"edit[name]\" /></td><td><input type=\"submit\" name=\"op\" value=\"Add role\" /></td></tr>";
+ $output .= " <tr><td><input size=\"32\" maxlength=\"64\" name=\"edit[name]\" /></td><td><input type=\"submit\" name=\"op\" value=\"" . t("Add role") . "\" /></td></tr>";
$output .= "</table>";
$output = form($output);
@@ -1364,7 +1366,7 @@ function user_admin_edit($edit = array()) {
if ($account = user_load(array("uid" => $id))) {
- if ($op == "Save account") {
+ if ($op == t("Save account")) {
foreach (module_list() as $module) {
if (module_hook($module, "user")) {
$result = module_invoke($module, "user", "edit_validate", $edit, $account);
@@ -1415,7 +1417,7 @@ function user_admin_edit($edit = array()) {
$output .= theme_invoke("theme_error", check_output($error));
}
}
- else if ($op == "Delete account") {
+ else if ($op == t("Delete account")) {
if ($edit["status"] == 0) {
db_query("DELETE FROM users WHERE uid = '$account->uid'");
db_query("DELETE FROM authmap WHERE uid = '$account->uid'");
@@ -1430,7 +1432,7 @@ function user_admin_edit($edit = array()) {
** Display user form:
*/
- $output .= form_item("User ID", check_output($account->uid));
+ $output .= form_item(t("User ID"), check_output($account->uid));
$output .= form_textfield(t("Username"), "name", $account->name, 30, 55, t("Your full name or your prefered username: only letters, numbers and spaces are allowed."));
$output .= form_textfield(t("E-mail address"), "mail", $account->mail, 30, 55, t("Insert a valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail."));
@@ -1449,11 +1451,11 @@ function user_admin_edit($edit = array()) {
$output .= form_select(t("Timezone"), "timezone", $account->timezone, $zones, t("Select what time you currently have and your timezone settings will be set appropriate."));
$output .= form_select(t("Language"), "language", $account->language, $languages, t("Selecting a different language will change the language of the site."));
$output .= form_item(t("Password"), "<input type=\"password\" name=\"edit[pass1]\" size=\"12\" maxlength=\"24\" /> <input type=\"password\" name=\"edit[pass2]\" size=\"12\" maxlength=\"24\" />", t("Enter a new password twice if you want to change the current password for this user or leave it blank if you are happy with the current password."));
- $output .= form_select("Status", "status", $account->status, array("blocked", "active"));
- $output .= form_select("Role", "rid", $account->rid, user_roles(1));
+ $output .= form_select(t("Status"), "status", $account->status, array("blocked", "active"));
+ $output .= form_select(t("Role"), "rid", $account->rid, user_roles(1));
- $output .= form_submit("Save account");
- $output .= form_submit("Delete account");
+ $output .= form_submit(t("Save account"));
+ $output .= form_submit(t("Delete account"));
$output = form($output);
@@ -1482,7 +1484,7 @@ function user_admin_account() {
$output .= "<small>". implode(" :: ", $links) ."</small><hr />";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
- $output .= " <tr><th>username</th><th>last access</th><th>operations</th></tr>";
+ $output .= " <tr><th>" . t("username") . "</th><th>" . t("last access") . "</th><th>" . t("operations") . "</th></tr>";
while ($account = db_fetch_object($result)) {
$output .= " <tr><td>". format_name($account) ."</td><td>". format_date($account->timestamp, "small") ."</td><td align=\"center\">". la(t("edit account"), array("mod" => "user", "op" => "edit", "id" => $account->uid)) ."</td></tr>";
}
@@ -1536,32 +1538,32 @@ function user_admin() {
case "search":
print search_type("user", drupal_url(array("mod" => "user", "op" => "search"), "admin"));
break;
- case "Save configuration":
- case "Reset to defaults":
+ case t("Save configuration"):
+ case t("Reset to defaults"):
case "settings":
print user_admin_settings($edit);
break;
- case "Add rule":
- case "Check":
+ case t("Add rule"):
+ case t("Check"):
case "access":
print user_admin_access($edit);
break;
- case "Save permissions":
+ case t("Save permissions"):
case "permission":
print user_admin_perm($edit);
break;
- case "Create account":
+ case t("Create account"):
case "create":
print user_admin_create($edit);
break;
- case "Add role":
- case "Delete role":
- case "Save role":
+ case t("Add role"):
+ case t("Delete role"):
+ case t("Save role"):
case "role":
print user_admin_role($edit);
break;
- case "Delete account":
- case "Save account":
+ case t("Delete account"):
+ case t("Save account"):
case "edit":
print user_admin_edit($edit);
break;
diff --git a/modules/watchdog.module b/modules/watchdog.module
index d4e7b654e..ff2473dda 100644
--- a/modules/watchdog.module
+++ b/modules/watchdog.module
@@ -26,8 +26,8 @@ function watchdog_link($type) {
}
function watchdog_conf_options() {
- $period = array(3600 => format_interval(3600), 10800 => format_interval(10800), 21600 => format_interval(21600), 32400 => format_interval(32400), 43200 => format_interval(43200), 86400 => format_interval(86400), 172800 => format_interval(172800), 259200 => format_interval(259200), 604800 => format_interval(604800), 1209600 => format_interval(1209600), 2419200 => format_interval(2419200), 1000000000 => "Never");
- $output .= form_select("Discard entries older than", "watchdog_clear", variable_get("watchdog_clear", 604800), $period, "The time watchdog entries should be kept. Older entries will be automatically discarded. Requires crontab.");
+ $period = array(3600 => format_interval(3600), 10800 => format_interval(10800), 21600 => format_interval(21600), 32400 => format_interval(32400), 43200 => format_interval(43200), 86400 => format_interval(86400), 172800 => format_interval(172800), 259200 => format_interval(259200), 604800 => format_interval(604800), 1209600 => format_interval(1209600), 2419200 => format_interval(2419200), 1000000000 => t("Never"));
+ $output .= form_select(t("Discard entries older than"), "watchdog_clear", variable_get("watchdog_clear", 604800), $period, t("The time watchdog entries should be kept. Older entries will be automatically discarded. Requires crontab."));
return $output;
}
@@ -42,7 +42,7 @@ function watchdog_overview($type) {
$result = db_query("SELECT w.*, u.name, u.uid FROM watchdog w LEFT JOIN users u ON w.uid = u.uid ". ($type ? $query[$type] : "") ." ORDER BY timestamp DESC LIMIT 1000");
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
- $output .= " <tr><th>date</th><th>message</th><th>user</th><th>operations</th></tr>";
+ $output .= " <tr><th>" . t("date") . "</th><th>" . t("message") . "</th><th>" . t("user") . "</th><th>" . t("operations") . "</th></tr>";
while ($watchdog = db_fetch_object($result)) {
if ($background = $color[$watchdog->type]) {
$output .= " <tr bgcolor=\"$background\"><td>". format_date($watchdog->timestamp, "small") ."</td><td>". substr(check_output($watchdog->message), 0, 64) ."</td><td align=\"center\">". format_name($watchdog) ."</a></td><td align=\"center\">". la(t("details"), array("mod" => "watchdog", "op" => "view", "id" => $watchdog->wid)) ."</td></tr>";
@@ -58,12 +58,12 @@ function watchdog_view($id) {
if ($watchdog = db_fetch_object($result)) {
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
- $output .= " <tr><th>Type:</th><td>". check_output($watchdog->type) ."</td></tr>";
- $output .= " <tr><th>Date:</th><td>". format_date($watchdog->timestamp, "large") ."</td></tr>";
- $output .= " <tr><th>User:</th><td>". format_name($watchdog) ."</td></tr>";
- $output .= " <tr><th>Location:</th><td>". check_output($watchdog->location) ."</td></tr>";
- $output .= " <tr><th>Message:</th><td>". check_output($watchdog->message) ."</td></tr>";
- $output .= " <tr><th>Hostname:</th><td>". check_output($watchdog->hostname) ."</td></tr>";
+ $output .= " <tr><th>" . t("Type") . ":" . "</th><td>". check_output($watchdog->type) ."</td></tr>";
+ $output .= " <tr><th>" . t("Date") . ":" . "</th><td>". format_date($watchdog->timestamp, "large") ."</td></tr>";
+ $output .= " <tr><th>" . t("User") . ":" . "</th><td>". format_name($watchdog) ."</td></tr>";
+ $output .= " <tr><th>" . t("Location") . ":" . "</th><td>". check_output($watchdog->location) ."</td></tr>";
+ $output .= " <tr><th>" . t("Message") . ":" . "</th><td>". check_output($watchdog->message) ."</td></tr>";
+ $output .= " <tr><th>" . t("Hostname") . ":" . "</th><td>". check_output($watchdog->hostname) ."</td></tr>";
$output .= "</table>";
return $output;
diff --git a/modules/watchdog/watchdog.module b/modules/watchdog/watchdog.module
index d4e7b654e..ff2473dda 100644
--- a/modules/watchdog/watchdog.module
+++ b/modules/watchdog/watchdog.module
@@ -26,8 +26,8 @@ function watchdog_link($type) {
}
function watchdog_conf_options() {
- $period = array(3600 => format_interval(3600), 10800 => format_interval(10800), 21600 => format_interval(21600), 32400 => format_interval(32400), 43200 => format_interval(43200), 86400 => format_interval(86400), 172800 => format_interval(172800), 259200 => format_interval(259200), 604800 => format_interval(604800), 1209600 => format_interval(1209600), 2419200 => format_interval(2419200), 1000000000 => "Never");
- $output .= form_select("Discard entries older than", "watchdog_clear", variable_get("watchdog_clear", 604800), $period, "The time watchdog entries should be kept. Older entries will be automatically discarded. Requires crontab.");
+ $period = array(3600 => format_interval(3600), 10800 => format_interval(10800), 21600 => format_interval(21600), 32400 => format_interval(32400), 43200 => format_interval(43200), 86400 => format_interval(86400), 172800 => format_interval(172800), 259200 => format_interval(259200), 604800 => format_interval(604800), 1209600 => format_interval(1209600), 2419200 => format_interval(2419200), 1000000000 => t("Never"));
+ $output .= form_select(t("Discard entries older than"), "watchdog_clear", variable_get("watchdog_clear", 604800), $period, t("The time watchdog entries should be kept. Older entries will be automatically discarded. Requires crontab."));
return $output;
}
@@ -42,7 +42,7 @@ function watchdog_overview($type) {
$result = db_query("SELECT w.*, u.name, u.uid FROM watchdog w LEFT JOIN users u ON w.uid = u.uid ". ($type ? $query[$type] : "") ." ORDER BY timestamp DESC LIMIT 1000");
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
- $output .= " <tr><th>date</th><th>message</th><th>user</th><th>operations</th></tr>";
+ $output .= " <tr><th>" . t("date") . "</th><th>" . t("message") . "</th><th>" . t("user") . "</th><th>" . t("operations") . "</th></tr>";
while ($watchdog = db_fetch_object($result)) {
if ($background = $color[$watchdog->type]) {
$output .= " <tr bgcolor=\"$background\"><td>". format_date($watchdog->timestamp, "small") ."</td><td>". substr(check_output($watchdog->message), 0, 64) ."</td><td align=\"center\">". format_name($watchdog) ."</a></td><td align=\"center\">". la(t("details"), array("mod" => "watchdog", "op" => "view", "id" => $watchdog->wid)) ."</td></tr>";
@@ -58,12 +58,12 @@ function watchdog_view($id) {
if ($watchdog = db_fetch_object($result)) {
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
- $output .= " <tr><th>Type:</th><td>". check_output($watchdog->type) ."</td></tr>";
- $output .= " <tr><th>Date:</th><td>". format_date($watchdog->timestamp, "large") ."</td></tr>";
- $output .= " <tr><th>User:</th><td>". format_name($watchdog) ."</td></tr>";
- $output .= " <tr><th>Location:</th><td>". check_output($watchdog->location) ."</td></tr>";
- $output .= " <tr><th>Message:</th><td>". check_output($watchdog->message) ."</td></tr>";
- $output .= " <tr><th>Hostname:</th><td>". check_output($watchdog->hostname) ."</td></tr>";
+ $output .= " <tr><th>" . t("Type") . ":" . "</th><td>". check_output($watchdog->type) ."</td></tr>";
+ $output .= " <tr><th>" . t("Date") . ":" . "</th><td>". format_date($watchdog->timestamp, "large") ."</td></tr>";
+ $output .= " <tr><th>" . t("User") . ":" . "</th><td>". format_name($watchdog) ."</td></tr>";
+ $output .= " <tr><th>" . t("Location") . ":" . "</th><td>". check_output($watchdog->location) ."</td></tr>";
+ $output .= " <tr><th>" . t("Message") . ":" . "</th><td>". check_output($watchdog->message) ."</td></tr>";
+ $output .= " <tr><th>" . t("Hostname") . ":" . "</th><td>". check_output($watchdog->hostname) ."</td></tr>";
$output .= "</table>";
return $output;