r380: Converting some hard-coded text to the language system
authorRobert Sesek <rsesek@bluestatic.org>
Thu, 25 Aug 2005 04:44:05 +0000 (04:44 +0000)
committerRobert Sesek <rsesek@bluestatic.org>
Thu, 25 Aug 2005 04:44:05 +0000 (04:44 +0000)
13 files changed:
admin/autoaction.php
admin/field.php
admin/global.php
admin/index.php
admin/language.php
admin/product.php
admin/severity.php
admin/status.php
admin/usergroup.php
editcomment.php
newreport.php
search.php
showreport.php

index 710b4f06137f70b40bee184210fbc142403dd497..ab62e712096429f7ccdf06abe503d24dc9fc25d4 100644 (file)
@@ -144,7 +144,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
        $admin->table_start();
        $admin->table_head(lang::r((($add) ? 'New Automatic Action' : 'Edit Auto Action')));
        
-       $admin->row_input(lang::r('Name'), 'name', $action['name']);
+       $admin->row_input(lang::p('name'), 'name', $action['name']);
        $admin->row_textarea(lang::r('Description'), 'description', $action['description']);
        $admin->row_textarea(lang::r('Add Comment'), 'comment', $action['comment']);
        
@@ -153,10 +153,10 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
        // -------------------------------------------------------------------
        // built-in fields      
        construct_datastore_select('severity', 'severity', 'severityid', $action['fields']['builtin']['severity'], true, true);
-       $admin->row_list(lang::r('Severity'), 'fields[severity]');
+       $admin->row_list(lang::p('severity'), 'fields[severity]');
        
        construct_datastore_select('priority', 'priority', 'priorityid', $action['fields']['builtin']['priority'], true, true);
-       $admin->row_list(lang::r('Priority'), 'fields[priority]');
+       $admin->row_list(lang::p('priority'), 'fields[priority]');
        
        construct_datastore_select('status', 'status', 'statusid', $action['fields']['builtin']['status'], true, true);
        $admin->row_list(lang::r('Status'), 'fields[status]');
@@ -187,8 +187,8 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
                        
                        case 'input_checkbox':
                                $admin->list_item('', 0, ((!$action['fields']['custom']["$field[fieldid]"]) ? true : false));
-                               $admin->list_item(lang::r('Checked'), 1, (($action['fields']['custom']["$field[fieldid]"] == 1) ? true : false));
-                               $admin->list_item(lang::r('Un-Checked'), 2, (($action['fields']['custom']["$field[fieldid]"] == 2) ? true : false));
+                               $admin->list_item(lang::p('checked'), 1, (($action['fields']['custom']["$field[fieldid]"] == 1) ? true : false));
+                               $admin->list_item(lang::p('unchecked'), 2, (($action['fields']['custom']["$field[fieldid]"] == 2) ? true : false));
                                $admin->row_list($field['name'], "fields[custom][$field[fieldid]]");
                        break;
                        
@@ -218,15 +218,15 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
 
 if ($_REQUEST['do'] == 'modify')
 {
-       $admin->page_start(lang::r('Automatic Actions'));
+       $admin->page_start(lang::p('automatic_actions'));
        
        $admin->table_start();
-       $admin->table_head(lang::r('Automatic Actions'));
+       $admin->table_head(lang::p('automatic_actions'));
        
        $actions = $db->query("SELECT * FROM " . TABLE_PREFIX . "autoaction ORDER BY name ASC");
        while ($action = $db->fetch_array($actions))
        {
-               $admin->row_text($action['name'] . "\n<div class=\"smallfont\">$action[description]</div>", "<a href=\"autoaction.php?do=edit&amp;actionid=$action[actionid]\">[" . lang::r('Edit') . "]</a> <a href=\"autoaction.php?do=delete&amp;actionid=$action[actionid]\">[" . lang::r('Delete') . "]</a>");
+               $admin->row_text($action['name'] . "\n<div class=\"smallfont\">$action[description]</div>", "<a href=\"autoaction.php?do=edit&amp;actionid=$action[actionid]\">[" . lang::p('edit') . "]</a> <a href=\"autoaction.php?do=delete&amp;actionid=$action[actionid]\">[" . lang::r('Delete') . "]</a>");
        }
        
        $admin->row_span('<a href="autoaction.php?do=add">[' . lang::r('Add New Action') . ']</a>', 'tfoot', 'center', 3);
index 5afe91e2cc4454fb7a7112d071119394ef044fdf..3de46cdeaf84ca159a73ba7d14d9122b115e1690 100644 (file)
@@ -18,9 +18,9 @@ if (!can_perform('canadminfields'))
 }
 
 $TYPES = array(
-       'input_text' => lang::r('Single-Line Text Box'),
-       'input_checkbox' => lang::r('Checkbox Flag'),
-       'select_single' => lang::r('Drop-Down Menu'),
+       'input_text' => lang::p('single_line_text_box'),
+       'input_checkbox' => lang::p('checkbox_flag'),
+       'select_single' => lang::p('drop_dwon_menu'),
 );
 
 // ###################################################################
