From 06bb1ff5329b2334896c366f92ecdaa95d891146 Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Tue, 12 Jun 2001 13:34:27 +0000 Subject: [PATCH] Some language var switch overs git-svn-id: file:///svn/phpbb/trunk@478 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/auth.php | 22 +++---- phpBB/language/lang_english.php | 105 +++++++++++++++++++++++--------- phpBB/posting.php | 91 ++++++++++++++------------- phpBB/viewforum.php | 10 +-- 4 files changed, 142 insertions(+), 86 deletions(-) diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index 066088accd..18906ebc34 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -55,7 +55,7 @@ */ function auth($type, $forum_id, $userdata, $f_access = -1) { - global $db; + global $db, $lang; switch($type) { @@ -230,27 +230,27 @@ function auth($type, $forum_id, $userdata, $f_access = -1) { case AUTH_ALL: $auth_user[$key] = 1; - $auth_user[$key . '_type'] = "Anonymous Users"; + $auth_user[$key . '_type'] = $lang['Anonymous_users']; break; case AUTH_REG: $auth_user[$key] = ($userdata['session_logged_in']) ? 1 : 0; - $auth_user[$key . '_type'] = "Registered Users"; + $auth_user[$key . '_type'] = $lang['Registered_Users']; break; case AUTH_ACL: $auth_user[$key] = ($userdata['session_logged_in'] && $num_u_access) ? auth_check_user(AUTH_ACL, $key, $u_access, $is_admin) : 0; - $auth_user[$key . '_type'] = "Users granted special access"; + $auth_user[$key . '_type'] = $lang['Users_granted_access']; break; case AUTH_MOD: $auth_user[$key] = ($userdata['session_logged_in'] && $num_u_access) ? auth_check_user(AUTH_MOD, $key, $u_access, $is_admin) : 0; - $auth_user[$key . '_type'] = "Moderators"; + $auth_user[$key . '_type'] = $lang['Moderators']; break; case AUTH_ADMIN: $auth_user[$key] = $is_admin; - $auth_user[$key . '_type'] = "Administrators"; + $auth_user[$key . '_type'] = $lang['Administrators']; break; default: @@ -269,27 +269,27 @@ function auth($type, $forum_id, $userdata, $f_access = -1) { case AUTH_ALL: $auth_user[$f_forum_id][$key] = 1; - $auth_user[$f_forum_id][$key . '_type'] = "Anonymous Users"; + $auth_user[$f_forum_id][$key . '_type'] = $lang['Anonymous_users']; break; case AUTH_REG: $auth_user[$f_forum_id][$key] = ($userdata['session_logged_in']) ? 1 : 0; - $auth_user[$f_forum_id][$key . '_type'] = "Registered Users"; + $auth_user[$f_forum_id][$key . '_type'] = $lang['Registered_Users']; break; case AUTH_ACL: $auth_user[$f_forum_id][$key] = ($userdata['session_logged_in'] && $num_u_access) ? auth_check_user(AUTH_ACL, $key, $u_access, $is_admin) : 0; - $auth_user[$f_forum_id][$key . '_type'] = "Users granted special access"; + $auth_user[$f_forum_id][$key . '_type'] = $lang['Users_granted_access']; break; case AUTH_MOD: $auth_user[$f_forum_id][$key] = ($userdata['session_logged_in'] && $num_u_access) ? auth_check_user(AUTH_MOD, $key, $u_access, $is_admin) : 0; - $auth_user[$f_forum_id][$key . '_type'] = "Moderators"; + $auth_user[$f_forum_id][$key . '_type'] = $lang['Moderators']; break; case AUTH_ADMIN: $auth_user[$f_forum_id][$key] = $is_admin; - $auth_user[$f_forum_id][$key . '_type'] = "Administrators"; + $auth_user[$f_forum_id][$key . '_type'] = $lang['Administrators']; break; default: diff --git a/phpBB/language/lang_english.php b/phpBB/language/lang_english.php index c9ab6e2bdc..175dd03c7a 100755 --- a/phpBB/language/lang_english.php +++ b/phpBB/language/lang_english.php @@ -6,11 +6,7 @@ * copyright : (C) 2001 The phpBB Group * email : support@phpbb.com * -<<<<<<< lang_english.php * $Id$ -======= - * $Id$ ->>>>>>> 1.42 * * ***************************************************************************/ @@ -23,15 +19,19 @@ * ***************************************************************************/ -// The future format of this file -// will be $lang['message'] = "text"; -// message should be a good representation of -// text (including capitalisation), spaces replaced -// with underscores. Remembering different languages -// treat consecutive words differently(!) // -// The number of phrases should be kept to a minimum -// so we should try and reuse as much as possible. +// The future format of this file will be: +// +// ---> $lang['message'] = "text"; +// +// message should be a GOOD representation of text, including capitalisation +// and underscoring for spacing. Remember different languages often interpret +// consecutive words in different ways, so if you're building a sentence then +// try and indicate what 'words' follow +// +// The number of phrases should be kept to a minimum so we should try and reuse +// as much as possible. +// // // Common, these terms are used @@ -101,7 +101,9 @@ $lang['Usergroups'] = "Usergroups"; $lang['Last_Post'] = "Last Post"; $lang['Moderator'] = "Moderator/s"; +// // Stats block text +// $lang['Posted_Total'] = "Our users have posted a total of"; // Number of posts $lang['We_have'] = "We have"; // # registered users $lang['Regedusers'] = "Registered users"; @@ -110,7 +112,6 @@ $lang['browsing'] = "browsing"; $lang['arecurrently'] = "There are currently"; // # users browsing $lang['theforums'] = "the forums"; - $lang['No_new_posts'] = "No new posts"; $lang['New_posts'] = "New posts"; $lang['Joined'] = "Joined"; @@ -130,6 +131,7 @@ $lang['Log_me_in'] = "Log me on automatically each visit"; // $lang['No_Posts'] = "No Posts"; $lang['Forum_Index'] = "Forum Index"; + // // Viewforum // @@ -142,22 +144,45 @@ $lang['Sticky'] = "Sticky:"; $lang['Guest'] = 'Guest'; // -// Posting/Replying (Not private -// messaging!) +// Posting/Replying (Not private messaging!) // -$lang['Flood_Error'] = "Your last post was less then ".$board_config['flood_interval']." seconds ago. You must wait before you post again!"; -$lang['Empty_subj'] = "You must specifiy a subject when posting a new topic."; -$lang['Empty_msg'] = "You must enter a message when posting!"; -$lang['Postnew'] = "Post New Topic"; -$lang['Post_new_in'] = "Post New Topic in:"; // Followed by forum name +$lang['Message_body'] = "Message body"; + +$lang['Post_a_new_topic'] = "Post a new topic"; +$lang['Post_new_topic_in'] = "Post new topic in:"; // Followed by forum name +$lang['Post_a_reply'] = "Post a reply"; +$lang['Edit_Post'] = "Edit post"; $lang['Post_Annoucement'] = "Post as an annoucement"; -$lang['UnAnnounce'] = "Remove annoucements status from this post"; -$lang['Post_Sticky'] = "Stick this topic"; -$lang['UnStick'] = "Unstick this topic"; -$lang['Annouce_and_sticky'] = "You cannot post a topic that is both an annoucement and a sticky topic"; +$lang['Post_Sticky'] = "Make this topic sticky"; +$lang['Un_announce'] = "Remove annoucement status from this post"; +$lang['Un_stick'] = "Unstick this topic"; +$lang['Options'] = "Options"; + +$lang['Submit_post'] = "Submit Post"; $lang['Preview'] = "Preview"; -$lang['Post_a'] = "Post a"; -$lang['Edit_Post'] = "Edit Post"; +$lang['Cancel_post'] = "Cancel post"; + +$lang['Flood_Error'] = "Your last post was less then " . $board_config['flood_interval'] . " seconds ago. You must wait before you post again!"; +$lang['Sorry_edit_own_posts'] = "Sorry but you can only edit your own posts"; +$lang['Empty_subject'] = "You must specifiy a subject when posting a new topic"; +$lang['Empty_message'] = "You must enter a message when posting"; +$lang['Annouce_and_sticky'] = "You cannot post a topic that is both an annoucement and a sticky topic"; + +$lang['Attach_signature'] = "Attach signature (signatures can be changed in profile)"; +$lang['Disable'] = "Disable "; // This is followed by a type, eg. HTML, Smilies, etc. and then 'on this post' +$lang['HTML'] = "HTML"; +$lang['BBCode'] = "BBCode"; +$lang['Smilies'] = "Smilies"; +$lang['in_this_post'] = " in this post"; +$lang['is_ON'] = " is ON"; +$lang['is_OFF'] = " is OFF"; +$lang['Notify'] = "Notify"; + +$lang['Stored'] = "Your message has been entered successfully"; +$lang['Click'] = "Click"; // Followed by here and then either return to topic or view message +$lang['Here'] = "Here"; +$lang['to_return_forum'] = "to return to the forum"; +$lang['to_view_message'] = "to view your message"; // // Private Messaging @@ -182,7 +207,6 @@ $lang['Wrong_Profile'] = "You cannot modify a profile that is not your own."; $lang['Bad_username'] = "The username you choose has been taken or is disallowed by the administrator."; $lang['Sorry_banned_email'] = "Sorry but the email address you gave has been banned from registering on this system."; - // // Memberslist // @@ -205,6 +229,27 @@ $lang['All'] = "All"; // Topic Admin <= Should be blank for now // +// +// Auth related entries +// +$lang['Sorry_auth'] = "Sorry but only "; // This is followed by the auth type, eg. Registered and then one or more of the following entries + +$lang['Anonymous_Users'] = "Anonymous Users"; +$lang['Registered_Users'] = "Registered Users"; +$lang['Users_granted_access'] = "Users granted special access"; +$lang['Moderators'] = "Moderators"; +$lang['Administrators'] = "Administrators"; + +$lang['can_read'] = " can read"; +$lang['can_post_announcements'] = " can post announcements in"; +$lang['can_post_sticky_topics'] = " can post sticky topics in"; +$lang['can_post_new_topics'] = " can post new topics in"; +$lang['can_reply_to_topics'] = " can reply to topics in"; +$lang['can_edit_topics'] = " can edit topics in"; +$lang['can_delete_topics'] = " can delete topics in"; + +$lang['this_forum'] = " this forum"; + // // Errors (not related to a // specific failure on a page, eg. @@ -212,8 +257,12 @@ $lang['All'] = "All"; // not belong here!) // + + + + // -// Old format ... +// Old format ... _DON'T_add_any_ new entries here!! // $l_forum = "Forum"; $l_forums = "Forums"; diff --git a/phpBB/posting.php b/phpBB/posting.php index 0d806af46c..c25790a201 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -94,40 +94,40 @@ switch($mode) { $auth_type = AUTH_ANNOUCE; $is_auth_type = "auth_announce"; - $error_string = "post annoucements"; + $error_string = $lang['can_post_announcements']; } else if(isset($HTTP_POST_VARS['sticky'])) { $auth_type = AUTH_STICKY; $is_auth_type = "auth_sticky"; - $error_string = "post sticky topics"; + $error_string = $lang['can_post_sticky_topics']; } else { $auth_type = AUTH_ALL; $is_auth_type = "auth_post"; - $error_string = "post new topics"; + $error_string = $lang['can_post_new_topics']; } break; case 'reply': $auth_type = AUTH_ALL; $is_auth_type = "auth_reply"; - $error_string = "reply to topics"; + $error_string = $lang['can_reply_to_topics']; break; case 'editpost': $auth_type = AUTH_ALL; $is_auth_type = "auth_edit"; - $error_string = "edit topics"; + $error_string = $lang['can_edit_topics']; break; case 'delete': $auth_type = AUTH_DELETE; $is_auth_type = "auth_delete"; - $error_string = "delete topics"; + $error_string = $lang['can_delete_topics']; break; default: $auth_type = AUTH_ALL; $is_auth_type = "auth_all"; - $error_string = "post new topics"; + $error_string = $lang['can_post_new_topics']; break; } @@ -141,7 +141,7 @@ if(!$is_auth[$is_auth_type]) // include('includes/page_header.'.$phpEx); - $msg = "I am sorry but you cannot $error_string in this forum, this function is restricted to " . $is_auth[$is_auth_type . "_type"] . " only."; + $msg = $lang['Sorry_auth'] . $is_auth[$is_auth_type . "_type"] . $error_string . $lang['this_forum']; $template->set_filenames(array( "reg_header" => "error_body.tpl" @@ -246,7 +246,7 @@ if(isset($HTTP_POST_VARS['submit']) || $preview) { $error_msg .= "
"; } - $error_msg .= $lang['Empty_subj']; + $error_msg .= $lang['Empty_subject']; } // You can't make it both an annoumcement and a stick topic @@ -320,7 +320,7 @@ switch($mode) { case 'newtopic': $page_title = " ".$lang['Postnew']; - $section_title = $lang['Post_new_in']; + $section_title = $lang['Post_new_topic_in']; if($SQL_LAYER != "mysql") { @@ -387,10 +387,12 @@ switch($mode) } } - include('includes/page_header.'.$phpEx); + // // If we get here the post has been inserted successfully. - $msg = "$l_stored

