From 52a1d1bbe80422ca7a8c79dde6fd92db542b9b2d Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 17 Feb 2001 12:59:24 +0000 Subject: - More updates on the translation support --- account.php | 120 ++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 68 insertions(+), 52 deletions(-) (limited to 'account.php') diff --git a/account.php b/account.php index 48be2b2b8..6a2ff7b5f 100644 --- a/account.php +++ b/account.php @@ -10,17 +10,11 @@ function account_get_user($uname) { function account_email() { $output .= "

". t("Lost your password? Fill out your username and e-mail address, and your password will be mailed to you.") ."

\n"; $output .= "
\n"; - $output .= "

\n"; - $output .= " ". t("Username") .":
\n"; - $output .= "
\n"; - $output .= "

\n"; - $output .= "

\n"; - $output .= " ". t("E-mail address") .":
\n"; - $output .= "
\n"; - $output .= "

\n"; - $output .= "

\n"; - $output .= " \n"; - $output .= "

\n"; + $output .= "". t("Username") .":
\n"; + $output .= "

\n"; + $output .= "". t("E-mail address") .":
\n"; + $output .= "

\n"; + $output .= "\n"; $output .= "

\n"; return $output; @@ -29,7 +23,7 @@ function account_email() { function account_create($user = "", $error = "") { global $theme; - if ($error) $output .= "Failed to create account:$error\n"; + if ($error) $output .= "

". t("Failed to create account: $error.") ."

\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"; @@ -39,7 +33,7 @@ function account_create($user = "", $error = "") { $output .= "". t("E-mail address") .":
\n"; $output .= "
\n"; $output .= "". t("You will be sent instructions on how to validate your account via this e-mail address: make sure it is accurate.") ."

\n"; - $output .= "\n"; + $output .= "\n"; $output .= "

\n"; return $output; @@ -72,31 +66,40 @@ function account_user_edit() { if ($user->id) { // Generate output/content: $output .= "
\n"; + $output .= "". t("Username") .":
\n"; $output .= "  $user->userid

\n"; $output .= "". t("Required, unique, and can not be changed.") ."

\n"; + $output .= "". t("Real name") .":
\n"; $output .= "name\">
\n"; - $output .= "". t("Optional.") ."

\n"; + $output .= "". t("Optional") .".

\n"; + $output .= "". t("Real e-mail address") .":
\n"; $output .= "  $user->real_email

\n"; $output .= "". t("Required, unique, can not be changed.") ." ". t("Your real e-mail address is never displayed publicly: only needed in case you lose your password.") ."

\n"; + $output .= "". t("Fake e-mail address") .":
\n"; $output .= "fake_email\">
\n"; - $output .= "". t("Optional.") ." ". t("Displayed publicly so you may spam proof your real e-mail address if you want.") ."

\n"; + $output .= "". t("Optional") .". ". t("Displayed publicly so you may spam proof your real e-mail address if you want.") ."

\n"; + $output .= "". t("Homepage") .":
\n"; $output .= "url\">
\n"; - $output .= "". t("Optional.") ." ". t("Make sure you enter fully qualified URLs only. That is, remember to include \"http://\".") ."

\n"; + $output .= "". t("Optional") .". ". t("Make sure you enter fully qualified URLs only. That is, remember to include \"http://\".") ."

\n"; + $output .= "". t("Bio") .": (". t("maximal 255 characters") .")
\n"; $output .= "
\n"; - $output .= "". t("Optional.") ." ". t("This biographical information is publicly displayed on your user page.") ."
". t("Allowed HTML tags") .": ". htmlspecialchars($allowed_html) .".

\n"; + $output .= "". t("Optional") .". ". t("This biographical information is publicly displayed on your user page.") ."
". t("Allowed HTML tags") .": ". htmlspecialchars($allowed_html) .".

\n"; + $output .= "". t("Signature") .": (". t("maximal 255 characters") .")
\n"; $output .= "
\n"; - $output .= "". t("Optional.") ." ". t("This information will be publicly displayed at the end of your comments.") ."
". t("Allowed HTML tags") .": ". htmlspecialchars($allowed_html) .".

\n"; + $output .= "". t("Optional") .". ". t("This information will be publicly displayed at the end of your comments.") ."
". t("Allowed HTML tags") .": ". htmlspecialchars($allowed_html) .".

\n"; + $output .= "". t("Password") .":
\n"; $output .= "
\n"; $output .= "". t("Enter your new password twice if you want to change your current password or leave it blank if you are happy with your current password.") ."

\n"; - $output .= "
\n"; + + $output .= "
\n"; $output .= "

\n"; // Display output/content: @@ -129,34 +132,46 @@ function account_user_save($edit) { } function account_site_edit() { - global $cmodes, $corder, $theme, $themes, $user; + global $cmodes, $corder, $theme, $themes, $languages, $user; if ($user->id) { $output .= "
\n"; + $output .= "". t("Theme" ) .":
\n"; foreach ($themes as $key=>$value) $options1 .= " \n"; $output .= "
\n"; $output .= "". t("Selecting a different theme will change the look and feel of the site.") ."

