diff --git a/account.php b/account.php
index e886b2c2b5f..65085f1f6ff 100644
--- a/account.php
+++ b/account.php
@@ -8,18 +8,18 @@ function account_get_user($uname) {
}
function account_email() {
- $output .= "
Lost your password? Fill out your username and e-mail address, and your password will be mailed to you.
\n";
+ $output .= "
". t("Lost your password? Fill out your username and e-mail address, and your password will be mailed to you.") ."
\n";
$output .= "\n";
@@ -30,22 +30,16 @@ function account_create($user = "", $error = "") {
global $theme;
if ($error) $output .= "Failed to create account:$error\n";
- else $output .= "
Registering allows you to comment on stories, to moderate comments and pending stories, to customize the look and feel of the site and generally helps you interact with the site more efficiently.
To create an account, simply fill out this form an click the `Create account' button below. An e-mail will then be sent to you with instructions on how to validate your account.
\n";
+ else $output .= "
". t("Registering allows you to comment on stories, to moderate comments and pending stories, to customize the look and feel of the site and generally helps you interact with the site more efficiently.") ."
". t("To create an account, simply fill out this form an click the 'Create account' button below. An e-mail will then be sent to you with instructions on how to validate your account.") ."
\n";
$output .= "\n";
return $output;
@@ -78,42 +72,42 @@ function account_user_edit() {
if ($user->id) {
// Generate output/content:
$output .= "\n";
// Display output/content:
$theme->header();
- $theme->box("Edit user information", $output);
+ $theme->box(t("Edit user information"), $output);
$theme->footer();
}
else {
$theme->header();
- $theme->box("Create user account", account_create());
- $theme->box("E-mail password", account_email());
+ $theme->box(t("Create user account"), account_create());
+ $theme->box(t("E-mail new password"), account_email());
$theme->footer();
}
}
@@ -139,52 +133,40 @@ function account_site_edit() {
if ($user->id) {
$output .= "\n";
$theme->header();
- $theme->box("Edit your preferences", $output);
+ $theme->box(t("Edit your preferences"), $output);
$theme->footer();
}
else {
$theme->header();
- $theme->box("Create user account", account_create());
- $theme->box("E-mail password", account_email());
+ $theme->box(t("Create user account"), account_create());
+ $theme->box(t("E-mail new password"), account_email());
$theme->footer();
}
}
@@ -208,27 +190,24 @@ function account_content_edit() {
if ($user->id) {
$output .= "\n";
$theme->header();
- $theme->box("Edit your content", $output);
+ $theme->box(t("Edit your content"), $output);
$theme->footer();
}
else {
$theme->header();
- $theme->box("Create user account", account_create());
- $theme->box("E-mail password", account_email());
+ $theme->box(t("Create user account"), account_create());
+ $theme->box(t("E-mail new password"), account_email());
$theme->footer();
}
}
@@ -255,11 +234,11 @@ function account_user($uname) {
if ($user->id && $user->userid == $uname) {
$output .= "
\n";
$result = db_query("SELECT c.cid, c.pid, c.lid, c.subject, c.timestamp, s.subject AS story FROM comments c LEFT JOIN users u ON u.id = c.author LEFT JOIN stories s ON s.id = c.lid WHERE u.userid = '$uname' AND s.status = 2 AND c.link = 'story' AND s.timestamp > ". (time() - 1209600) ." ORDER BY cid DESC LIMIT 10");
while ($comment = db_fetch_object($result)) {
$block2 .= "
\n";
$comments++;
@@ -288,16 +267,16 @@ function account_user($uname) {
// Display account information:
$theme->header();
- if ($block1) $theme->box("User information for $uname", $block1);
- if ($block2) $theme->box("$uname has posted ". format_plural($comments, "comment", "comments") ." recently", $block2);
+ if ($block1) $theme->box(strtr(t("%s's user information"), array("%s" => $uname)), $block1);
+ if ($block2) $theme->box(strtr(t("%a has posted %b recently"), array("%a" => $uname, "%b" => format_plural($comments, "comment", "comments"))), $block2);
module_iterate("module", $uname);
$theme->footer();
}
else {
// Display login form:
$theme->header();
- $theme->box("Create user account", account_create());
- $theme->box("E-mail password", account_email());
+ $theme->box(t("Create user account"), account_create());
+ $theme->box(t("E-mail new password"), account_email());
$theme->footer();
}
}
@@ -306,17 +285,17 @@ function account_validate($user) {
global $type2index;
// Verify username and e-mail address:
- if (empty($user[real_email]) || (!eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$", $user[real_email]))) $error .= "
the specified e-mail address is not valid.
\n";
- if (empty($user[userid]) || (ereg("[^a-zA-Z0-9_-]", $user[userid]))) $error .= "
the specified username is not valid.
\n";
- if (strlen($user[userid]) > 15) $error .= "
the specified username is too long: it must be less than 15 characters.
\n";
+ if (empty($user[real_email]) || (!eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$", $user[real_email]))) $error .= "
". t("the specified e-mail address is not valid") .".
\n";
+ if (empty($user[userid]) || (ereg("[^a-zA-Z0-9_-]", $user[userid]))) $error .= "
". t("the specified username is not valid") .".
\n";
+ if (strlen($user[userid]) > 15) $error .= "
". t("the specified username is too long: it must be less than 15 characters") .".
\n";
// Check to see whether the username or e-mail address are banned:
- if ($ban = ban_match($user[userid], $type2index[usernames])) $error .= "
the specified username is banned for the following reason: $ban->reason.
\n";
- if ($ban = ban_match($user[real_email], $type2index[addresses])) $error .= "
the specified e-mail address is banned for the following reason: $ban->reason.
\n";
+ if ($ban = ban_match($user[userid], $type2index[usernames])) $error .= "
". t("the specified username is banned for the following reason") .": $ban->reason.
\n";
+ if ($ban = ban_match($user[real_email], $type2index[addresses])) $error .= "
". t("the specified e-mail address is banned for the following reason") .": $ban->reason.
\n";
// Verify whether username and e-mail address are unique:
- if (db_num_rows(db_query("SELECT userid FROM users WHERE LOWER(userid) = LOWER('$user[userid]')")) > 0) $error .= "
the specified username is already taken.
\n";
- if (db_num_rows(db_query("SELECT real_email FROM users WHERE LOWER(real_email)=LOWER('$user[real_email]')")) > 0) $error .= "
the specified e-mail address is already registered.
\n";
+ if (db_num_rows(db_query("SELECT userid FROM users WHERE LOWER(userid) = LOWER('$user[userid]')")) > 0) $error .= "
". t("the specified username is already taken") .".
\n";
+ if (db_num_rows(db_query("SELECT real_email FROM users WHERE LOWER(real_email)=LOWER('$user[real_email]')")) > 0) $error .= "
". t("the specified e-mail address is already registered") .".
\n";
return $error;
}
@@ -328,8 +307,8 @@ function account_email_submit($userid, $email) {
if ($account = db_fetch_object($result)) {
$passwd = account_password();
- $status = 1;
$hash = substr(md5("$userid. ". time() .""), 0, 12);
+ $status = 1;
db_query("UPDATE users SET passwd = PASSWORD('$passwd'), hash = '$hash', status = '$status' WHERE userid = '$userid'");
@@ -344,11 +323,11 @@ function account_email_submit($userid, $email) {
}
else {
watchdog("warning", "new password: '$userid' and <$email> do not match");
- $output = "Could not sent password: no match for the specified username and e-mail address.";
+ $output = t("Could not sent password: no match for the specified username and e-mail address.");
}
$theme->header();
- $theme->box("E-mail password", $output);
+ $theme->box(t("E-mail new password"), $output);
$theme->footer();
}
@@ -360,7 +339,7 @@ function account_create_submit($userid, $email) {
if ($error = account_validate($new)) {
$theme->header();
- $theme->box("Create user account", account_create($new, $error));
+ $theme->box(t("Create user account"), account_create($new, $error));
$theme->footer();
}
else {
@@ -378,7 +357,7 @@ function account_create_submit($userid, $email) {
mail($new[real_email], "Account details for $site_name", $message, "From: noreply");
$theme->header();
- $theme->box("Create user account", "Congratulations! Your member account has been successfully created and further instructions on how to activate your account have been sent to your e-mail address.");
+ $theme->box(t("Create user account"), t("Congratulations! Your member account has been successfully created and further instructions on how to activate your account have been sent to your e-mail address."));
$theme->footer();
}
}
@@ -411,7 +390,7 @@ function account_create_confirm($name, $hash) {
}
$theme->header();
- $theme->box("Account confirmation", $output);
+ $theme->box(t("Create user account"), $output);
$theme->footer();
}
@@ -428,20 +407,18 @@ function account_track_comments() {
$sresult = db_query("SELECT s.id, s.subject, COUNT(s.id) as count FROM comments c LEFT JOIN stories s ON c.lid = s.id WHERE c.author = $user->id GROUP BY s.id DESC LIMIT 5");
while ($story = db_fetch_object($sresult)) {
- $output .= "
\n";
$cresult = db_query("SELECT * FROM comments WHERE author = $user->id AND lid = $story->id");
while ($comment = db_fetch_object($cresult)) {
- $output .= "
\n";
}
$theme->header();
- $theme->box("Track your stories", ($output ? "$output" : "You have not posted any stories.\n"));
+ $theme->box(t("Track your stories"), ($output ? $output : t("You have not posted any stories.")));
$theme->footer();
}
@@ -471,18 +448,18 @@ function account_track_site() {
$sresult = db_query("SELECT s.subject, s.id, COUNT(c.lid) AS count FROM comments c LEFT JOIN stories s ON c.lid = s.id WHERE s.status = 2 AND c.link = 'story' AND ". time() ." - c.timestamp < $period GROUP BY c.lid ORDER BY count DESC LIMIT 10");
while ($story = db_fetch_object($sresult)) {
- $output .= "
";
$cresult = db_query("SELECT c.subject, c.cid, c.pid, u.userid FROM comments c LEFT JOIN users u ON u.id = c.author WHERE c.lid = $story->id AND c.link = 'story' ORDER BY timestamp DESC LIMIT $story->count");
$output .= "
\n";
while ($comment = db_fetch_object($cresult)) {
- $output .= "
\n";
}
return $output;
}
@@ -160,7 +161,7 @@ function account_stories($id) {
function account_comments($id) {
$result = db_query("SELECT * FROM comments WHERE link = 'story' AND author = $id ORDER BY timestamp DESC");
while ($comment = db_fetch_object($result)) {
- $output .= "
\n";
diff --git a/modules/diary.module b/modules/diary.module
index 9eeeadae824..c4939bdcac5 100644
--- a/modules/diary.module
+++ b/modules/diary.module
@@ -33,23 +33,21 @@ function diary_page_overview($num = 20) {
$result = db_query("SELECT d.*, u.userid FROM diaries d LEFT JOIN users u ON d.author = u.id ORDER BY d.timestamp DESC LIMIT $num");
- $output .= "
This part of the website is dedicated to provide easy-to-write and easy-to-read online diaries or journals filled with daily thoughts, poetry, boneless blabber, spiritual theories, intimate details, valuable experiences, cynical rants, semi-coherent comments, writing experiments, artistic babblings, critics on current facts, fresh insights, diverse dreams, chronicles and mumbling madness available for public consumption.
";
+ }
+}
+
+?>
diff --git a/modules/locale/locale.module b/modules/locale/locale.module
new file mode 100644
index 00000000000..645769cd2ea
--- /dev/null
+++ b/modules/locale/locale.module
@@ -0,0 +1,13 @@
+
+
+$module = array("page" => "locale",
+ "admin" => "locale");
+
+function locale() {
+ $result = db_query("SELECT * FROM locales ORDER BY english");
+ while ($locale = db_fetch_object($result)) {
+ print "
". check_output($locale->english) ."
";
+ }
+}
+
+?>
diff --git a/modules/section.module b/modules/section.module
index 2ee5869d94b..af07100f58d 100644
--- a/modules/section.module
+++ b/modules/section.module
@@ -20,7 +20,7 @@ function section_help() {
function section_block() {
$result = db_query("SELECT se.name, COUNT(st.id) AS stories FROM sections se LEFT JOIN stories st ON se.name = st.section GROUP BY se.name");
while ($_section = db_fetch_object($result)) {
- $content .= "
\n";
}
$block[0]["subject"] = "Sections";
diff --git a/scripts/php-clean b/scripts/php-clean
index 39209cf9751..fe5c589d3bb 100644
--- a/scripts/php-clean
+++ b/scripts/php-clean
@@ -1,5 +1,5 @@
#!/bin/sh
find . -name "*~" -type f | xargs rm -f
find . -name "DEADJOE" -type f | xargs rm -f
-find . -name "*" -type f | grep -v ".gif" | grep -v ".jpg" | xargs perl -wi -pe 's/\s+$/\n/'
-find . -name "*" -type f | grep -v ".gif" | grep -v ".jpg" | xargs perl -wi -pe 's/\t/ /g'
+find . -name "*" -type f | grep -v ".gif" | grep -v ".jpg" | grep -v ".tgz" | xargs perl -wi -pe 's/\s+$/\n/'
+find . -name "*" -type f | grep -v ".gif" | grep -v ".jpg" | grep -v ".tgz" | xargs perl -wi -pe 's/\t/ /g'
diff --git a/search.php b/search.php
index 323d1b3e263..77d2ff50ae0 100644
--- a/search.php
+++ b/search.php
@@ -18,8 +18,8 @@ $search .= "\n";
$output = search_data($keys, $type);
$theme->header();
-$theme->box("Search", $search);
-$theme->box("Result", $output);
+$theme->box(t("Search"), $search);
+$theme->box(t("Result"), $output);
$theme->footer();
?>
\ No newline at end of file
diff --git a/submission.php b/submission.php
index 935bc9c0cc2..a00f4abf677 100644
--- a/submission.php
+++ b/submission.php
@@ -9,17 +9,18 @@ function submission_display_main() {
// Perform query:
$result = db_query("SELECT s.*, u.userid FROM stories s LEFT JOIN users u ON s.author = u.id WHERE s.status = 1 ORDER BY s.id");
- $content .= "
Anyone who happens by, and has some news or some thoughts they'd like to share, can submit new content for consideration. After someone has submitted something, their story is added to a queue. All registered users can access this list of pending stories, that is, stories that have been submitted, but do not yet appear on the public front page. Those registered users can vote whether they think the story should be posted or not. When enough people vote to post a story, the story is pushed over the threshold and up it goes on the public page. On the other hand, when too many people voted to drop a story, the story will get trashed.
Basically, this means that you, the community, are truly the editors of this site as you have the final decision on the content of this site. It's you judging the overall quality of a story. But remember, vote on whether the story is interesting, not on whether you agree with it or not. If the story goes up, you can disagree all you want, but don't vote `no' because you think the ideas expressed are wrong. Instead, vote `no' when you think the story is plain boring.
";
+ $content .= "
". t("Anyone who happens by, and has some news or some thoughts they'd like to share, can submit new content for consideration. After someone has submitted something, their story is added to a queue. All registered users can access this list of pending stories, that is, stories that have been submitted, but do not yet appear on the public front page. Those registered users can vote whether they think the story should be posted or not. When enough people vote to post a story, the story is pushed over the threshold and up it goes on the public page. On the other hand, when too many people voted to drop a story, the story will get trashed."). "
";
+ $content .= "
". t("Basically, this means that you, the community, are truly the editors of this site as you have the final decision on the content of this site. It's you judging the overall quality of a story. But remember, vote on whether the story is interesting, not on whether you agree with it or not. If the story goes up, you can disagree all you want, but don't vote `no' because you think the ideas expressed are wrong. Instead, vote `no' when you think the story is plain boring.") ."
";
$content .= "
\n";
- $content .= "
Subject
Section
Date
Author
Score
\n";
+ $content .= "
". t("Subject") ."
". t("Section") ."
". t("Date") ."
". t("Author") ."
". t("Score") ."
\n";
while ($submission = db_fetch_object($result)) {
if ($user->id == $submission->author || user_get_history($user->history, "s$submission->id")) $content .= "
Got some news or some thoughts you would like to share? Fill out this form and they will automatically get whisked away to our submission queue where our moderators will frown at it, poke at it and hopefully post it. Every registered user is automatically a moderator and can vote whether or not your sumbission should be carried to the front page for discussion.
\n";
- $output .= "
Note that we do not revamp or extend your submission so it is up to you to make sure your submission is well-written: if you don't care enough to be clear and complete, your submission is likely to be moderated down by our army of moderators. Try to be complete, aim for clarity, organize and structure your text, and try to carry out your statements with examples. It is also encouraged to extend your submission with arguments that flow from your unique intellectual capability and experience: offer some insight or explanation as to why you think your submission is interesting. Make sure your submission has some meat on it!
\n";
- $output .= "
However, if you have bugs to report, complaints, personal questions or anything besides a public submission, we would prefer you to mail us instead, or your message is likely to get lost.
\n";
+ $output .= "
". t("Got some news or some thoughts you would like to share? Fill out this form and they will automatically get whisked away to our submission queue where our moderators will frown at it, poke at it and hopefully post it. Every registered user is automatically a moderator and can vote whether or not your sumbission should be carried to the front page for discussion.") ."
\n";
+ $output .= "
". t("Note that we do not revamp or extend your submission so it is up to you to make sure your submission is well-written: if you don't care enough to be clear and complete, your submission is likely to be moderated down by our army of moderators. Try to be complete, aim for clarity, organize and structure your text, and try to carry out your statements with examples. It is also encouraged to extend your submission with arguments that flow from your unique intellectual capability and experience: offer some insight or explanation as to why you think your submission is interesting. Make sure your submission has some meat on it!") ."
\n";
+ $output .= "
". t("However, if you have bugs to report, complaints, personal questions or anything besides a public submission, we would prefer you to mail us instead, or your message is likely to get lost.") ."