@@ -174,7 +174,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
        {
                $admin->form_hidden_field('step', 1);
                $admin->table_start(true, '40%');
-               $admin->table_head(lang::r('Select Type'));
+               $admin->table_head(lang::p('select_type'));
        }
        else
        {
@@ -219,8 +219,8 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
                }
                
                // global fields
-               $admin->row_span(lang::r('Global Fields'), 'thead', 'center');
-               $admin->row_text(lang::r('Field Type'), $TYPES["$type"]);
+               $admin->row_span(lang::p('global_fields'), 'thead', 'center');
+               $admin->row_text(lang::p('field_type'), $TYPES["$type"]);
                $admin->row_input(lang::r('Display Name'), 'name', $field['name']);
                $admin->row_textarea(lang::r('Description'), 'description', $field['description']);
                $admin->row_yesno(lang::r('Required'), 'required', $field['required']);
@@ -238,7 +238,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
                        break;
                        
                        case 'input_checkbox':
-                               $admin->row_yesno(lang::r('Checked By Default'), 'defaultvalue', $field['defaultvalue']);
+                               $admin->row_yesno(lang::p('checked_by_default'), 'defaultvalue', $field['defaultvalue']);
                        break;
                        
                        case 'select_single':
@@ -248,7 +248,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
                }
                
                // end table
-               $admin->row_submit((($edit) ? '<a href="field.php?do=delete&amp;fieldid=' . $field['fieldid'] . '">[' . lang::r('Delete Field') . ']</a>' : ''));
+               $admin->row_submit((($edit) ? '<a href="field.php?do=delete&amp;fieldid=' . $field['fieldid'] . '">[' . lang::p('delete_field') . ']</a>' : ''));
                $admin->table_end();
                $admin->form_end();
        }
@@ -264,7 +264,7 @@ if ($_REQUEST['do'] == 'modify')
        
        $admin->table_start();
        $admin->table_head(lang::p('additional_bug_fields'), 3);
-       $admin->table_column_head(array(lang::r('Display Name/Description'), lang::r('Field ID'), lang::r('Actions')));
+       $admin->table_column_head(array(lang::p('display_name_description'), lang::p('field_id'), lang::p('actions')));
        
        $fields = $db->query("SELECT * FROM " . TABLE_PREFIX . "bugfield ORDER BY fieldid ASC");
        while ($field = $db->fetch_array($fields))
@@ -273,7 +273,7 @@ if ($_REQUEST['do'] == 'modify')
                        array(
                                "$field[name]<div class=\"smallfont\"><em>$field[description]</em></div>" => 'l',
                                "(fieldid: $field[fieldid])" => 'c',
-                               "<a href=\"field.php?do=edit&amp;fieldid=$field[fieldid]\">[" . lang::r('Edit') . "]</a> <a href=\"field.php?do=delete&amp;fieldid=$field[fieldid]\">[" . lang::r('Delete') . "]</a>" => 'c'
+                               "<a href=\"field.php?do=edit&amp;fieldid=$field[fieldid]\">[" . lang::p('edit') . "]</a> <a href=\"field.php?do=delete&amp;fieldid=$field[fieldid]\">[" . lang::r('Delete') . "]</a>" => 'c'
                        )
                );
        }