$l_click $l_here - $l_viewmsg

$l_click $l_here $l_returntopic"; + // + include('includes/page_header.'.$phpEx); + + $msg = $lang['Stored'] . "

" . $lang['Click'] . " " . $lang['Here'] . " " . $lang['to_view_message'] . "

" . $lang['Click'] . " " . $lang['Here'] . " ". $lang['to_return_forum']; $template->set_filenames(array( "reg_header" => "error_body.tpl" @@ -596,7 +598,7 @@ switch($mode) } } - $msg = "$l_stored

$l_click $l_here$l_viewmsg

$l_click $l_here $l_returntopic"; + $msg = $lang['Stored'] . "

" . $lang['Click'] . " " . $lang['Here'] . " " . $lang['to_view_message'] . "

" . $lang['Click'] . " " . $lang['Here'] . " ". $lang['to_return_forum']; $template->set_filenames(array( "reg_header" => "error_body.tpl" @@ -781,11 +783,13 @@ switch($mode) } } - include('includes/page_header.'.$phpEx); + // // If we get here the post has been inserted successfully. - $msg = "$l_stored

$l_click $l_here - $l_viewmsg

$l_click $l_here $l_returntopic"; - + // + include('includes/page_header.'.$phpEx); + + $msg = $lang['Stored'] . "