\n"; + $output .= "". t("Timezone") .":
\n"; $date = time() - date("Z"); for ($zone = -43200; $zone <= 46800; $zone += 3600) $options2 .= " \n"; $output .= "
\n"; $output .= "". t("Select what time you currently have and your timezone settings will be set appropriate.") ."

\n"; + + $output .= "". t("Language" ) .":
\n"; + foreach ($languages as $key=>$value) $options3 .= " \n"; + $output .= "
\n"; + $output .= "". t("Selecting a different language will change the language the site.") ."

\n"; + $output .= "". t("Maximum number of stories to display") .":
\n"; - for ($stories = 10; $stories <= 30; $stories += 5) $options3 .= "\n"; - $output .= "
\n"; + for ($stories = 10; $stories <= 30; $stories += 5) $options4 .= "\n"; + $output .= "
\n"; $output .= "". t("The maximum number of stories that will be displayed on the main page.") ."

\n"; - foreach ($cmodes as $key=>$value) $options4 .= "\n"; + foreach ($cmodes as $key=>$value) $options5 .= "\n"; + $output .= "". t("Comment display mode") .":
\n"; - $output .= "

\n"; - foreach ($corder as $key=>$value) $options5 .= "\n"; + $output .= "

\n"; + foreach ($corder as $key=>$value) $options6 .= "\n"; + $output .= "". t("Comment sort order") .":
\n"; - $output .= "

\n"; - for ($i = -1; $i < 6; $i++) $options6 .= " "; + $output .= "

\n"; + for ($i = -1; $i < 6; $i++) $options7 .= " "; + $output .= "". t("Comment filter") .":
\n"; - $output .= "
\n"; + $output .= "
\n"; $output .= "". t("Comments that scored less than this threshold setting will be ignored. Anonymous comments start at 0, comments of people logged on start at 1 and moderators can add and subtract points.") ."

\n"; - $output .= "
\n"; + + $output .= "
\n"; $output .= "

\n"; $theme->header(); @@ -177,6 +192,7 @@ function account_site_save($edit) { if ($user->id) { $data[theme] = $edit[theme]; $data[timezone] = $edit[timezone]; + $data[language] = $edit[language]; $data[stories] = $edit[stories]; $data[mode] = $edit[mode]; $data[sort] = $edit[sort]; @@ -197,7 +213,7 @@ function account_content_edit() { $output .= "name]\"". ($entry->user ? " CHECKED" : "") ."> ". t($block->name) ."
\n"; } $output .= "

". t("Enable the blocks you would like to see displayed in the side bars.") ."

\n"; - $output .= "

\n"; + $output .= "\n"; $output .= "\n"; $theme->header(); @@ -243,7 +259,7 @@ function account_user($uname) { // Display account information: $theme->header(); - $theme->box("Personal information", $output); + $theme->box(t("Personal information"), $output); $theme->footer(); } elseif ($uname && $account = account_get_user($uname)) { @@ -285,17 +301,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 .= "
  • ". 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"; + 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"); + if (empty($user[userid]) || (ereg("[^a-zA-Z0-9_-]", $user[userid]))) $error = t("the specified username is not valid"); + if (strlen($user[userid]) > 15) $error = t("the specified username is too long: it must be less than 15 characters"); // Check to see whether the username or e-mail address are banned: - 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"; + if ($ban = ban_match($user[userid], $type2index[usernames])) $error = t("the specified username is banned") .": $ban->reason"; + if ($ban = ban_match($user[real_email], $type2index[addresses])) $error = t("the specified e-mail address is banned") .": $ban->reason."; // 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 .= "
  • ". 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"; + 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"); + 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 used for another account"); return $error; } @@ -463,7 +479,7 @@ function account_track_site() { } $theme->header(); - $theme->box(t("Track $site_name"), $output); + $theme->box(strtr(t("Track %a"), array("%a" => $site_name)), ($output ? $output : t("No comments or stories posted recently."))); $theme->footer(); } @@ -474,31 +490,31 @@ if (strstr($name, " ") || strstr($hash, " ")) { } switch ($op) { - case "Login": - account_session_start($userid, $passwd); - header("Location: account.php?op=info"); - break; - case "E-mail new password": + case t("E-mail new password"): account_email_submit($userid, $email); break; - case "Create account": + case t("Create account"): account_create_submit($userid, $email); break; - case "confirm": - account_create_confirm($name, $hash); - break; - case "Save user information": + case t("Save user information"): account_user_save($edit); account_user($user->userid); break; - case "Save site settings": + case t("Save site settings"): account_site_save($edit); header("Location: account.php?op=info"); break; - case "Save content settings": + case t("Save content settings"): account_content_save($edit); account_user($user->userid); break; + case "confirm": + account_create_confirm($name, $hash); + break; + case "login": + account_session_start($userid, $passwd); + header("Location: account.php?op=info"); + break; case "logout": account_session_close(); header("Location: account.php?op=info"); @@ -540,4 +556,4 @@ switch ($op) { account_user($user->userid); } -?> +?> \ No newline at end of file -- cgit v1.2.3