index 62ed91c268b55152afb0b0efb9c69425e72adb9a..100e56edf731c73d4d007b5587dec5d6f86eb79c 100755 (executable)
@@ -20,27 +20,27 @@ require_once('./includes/functions.php');
 
 $globalnav = array(
        lang::r('Admin Locations') => array(
-               lang::r('Home') => 'index.php',
-               lang::r('Logout') => '../login.php?do=cplogout'
+               lang::p('home') => 'index.php',
+               lang::p('logout') => '../login.php?do=cplogout'
        ),
        
        lang::r('Options') => array(
-               lang::r('BugStrike Settings') => 'setting.php',
+               lang::p('bugstrike_settings') => 'setting.php',
                //'Manage Languages' => 'language.php'
        ),
        
-       lang::r('Bug Fields') => array(
-               lang::r('Products / Versions / Components') => 'product.php',
-               lang::r('Priorities') => 'priority.php',
-               lang::r('Resolutions') => 'resolution.php',
-               lang::r('Severities') => 'severity.php',
-               lang::r('Statuses') => 'status.php',
+       lang::p('bug_fields') => array(
+               lang::p('producs_versions_components') => 'product.php',
+               lang::p('priorities') => 'priority.php',
+               lang::p('resolutions') => 'resolution.php',
+               lang::p('severities') => 'severity.php',
+               lang::p('statuses') => 'status.php',
                lang::r('Custom Bug Fields') => 'field.php',
-               lang::r('Automatic Actions') => 'autoaction.php'
+               lang::p('automatic_actions') => 'autoaction.php'
        ),
        
-       lang::r('User Management') => array(
-               lang::r('Usergroups') => 'usergroup.php'
+       lang::p('user_management') => array(
+               lang::p('usergroups') => 'usergroup.php'
        )
 );
 
index 09a21a9fb459d8d80984fc1f6d65c531771be799..7967be58601ce8b4b351592c93f0b1f4f583d39e 100755 (executable)
@@ -15,7 +15,7 @@ require_once('./global.php');
 $admin->page_start('Index');
 
 $admin->table_start(true, '25%');
-$admin->table_head(lang::r('BugStrike Administration Menu'));
+$admin->table_head(lang::p('admin_menu'));
 
 $navdata = '<ul>';
 foreach  ($globalnav AS $group => $links)
index 86753252143f588e8c26831de740c46c9018516c..87d915492a2de7101eb01f81e6a01b90935b14e8 100644 (file)
@@ -97,7 +97,7 @@ if ($_REQUEST['do'] == 'modify')
        $admin->table_start();
        $admin->table_head(lang::r('Manage Languages'), 4);
        
-       $admin->table_column_head(array(lang::r('Title'), lang::r('Charset'), lang::r('Options'), lang::r('Actions')));
+       $admin->table_column_head(array(lang::r('Title'), lang::r('Charset'), lang::r('Options'), lang::p('actions')));
        
        $languages = $db->query("SELECT * FROM " . TABLE_PREFIX . "language ORDER BY languageid ASC");
        while ($language = $db->fetch_array($languages))
index 479334bb6d9975b88516240aacc2ac04415987a9..88d54d085da18b10824782c418de46dbdfaffe04 100755 (executable)
@@ -26,7 +26,7 @@ function construct_option_list($type, $id, $edit, $addcomponent, $addversion, $d
        
        if ($edit)
        {
-               $opt .= '<option value="product.php?do=edit' . $type . '&' . $type_action . '=' . $id . '">' . lang::r('Edit') . ' ' . $type_display . '</option>';
+               $opt .= '<option value="product.php?do=edit' . $type . '&' . $type_action . '=' . $id . '">' . lang::p('edit') . ' ' . $type_display . '</option>';
        }
        
        if ($delete)
index 9d242fe64e2b29a64adbdb6325293aeec71376dd..4395272bc0a0fcbf249827d31fde41a0113978a0 100755 (executable)
@@ -107,13 +107,13 @@ if ($_REQUEST['do'] == 'edit')
 
 if ($_REQUEST['do'] == 'modify')
 {
-       $admin->page_start(lang::r('Severity Manager'));
+       $admin->page_start(lang::p('severity_manager'));
        
        $severities = $db->query("SELECT * FROM " . TABLE_PREFIX . "severity ORDER BY displayorder");
        
        $admin->form_start('severity.php', 'null');
        $admin->table_start();
-       $admin->table_head(lang::r('Severity Manager'));
+       $admin->table_head(lang::p('severity_manager'));
        
        while ($severity = $db->fetch_array($severities))
        {
index 68b6e7dc386e45495dce9ec212a28bfe5c0f9876..cb49a1c4636088aeb93e065492d709015c22ec3c 100755 (executable)
@@ -108,13 +108,13 @@ if ($_REQUEST['do'] == 'edit')
 
 if ($_REQUEST['do'] == 'modify')
 {
-       $admin->page_start(lang::r('Status Manager'));
+       $admin->page_start(lang::p('status_manager'));
        
        $statuses = $db->query("SELECT * FROM " . TABLE_PREFIX . "status");
        
        $admin->form_start('status.php', 'null');
        $admin->table_start();
-       $admin->table_head(lang::r('Status Manager'));
+       $admin->table_head(lang::p('status_manager'));
        
        while ($status = $db->fetch_array($statuses))
        {
index 17f56394ad9b13f4355adfb79c0f09414b0a456f..e4979fdff77fe30a86cab7350340aa1b1793392c 100755 (executable)
@@ -139,7 +139,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
                
        // custom field permissions
        $admin->table_start();
-       $admin->table_head(lang::r('Custom Field Permissions'));
+       $admin->table_head(lang::p('custom_field_permissions'));
        
        if ($edit)
        {
@@ -154,9 +154,9 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit')
        while ($field = $db->fetch_array($fields))
        {
                unset($listitem);
-               $admin->list_item(lang::r('No Permission'), 0, $permissions["$field[fieldid]"] == 0);
-               $admin->list_item(lang::r('Can View Field'), 1, $permissions["$field[fieldid]"] == 1);
-               $admin->list_item(lang::r('Can View, Edit Field'), 2, $permissions["$field[fieldid]"] == 2);
+               $admin->list_item(lang::p('no_permission'), 0, $permissions["$field[fieldid]"] == 0);
+               $admin->list_item(lang::p('can_view_field'), 1, $permissions["$field[fieldid]"] == 1);
+               $admin->list_item(lang::p('can_view_edit_field'), 2, $permissions["$field[fieldid]"] == 2);
                $admin->row_list($field['name'], "custom[$field[fieldid]]");
        }
        
index cd909820c338d1bf9cea7ae22fe880d2aa2dda67..1cb4c1d6f205772b2cf1612555c84e37d260bb74 100644 (file)
@@ -30,7 +30,7 @@ $comment = $db->query_first("
 
 if (!$comment)
 {
-       $message->error(lang::r('alert: bad comment'));
+       $message->error(lang::p('invalid_comment_id'));
 }
 
 $bug = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid = $comment[bugid]");
index cf2b3de1ed0ea889523129155f3a7c1fa040ea4c..73899000df91cb978825a098f384cd648f9b3f96 100755 (executable)
@@ -83,11 +83,11 @@ if ($_POST['do'] == 'insert')
        // sanity checks
        if (!$pcv)
        {
-               $message->error(lang::r('there was a problem selecting the product, component, or version'));
+               $message->error(lang::p('invalid_pcv'));
        }
        if (!$bugsys->in['summary'])
        {
-               $message->error(lang::r('please enter a bug title'));
+               $message->error(lang::p('error_enter_bug_title'));
        }
        if (!$bugsys->in['comment'])
        {
@@ -144,7 +144,7 @@ if ($_POST['do'] == 'insert')
        
        $db->query("INSERT INTO " . TABLE_PREFIX . "vote (bugid, votefor, voteagainst) VALUES ($bugid, 0, 0)");
        
-       $message->redirect(lang::r('bug is done!'), "showreport.php?bugid=$bugid");
+       $message->redirect(lang::p('bug_added'), "showreport.php?bugid=$bugid");
 }
 
 // ###################################################################
index ab46feed2bee289eac91ddeac8c9709c028203b3..9273164b980fb9aa58c14740bef0187a7736602f 100644 (file)
@@ -223,7 +223,7 @@ if ($_REQUEST['do'] == 'process')
        // have to search something
        if (count($querybuild) < 1)
        {
-               $message->error(lang::r('you need to search for something!'));
+               $message->error(lang::p('search_no_criteria'));
        }
        
        // -------------------------------------------------------------------
@@ -254,7 +254,7 @@ if ($_REQUEST['do'] == 'process')
        
        if ($numrows < 1)
        {
-               $message->error(lang::r('no results found'));
+               $message->error(lang::p('search_no_results'));
        }
        
        while ($result = $db->fetch_array($search))
index 615964f0dabb4c9970b865ad06b3de9e21023630..6fa06949009dc268c526d7a965dec63fa0d81698 100644 (file)
@@ -84,7 +84,7 @@ if ($bug['hidden'] AND !can_perform('canviewhidden'))
 // global display items
 
 $favourite = (bool)$db->query_first("SELECT * FROM " . TABLE_PREFIX . "favourite WHERE bugid = $bug[bugid] AND userid = " . $bugsys->userinfo['userid']);
-$favouritetext = (($favourite) ? lang::r('Remove from Favourites') : lang::r('Add to Favourites'));
+$favouritetext = (($favourite) ? lang::p('remove_from_favourites') : lang::p('add_to_favourites'));
 
 $bug['userinfo'] = construct_user_display($bug);
 $bug['datetime'] = $datef->format($bugsys->options['dateformat'], $bug['dateline']);