" . $lang['Click'] . " " . $lang['Here'] . " " . $lang['to_view_message'] . "

" . $lang['Click'] . " " . $lang['Here'] . " ". $lang['to_return_forum']; + $template->set_filenames(array( "reg_header" => "error_body.tpl" )); @@ -816,10 +820,12 @@ switch($mode) } } - include('includes/page_header.'.$phpEx); + // // If we get here the post has been inserted successfully. - $msg = "$l_stored

$l_click $l_here - $l_viewmsg

$l_click $l_here $l_returntopic"; + // + include('includes/page_header.'.$phpEx); + + $msg = $lang['Stored'] . "

" . $lang['Click'] . " " . $lang['Here'] . " " . $lang['to_view_message'] . "

" . $lang['Click'] . " " . $lang['Here'] . " ". $lang['to_return_forum']; $template->set_filenames(array( "reg_header" => "error_body.tpl" @@ -867,7 +873,7 @@ switch($mode) { include('includes/page_header.'.$phpEx); - $msg = "Sorry but you can only edit your own posts."; + $msg = $lang['Sorry_edit_own_posts'];; $template->set_filenames(array( "reg_header" => "error_body.tpl" @@ -1053,17 +1059,17 @@ if(!isset($HTTP_GET_VARS[POST_FORUM_URL]) && !isset($HTTP_POST_VARS[POST_FORUM_U if($board_config['allow_html']) { - $html_status = $l_htmlis . " " . $l_on; + $html_status = $lang['HTML'] . $lang['is_ON']; $html_toggle = '"; + $hidden_form_fields = ""; if($mode == 'newtopic') { - $post_a = $lang['Post_a'] . " " . $lang['Topic']; + $post_a = $lang['Post_a_new_topic']; } else if($mode == 'reply') { - $post_a = $lang['Post_a'] . " " . $lang['Reply']; + $post_a = $lang['Post_a_reply']; } else if($mode == 'editpost') { @@ -1177,13 +1183,6 @@ if(!isset($HTTP_GET_VARS[POST_FORUM_URL]) && !isset($HTTP_POST_VARS[POST_FORUM_U } $template->assign_vars(array( - "L_SUBJECT" => $l_subject, - "L_MESSAGE_BODY" => $l_body, - "L_OPTIONS" => $l_options, - "L_PREVIEW" => $lang['Preview'], - "L_SUBMIT" => $l_submit, - "L_CANCEL" => $l_cancelpost, - "L_POST_A" => $post_a, "USERNAME_INPUT" => $username_input, "PASSWORD_INPUT" => $password_input, "SUBJECT_INPUT" => $subject_input, @@ -1198,6 +1197,14 @@ if(!isset($HTTP_GET_VARS[POST_FORUM_URL]) && !isset($HTTP_POST_VARS[POST_FORUM_U "BBCODE_TOGGLE" => $bbcode_toggle, "BBCODE_STATUS" => $bbcode_status, + "L_SUBJECT" => $lang['Subject'], + "L_MESSAGE_BODY" => $lang['Message_body'], + "L_OPTIONS" => $lang['Options'], + "L_PREVIEW" => $lang['Preview'], + "L_SUBMIT" => $lang['Submit_post'], + "L_CANCEL" => $lang['Cancel_post'], + "L_POST_A" => $post_a, + "S_POST_ACTION" => append_sid("posting.$phpEx"), "S_HIDDEN_FORM_FIELDS" => $hidden_form_fields) ); diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index a211a81e33..8b96e49f9c 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -109,7 +109,7 @@ if(!$is_auth['auth_read'] || !$is_auth['auth_view']) // include('includes/page_header.'.$phpEx); - $msg = "I am sorry but only " . $is_auth['auth_read_type'] . " can read this forum."; + $msg = $lang['Sorry_auth'] . $is_auth['auth_read_type'] . $lang['can_read'] . $lang['this_forum']; $template->set_filenames(array( "reg_header" => "error_body.tpl" @@ -136,7 +136,7 @@ for($x = 0; $x < $db->sql_numrows($result); $x++) if($x > 0) $forum_moderators .= ", "; - $forum_moderators .= "".$forum_row[$x]['username'].""; + $forum_moderators .= "" . $forum_row[$x]['username'] . ""; } @@ -147,8 +147,8 @@ for($x = 0; $x < $db->sql_numrows($result); $x++) // with dates newer than it (to properly handle // pagination) and alter the main query // -$previous_days = array(0, 1, 7, 14, 30, 60, 180, 364); -$previous_days_text = array("$l_All_Topics", "1 $l_Day", "7 $l_Days", "2 $l_Weeks", "1 $l_Month", "2 $l_Months", "6 $l_Months", "1 $l_Year"); +$previous_days = array(0, 1, 7, 14, 30, 90, 180, 364); +$previous_days_text = array($lang['All_Topics'], "1 " . $lang['Day'], "7 " . $lang['Days'], "2 " . $lang['Weeks'], "1 " . $lang['Month'], "3 ". $lang['Months'], "6 " . $lang['Months'], "1 " . $lang['Year']); if(!empty($HTTP_POST_VARS['postdays']) || !empty($HTTP_GET_VARS['postdays'])) { @@ -314,7 +314,7 @@ if($total_topics) $replies = $topic_rowset[$x]['topic_replies']; if($replies > $board_config['posts_per_page']) { - $goto_page = "   ($l_gotopage: "; + $goto_page = "   (" . $lang['Goto_page'] .": "; $times = 1; for($i = 0; $i < ($replies + 1); $i += $board_config['posts_per_page']) {