From 037faadfc3d101f1e2c19fcfddd1ce190d633b6d Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 21 Sep 2005 03:59:35 +0000 Subject: [PATCH] r390: Registering language data --- admin/language.php | 16 ++++++++-------- attachment.php | 16 ++++++++-------- editcomment.php | 2 +- editreport.php | 4 ++-- login.php | 6 +++--- newcomment.php | 2 +- register.php | 16 ++++++++-------- vote.php | 4 ++-- 8 files changed, 33 insertions(+), 33 deletions(-) diff --git a/admin/language.php b/admin/language.php index 87d9154..6de3088 100644 --- a/admin/language.php +++ b/admin/language.php @@ -69,17 +69,17 @@ if ($_REQUEST['do'] == 'edit') $admin->error(lang::p('error_invalid_id')); } - $admin->page_start(lang::r('Edit Language')); + $admin->page_start(lang::p('edit_language')); $admin->form_start('language.php', 'update'); $admin->table_start(); $admin->table_head(lang::r('Edit Language - ' . $language['title'])); $admin->row_input(lang::r('Title'), 'title', $language['title']); - $admin->row_input(lang::r('Character Set'), 'charset', $language['charset']); - $admin->list_item(lang::r('Left-to-Right'), 'ltr', (($language['direction'] == 'ltr') ? true : false)); - $admin->list_item(lang::r('Right-to-Left'), 'rtl', (($language['direction'] == 'rtl') ? true : false)); - $admin->row_list(lang::r('Direction'), 'direction'); + $admin->row_input(lang::p('character_set'), 'charset', $language['charset']); + $admin->list_item(lang::p('ltr'), 'ltr', (($language['direction'] == 'ltr') ? true : false)); + $admin->list_item(lang::p('rtl'), 'rtl', (($language['direction'] == 'rtl') ? true : false)); + $admin->row_list(lang::p('direction'), 'direction'); $admin->row_submit(); $admin->table_end(); @@ -105,12 +105,12 @@ if ($_REQUEST['do'] == 'modify') $admin->row_multi_item(array( $language['title'] => 'l', $language['charset'] => 'c', - (($language['default']) ? '' . lang::r('DEFAULT LANGUAGE') . ' / ' : '') . (($language['userselect']) ? lang::r('User Selectable') : lang::r('Private Language')) => 'c', - "[" . lang::r('Edit Settings') . "] [" . lang::r('Manage Phrases') . "]" => 'c' + (($language['default']) ? '' . lang::p('default_language') . ' / ' : '') . (($language['userselect']) ? lang::r('User Selectable') : lang::p('private')) => 'c', + "[" . lang::p('edit_settings') . "] [" . lang::p('manage_phrases') . "]" => 'c' )); } - $admin->row_span('[' . lang::r('Add New Language') . ']', 'tfoot', 'center', 4); + $admin->row_span('[' . lang::p('add_new_language') . ']', 'tfoot', 'center', 4); $admin->table_end(); $admin->page_end(); diff --git a/attachment.php b/attachment.php index 7d28fdc..1884d6d 100755 --- a/attachment.php +++ b/attachment.php @@ -57,7 +57,7 @@ if ($_REQUEST['do'] == 'kill') $log->allowempty = true; $log->log(); - $message->redirect(lang::r('attachment removed'), "showreport.php?bugid=$bug[bugid]"); + $message->redirect(lang::p('attachment_deleted'), "showreport.php?bugid=$bug[bugid]"); } // ################################################################### @@ -88,11 +88,11 @@ if ($_POST['do'] == 'insert') switch ($FILE['error']) { case 0: break; - case 1: $message->error(lang::r('PHP said the file you uploaded was too big.')); break; - case 2: $message->error(lang::r('The file exceeds the allowed upload size.')); break; - case 3: $message->error(lang::r('The file was only partially uploaded.')); break; - case 4: $message->error(lang::r('The file was not uploaded at all.')); break; - case 6: $message->error(lang::r('PHP could not find the /tmp directory.')); break; + case 1: $message->error(lang::p('error_file_too_big_php')); break; + case 2: $message->error(lang::p('error_file_too_big')); break; + case 3: $message->error(lang::p('error_file_partial_upload')); break; + case 4: $message->error(lang::p('error_file_not_uploaded_at_all')); break; + case 6: $message->error(lang::p('error_file_not_in_tmp')); break; } // did it upload? @@ -105,7 +105,7 @@ if ($_POST['do'] == 'insert') if (!$bugsys->in['description']) { - $message->error(lang::r('you need a file description!')); + $message->error(lang::p('error_need_file_description')); } $filedata = $bugsys->escape(file_get_contents($FILE['tmp_name']), true, true); @@ -227,7 +227,7 @@ if ($_POST['do'] == 'update') $log->log($log->diff('description', $diff[0]['description'], $diff[1]['description'])); $log->log($log->diff('obsolete', $diff[0]['obsolete'], $diff[1]['obsolete'])); - $message->redirect(lang::r('attachment updated'), "showreport.php?bugid=$bug[bugid]"); + $message->redirect(lang::p('attachment_updated'), "showreport.php?bugid=$bug[bugid]"); } // ################################################################### diff --git a/editcomment.php b/editcomment.php index 1cb4c1d..cfea039 100644 --- a/editcomment.php +++ b/editcomment.php @@ -93,7 +93,7 @@ if ($_POST['do'] == 'update') WHERE bugid = $bug[bugid]" ); - $message->redirect(lang::r('comment saved'), "showreport.php?bugid=$bug[bugid]"); + $message->redirect(lang::p('comment_updated'), "showreport.php?bugid=$bug[bugid]"); } // ################################################################### diff --git a/editreport.php b/editreport.php index 4d7f41b..e0cbc64 100644 --- a/editreport.php +++ b/editreport.php @@ -121,7 +121,7 @@ if ($_POST['do'] == 'update') } if (!$pcv) { - $message->error(lang::r('invalid product/component/version')); + $message->error(lang::p('invalid_pcv')); } $hist[0] = (array)$db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $bug[bugid]"); @@ -315,7 +315,7 @@ if ($_POST['do'] == 'update') } - $message->redirect(lang::r('done with update bug'), "showreport.php?bugid=$bug[bugid]"); + $message->redirect(lang::p('bug_edit_done'), "showreport.php?bugid=$bug[bugid]"); } /*=====================================================================*\ diff --git a/login.php b/login.php index 0ca3a52..325c001 100755 --- a/login.php +++ b/login.php @@ -24,7 +24,7 @@ require_once('./global.php'); if ($bugsys->userinfo['userid'] AND $_REQUEST['do'] != 'logout' AND $_POST['do'] != 'cplogin' AND $_REQUEST['do'] != 'cplogout') { - $message->error(lang::r('You are already logged in.')); + $message->error(lang::p('already_logged_in')); } // ################################################################### @@ -94,7 +94,7 @@ if ($_REQUEST['do'] == 'logout') } else { - $message->error(lang::r('You need to be logged in!')); + $message->error(lang::p('error_need_credentials')); } } @@ -109,7 +109,7 @@ if ($_REQUEST['do'] == 'cplogout') } else { - $message->error(lang::r('you are not logged in')); + $message->error(lang::p('not_logged_in')); } } diff --git a/newcomment.php b/newcomment.php index 7a5bf28..579d0a5 100644 --- a/newcomment.php +++ b/newcomment.php @@ -61,7 +61,7 @@ if ($_POST['do'] == 'insert') $log->arguments = array($commentid); $log->log(); - $message->redirect(lang::r('comment inesrted'), "showreport.php?bugid=" . intval($bugsys->in['bugid'])); + $message->redirect(lang::p('comment_added'), "showreport.php?bugid=" . intval($bugsys->in['bugid'])); } /*=====================================================================*\ diff --git a/register.php b/register.php index 9b9ef3e..1ec4bd8 100755 --- a/register.php +++ b/register.php @@ -26,12 +26,12 @@ if (empty($_REQUEST['do'])) { if ($bugsys->userinfo['userid']) { - $message->error(lang::r('Sorry, you are already registered!')); + $message->error(lang::p('error_already_registered')); } if (!$bugsys->options['allownewreg']) { - $message->error(lang::r('Sorry, we don\'t allow new registrations!')); + $message->error(lang::p('error_no_new_registrations')); } foreach ($bugsys->datastore['language'] AS $value => $temp) @@ -49,12 +49,12 @@ if ($_POST['do'] == 'insert') { if ($bugsys->userinfo['userid']) { - $message->error(lang::r('Sorry, you are already registered!')); + $message->error(lang::p('error_already_registered')); } if (!$bugsys->options['allownewreg']) { - $message->error(lang::r('Sorry, we don\'t allow new registrations!')); + $message->error(lang::p('error_no_new_registrations')); } if ($bugsys->in['email'] != $bugsys->in['confirmemail']) @@ -140,7 +140,7 @@ if ($_POST['do'] == 'insert') $mail->body = lang::r("Hi " . $bugsys->in['displayname'] . " you need to activate your account: http://devbox/bugtraq/register.php?do=activate&userid=" . $userid . "&activator=" . $activationid); $mail->send(); - $message->message(lang::r('You now need to activate your account via email.')); + $message->message(lang::p('need_to_activate_account')); } else if ($usergroupid == 4 OR $usergroupid == 2) { @@ -154,7 +154,7 @@ if ($_POST['do'] == 'insert') if ($usergroupid == 4) { - $message->message(lang::r('Your account is pending approval.')); + $message->message(lang::p('account_pending_approval')); } else { @@ -181,11 +181,11 @@ if ($_REQUEST['do'] == 'activate') $mail->send(); } - $message->message(lang::r('your account is now activated and you can now login')); + $message->message(lang::p('account_activated')); } else { - $message->error(lang::r('we could not match your registration string. please make sure you entered the correct url')); + $message->error(lang::p('error_invalid_registration_key')); } } diff --git a/vote.php b/vote.php index 8dfd73c..e778439 100644 --- a/vote.php +++ b/vote.php @@ -42,7 +42,7 @@ if ($_REQUEST['do'] == 'vote') if ($vote['uservote']) { - $message->error(lang::r('you have already voted on this bug')); + $message->error(lang::p('error_already_voted')); } // handle userids @@ -75,7 +75,7 @@ if ($_REQUEST['do'] == 'vote') $db->query("UPDATE " . TABLE_PREFIX . "vote SET userids = '$userids', votefor = $votefor, voteagainst = $voteagainst WHERE bugid = $bug[bugid]"); - $message->redirect(lang::r('your vote has been added'), "showreport.php?bugid=$bug[bugid]"); + $message->redirect(lang::p('vote_added'), "showreport.php?bugid=$bug[bugid]"); } /*=====================================================================*\ -- 2.43.5