From 61f57ce1631d8fa4f5c7a6fa8e8828c59528c584 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 21 Mar 2008 03:35:30 +0000 Subject: [PATCH] r1608: Merging r1607 from trunk --- admin/automation.php | 32 ++--- admin/field.php | 54 ++++----- admin/global.php | 34 +++--- admin/index.php | 36 +++--- admin/language.php | 46 ++++---- admin/permission.php | 62 +++++----- admin/priority.php | 24 ++-- admin/product.php | 78 ++++++------ admin/resolution.php | 24 ++-- admin/setting.php | 121 +++++++++---------- admin/severity.php | 24 ++-- admin/status.php | 28 ++--- admin/user.php | 74 ++++++------ admin/usergroup.php | 102 ++++++++-------- admin/userhelp.php | 18 +-- attachment.php | 20 ++-- docs/changes.txt | 1 + editcomment.php | 10 +- editreport.php | 10 +- explain.php | 6 +- favorite.php | 6 +- global.php | 1 + help.php | 4 +- includes/api_automation.php | 4 +- includes/api_comment.php | 4 +- includes/api_field.php | 8 +- includes/api_language.php | 6 +- includes/api_user.php | 10 +- includes/api_usergroup.php | 2 +- includes/api_userhelp.php | 4 +- includes/class_admin_navigation.php | 110 ++++++++--------- includes/class_message_reporter.php | 2 +- includes/class_mo.php | 177 ++++++++++++++++++++++++++++ includes/class_sort.php | 36 +++--- includes/functions.php | 8 +- includes/init.php | 21 ++-- includes/language.php | 37 +++++- index.php | 2 +- login.php | 24 ++-- newreport.php | 6 +- register.php | 22 ++-- search.php | 26 ++-- showhistory.php | 6 +- showreport.php | 2 +- syndicate.php | 12 +- userctrl.php | 18 +-- vote.php | 6 +- 47 files changed, 796 insertions(+), 572 deletions(-) create mode 100644 includes/class_mo.php diff --git a/admin/automation.php b/admin/automation.php index c69ef71..5d1ea04 100644 --- a/admin/automation.php +++ b/admin/automation.php @@ -56,7 +56,7 @@ if ($_REQUEST['do'] == 'kill') if ($_REQUEST['do'] == 'delete') { - $admin->page_confirm(_('Are you sure you want to delete this automation?'), 'automation.php', 'kill', array('actionid' => $bugsys->in['actionid'])); + $admin->page_confirm(T('Are you sure you want to delete this automation?'), 'automation.php', 'kill', array('actionid' => $bugsys->in['actionid'])); } // ################################################################### @@ -133,7 +133,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit') $navigator->set_focus('link', 'automations-add', 'automations'); } - $admin->page_start(($add ? _('New Automation') : _('Edit Automation'))); + $admin->page_start(($add ? T('New Automation') : T('Edit Automation'))); $admin->form_start('automation.php', ($add ? 'insert' : 'update')); @@ -143,27 +143,27 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit') } $admin->table_start(); - $admin->table_head(($add ? _('New Automation') : _('Edit Automation'))); + $admin->table_head(($add ? T('New Automation') : T('Edit Automation'))); - $admin->row_input(_('Name'), 'name', $action->objdata['name']); - $admin->row_textarea(_('Description'), 'description', $action->objdata['description']); - $admin->row_textarea(_('Add Comment'), 'comment', $action->objdata['comment']); + $admin->row_input(T('Name'), 'name', $action->objdata['name']); + $admin->row_textarea(T('Description'), 'description', $action->objdata['description']); + $admin->row_textarea(T('Add Comment'), 'comment', $action->objdata['comment']); - $admin->row_span(_('Field Changes'), 'thead', 'center'); + $admin->row_span(T('Field Changes'), 'thead', 'center'); // ------------------------------------------------------------------- // built-in fields construct_datastore_select('severity', 'severity', 'severityid', $action->objdata['fields']['builtin']['severity'], true, true); - $admin->row_list(_('Severity'), 'fields[severity]'); + $admin->row_list(T('Severity'), 'fields[severity]'); construct_datastore_select('priority', 'priority', 'priorityid', $action->objdata['fields']['builtin']['priority'], true, true); - $admin->row_list(_('Priority'), 'fields[priority]'); + $admin->row_list(T('Priority'), 'fields[priority]'); construct_datastore_select('status', 'status', 'statusid', $action->objdata['fields']['builtin']['status'], true, true); - $admin->row_list(_('Status'), 'fields[status]'); + $admin->row_list(T('Status'), 'fields[status]'); construct_datastore_select('resolution', 'resolution', 'resolutionid', $action->objdata['fields']['builtin']['resolution'], true, true); - $admin->row_list(_('Resolution'), 'fields[resolution]'); + $admin->row_list(T('Resolution'), 'fields[resolution]'); $admin->row_span('', 'tcat', 'center'); @@ -180,8 +180,8 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit') case 'input_checkbox': $admin->list_item('', -1, (!$action->objdata['fields']['custom']["$field[fieldid]"] OR $action->objdata['fields']['custom']["$field[fieldid]"] == -1)); - $admin->list_item(_('Checked'), 1, ($action->objdata['fields']['custom']["$field[fieldid]"] == 1)); - $admin->list_item(_('Un-Checked'), 0, (isset($action->objdata['fields']['custom']["$field[fieldid]"]) AND $action->objdata['fields']['custom']["$field[fieldid]"] == 0)); + $admin->list_item(T('Checked'), 1, ($action->objdata['fields']['custom']["$field[fieldid]"] == 1)); + $admin->list_item(T('Un-Checked'), 0, (isset($action->objdata['fields']['custom']["$field[fieldid]"]) AND $action->objdata['fields']['custom']["$field[fieldid]"] == 0)); $admin->row_list($field['name'], "fields[custom][$field[fieldid]]"); break; @@ -214,15 +214,15 @@ if ($_REQUEST['do'] == 'modify') NavLinks::automationsAdd(); $navigator->set_focus('link', 'fields-pages-automations', 'fields-pages'); - $admin->page_start(_('Automations')); + $admin->page_start(T('Automations')); $admin->table_start(); - $admin->table_head(_('Automations')); + $admin->table_head(T('Automations')); $actions = $db->query("SELECT * FROM " . TABLE_PREFIX . "automation ORDER BY name ASC"); while ($action = $db->fetch_array($actions)) { - $admin->row_text($action['name'] . "\n
$action[description]
", "[" . _('Edit') . "] [" . _('Delete') . "]"); + $admin->row_text($action['name'] . "\n
$action[description]
", "[" . T('Edit') . "] [" . T('Delete') . "]"); } $admin->table_end(); diff --git a/admin/field.php b/admin/field.php index 5489a8f..c27f40c 100644 --- a/admin/field.php +++ b/admin/field.php @@ -56,7 +56,7 @@ if ($_REQUEST['do'] == 'kill') if ($_REQUEST['do'] == 'delete') { - $admin->page_confirm(_('Are you sure you want to delete this bug field? Doing so will remove everything for this field and it cannot be undone!'), 'field.php', 'kill', array('fieldid' => $bugsys->in['fieldid'])); + $admin->page_confirm(T('Are you sure you want to delete this bug field? Doing so will remove everything for this field and it cannot be undone!'), 'field.php', 'kill', array('fieldid' => $bugsys->in['fieldid'])); } // ################################################################### @@ -135,7 +135,7 @@ if ($_REQUEST['do'] == 'update') (" . implode("),\n\t\t\t(", $values) . ")" ); - $admin->redirect('field.php?do=modify', ($add ? _('The custom field has been added') : _('The custom field has been updated'))); + $admin->redirect('field.php?do=modify', ($add ? T('The custom field has been added') : T('The custom field has been updated'))); } // ################################################################### @@ -159,7 +159,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit') $navigator->set_focus('link', 'fields-pages-fields', 'fields-pages'); } - $admin->page_start(($add ? _('Add New Custom Field') : _('Edit Custom Field'))); + $admin->page_start(($add ? T('Add New Custom Field') : T('Edit Custom Field'))); $admin->form_start('field.php', ($typeselect ? 'add' : 'update')); if ($add AND !$typeselect) { @@ -169,12 +169,12 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit') { $admin->form_hidden_field('step', 1); $admin->table_start(true, '40%'); - $admin->table_head(_('Select Type')); + $admin->table_head(T('Select Type')); } else { $admin->table_start(); - $admin->table_head(($add ? _('Add New Bug Field') . ' - ' . FieldAPI::field_types($bugsys->in['type']) : _('Edit Field'))); + $admin->table_head(($add ? T('Add New Bug Field') . ' - ' . FieldAPI::field_types($bugsys->in['type']) : T('Edit Field'))); } if ($edit) @@ -198,7 +198,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit') { $admin->list_item($description, $name); } - $admin->row_list(_('Field Type'), 'type', false); + $admin->row_list(T('Field Type'), 'type', false); $admin->row_submit(); $admin->table_end(); @@ -209,31 +209,31 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit') $field->set('type', $type); // global fields - $admin->row_span(_('Global Fields'), 'thead', 'center'); - $admin->row_text(_('Field Type'), FieldAPI::field_types($type)); - $admin->row_input(_('Display Name'), 'name', $field->objdata['name']); - $admin->row_textarea(_('Description'), 'description', $field->objdata['description']); - $admin->row_yesno(_('Required'), 'required', $field->objdata['required']); - $admin->row_yesno(_('Can Be Searched'), 'cansearch', ((isset($field->objdata['cansearch'])) ? $field->objdata['cansearch'] : true)); + $admin->row_span(T('Global Fields'), 'thead', 'center'); + $admin->row_text(T('Field Type'), FieldAPI::field_types($type)); + $admin->row_input(T('Display Name'), 'name', $field->objdata['name']); + $admin->row_textarea(T('Description'), 'description', $field->objdata['description']); + $admin->row_yesno(T('Required'), 'required', $field->objdata['required']); + $admin->row_yesno(T('Can Be Searched'), 'cansearch', ((isset($field->objdata['cansearch'])) ? $field->objdata['cansearch'] : true)); // type-specific fields - $admin->row_span(_('Type-Specific Fields'), 'thead', 'center'); + $admin->row_span(T('Type-Specific Fields'), 'thead', 'center'); switch ($type) { case 'input_text': - $admin->row_input(_('Default Value'), 'defaultvalue', $field->objdata['defaultvalue']); - $admin->row_input(_('Regular Expression Match'), 'regexmatch', $field->objdata['regexmatch']); - $admin->row_input(_('Maximum Length'), 'maxlength', $field->objdata['maxlength'], 2, 10); + $admin->row_input(T('Default Value'), 'defaultvalue', $field->objdata['defaultvalue']); + $admin->row_input(T('Regular Expression Match'), 'regexmatch', $field->objdata['regexmatch']); + $admin->row_input(T('Maximum Length'), 'maxlength', $field->objdata['maxlength'], 2, 10); break; case 'input_checkbox': - $admin->row_yesno(_('Checked By Default'), 'defaultvalue', $field->objdata['defaultvalue']); + $admin->row_yesno(T('Checked By Default'), 'defaultvalue', $field->objdata['defaultvalue']); break; case 'select_single': - $admin->row_textarea(_('Selection Values'), 'selects', stripslashes(implode("\n", (array)unserialize($field->objdata['selects'])))); - $admin->row_yesno(_('Make the First Option Default'), 'usedefault', $field->objdata['usedefault']); + $admin->row_textarea(T('Selection Values'), 'selects', stripslashes(implode("\n", (array)unserialize($field->objdata['selects'])))); + $admin->row_yesno(T('Make the First Option Default'), 'usedefault', $field->objdata['usedefault']); break; } @@ -241,7 +241,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit') // custom field permissions $admin->table_start(); - $admin->table_head(_('Custom Field Permissions')); + $admin->table_head(T('Custom Field Permissions')); if ($edit) { @@ -256,9 +256,9 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit') while ($usergroup = $db->fetch_array($usergroups)) { unset($listitem); - $admin->list_item(_('No Permission'), 0, $permissions["$usergroup[usergroupid]"] == 0); - $admin->list_item(_('Can View Field'), 1, $permissions["$usergroup[usergroupid]"] == 1); - $admin->list_item(_('Can View, Edit Field'), 2, $permissions["$usergroup[usergroupid]"] == 2); + $admin->list_item(T('No Permission'), 0, $permissions["$usergroup[usergroupid]"] == 0); + $admin->list_item(T('Can View Field'), 1, $permissions["$usergroup[usergroupid]"] == 1); + $admin->list_item(T('Can View, Edit Field'), 2, $permissions["$usergroup[usergroupid]"] == 2); $admin->row_list($usergroup['title'], "custom[$usergroup[usergroupid]]"); } @@ -281,11 +281,11 @@ if ($_REQUEST['do'] == 'modify') NavLinks::fieldsAdd(); $navigator->set_focus('link', 'fields-pages-fields', 'fields-pages'); - $admin->page_start(_('Additional Bug Fields')); + $admin->page_start(T('Additional Bug Fields')); $admin->table_start(); - $admin->table_head(_('Additional Bug Fields'), 3, 'custom_bug_fields'); - $admin->table_column_head(array(_('Display Name/Description'), _('Field ID'), _('Actions'))); + $admin->table_head(T('Additional Bug Fields'), 3, 'custom_bug_fields'); + $admin->table_column_head(array(T('Display Name/Description'), T('Field ID'), T('Actions'))); $fields = $db->query("SELECT * FROM " . TABLE_PREFIX . "bugfield ORDER BY fieldid ASC"); while ($field = $db->fetch_array($fields)) @@ -294,7 +294,7 @@ if ($_REQUEST['do'] == 'modify') array( "$field[name]
$field[description]
" => 'l', "$field[fieldid]" => 'c', - "[" . _('Edit') . "] [" . _('Delete') . "]" => 'c' + "[" . T('Edit') . "] [" . T('Delete') . "]" => 'c' ) ); } diff --git a/admin/global.php b/admin/global.php index 68ee72d..89eacdf 100755 --- a/admin/global.php +++ b/admin/global.php @@ -28,13 +28,13 @@ require_once('./includes/functions.php'); // admin navigation $bugsys->load('printer_navigation', 'navigator', true); -$navigator->add_top_link(_('Home'), '../index.php'); -$navigator->add_top_link(_('Logout'), '../login.php?do=cplogout'); +$navigator->add_top_link(T('Home'), '../index.php'); +$navigator->add_top_link(T('Logout'), '../login.php?do=cplogout'); -$navigator->add_component('tab', 'options', null, _('Options'), 'index.php'); -$navigator->add_component('tab', 'products', null, _('Products'), 'product.php'); -$navigator->add_component('tab', 'fields', null, _('Fields'), 'field.php'); -$navigator->add_component('tab', 'users', null, _('Users & Permissions'), 'user.php'); +$navigator->add_component('tab', 'options', null, T('Options'), 'index.php'); +$navigator->add_component('tab', 'products', null, T('Products'), 'product.php'); +$navigator->add_component('tab', 'fields', null, T('Fields'), 'field.php'); +$navigator->add_component('tab', 'users', null, T('Users & Permissions'), 'user.php'); require_once('./includes/class_admin_navigation.php'); @@ -42,7 +42,7 @@ require_once('./includes/class_admin_navigation.php'); // continue loading $bugsys->load('printer', 'admin', true); -$admin->setRealm(_('Administration')); +$admin->setRealm(T('Administration')); $admin->setLanguageInformation($language); $admin->css_link('../framework/printer.css.php'); @@ -54,14 +54,14 @@ function admin_login() define('ISSO_PRINTER_NO_NAVIGATION', 1); - $admin->page_start(_('Login'), null, '', 'document.cplogin.' . ($bugsys->userinfo['email'] ? 'password' : 'email') . '.focus();'); + $admin->page_start(T('Login'), null, '', 'document.cplogin.' . ($bugsys->userinfo['email'] ? 'password' : 'email') . '.focus();'); $admin->form_start('../login.php', 'cplogin', false, 'cplogin'); $admin->table_start(true, '425'); - $admin->table_head(_('Login to Bugdar')); - $admin->row_input(_('Email'), 'email', $bugsys->userinfo['email'], 2, 35, false, false, 'middle'); - $admin->row_input(_('Password'), 'password', '', 2, 35, false, true, 'middle'); - $admin->row_submit('', _('Login')); + $admin->table_head(T('Login to Bugdar')); + $admin->row_input(T('Email'), 'email', $bugsys->userinfo['email'], 2, 35, false, false, 'middle'); + $admin->row_input(T('Password'), 'password', '', 2, 35, false, true, 'middle'); + $admin->row_submit('', T('Login')); $admin->table_end(); $admin->form_end(); @@ -83,7 +83,7 @@ if (can_perform('canadminpanel')) $funct->cookie(COOKIE_PREFIX . 'adminsession', null); admin_login(); // do we need this message? - $admin->error(_('Invalid admin session has been terminated.')); + $admin->error(T('Invalid admin session has been terminated.')); } } else @@ -138,22 +138,22 @@ function AdminPageNavigatorCallback($baselink, $nextpage, $prevpage, $show, $pag if ($show['first']) { - $return .= '' . _('First') . ' ...'; + $return .= '' . T('First') . ' ...'; } if ($show['prev']) { - $return .= '' . _('Prev') . ' ...'; + $return .= '' . T('Prev') . ' ...'; } $return .= $pagebits; if ($show['next']) { - $return .= '... ' . _('Next') . ''; + $return .= '... ' . T('Next') . ''; } if ($show['last']) { - $return .= '... ' . _('Last') . ''; + $return .= '... ' . T('Last') . ''; } return '
' . $return . '
'; } diff --git a/admin/index.php b/admin/index.php index af3dd1c..4375764 100755 --- a/admin/index.php +++ b/admin/index.php @@ -25,7 +25,7 @@ NavLinks::optionsPages(); $navigator->set_focus('tab', 'options', null); $navigator->set_focus('link', 'options-pages-home', 'options-pages'); -$admin->page_start(_('Home')); +$admin->page_start(T('Home')); // ################################################################### @@ -37,11 +37,11 @@ if (!(defined('NO_VERSION_CHECK') AND constant('NO_VERSION_CHECK') == true)) $check = $bugsys->xml->parse($check); if (isset($check['version-check']['update'])) { - $admin->page_code('
' . _('Update Avaliable') . ':
' . sprintf(_('Your installation of Bugdar is out-of-date. You are running version %1$s and the latest version is %2$s. You can download the update at Blue Static\'s website. You are strongly encouraged to apply all updates to fix bugs and any security issues (if present).'), $bugsys->options['trackerversion'], $check['version-check']['update']['value']) . '
'); + $admin->page_code('
' . T('Update Avaliable') . ':
' . sprintf(T('Your installation of Bugdar is out-of-date. You are running version %1$s and the latest version is %2$s. You can download the update at Blue Static\'s website. You are strongly encouraged to apply all updates to fix bugs and any security issues (if present).'), $bugsys->options['trackerversion'], $check['version-check']['update']['value']) . '
'); } else if (isset($check['version-check']['up-to-date'])) { - $admin->page_code('
' . _('Up-to-Date') . ':
' . sprintf(_('Your installation of Bugdar is up-to-date. You are running version %1$s.'), $bugsys->options['trackerversion']) . '
'); + $admin->page_code('
' . T('Up-to-Date') . ':
' . sprintf(T('Your installation of Bugdar is up-to-date. You are running version %1$s.'), $bugsys->options['trackerversion']) . '
'); } } } @@ -49,34 +49,34 @@ if (!(defined('NO_VERSION_CHECK') AND constant('NO_VERSION_CHECK') == true)) // ################################################################### $admin->table_start(); -$admin->table_head(_('Welcome to the Bugdar Admin Panel')); +$admin->table_head(T('Welcome to the Bugdar Admin Panel')); // ------------------------------------------------------------------- -$admin->row_span(_('Version Information'), 'thead'); -$admin->row_text(_('Bugdar Version'), $bugsys->options['trackerversion']); -$admin->row_text(_('PHP Version'), phpversion()); +$admin->row_span(T('Version Information'), 'thead'); +$admin->row_text(T('Bugdar Version'), $bugsys->options['trackerversion']); +$admin->row_text(T('PHP Version'), phpversion()); $mysql = $db->query_first("SELECT VERSION() AS version"); -$admin->row_text(_('MySQL Version'), $mysql['version']); +$admin->row_text(T('MySQL Version'), $mysql['version']); -$admin->row_text(_('Web Server'), ($_SERVER['SERVER_SOFTWARE'] ? $_SERVER['SERVER_SOFTWARE'] : $SERVER['SERVER_SOFTWARE'])); +$admin->row_text(T('Web Server'), ($_SERVER['SERVER_SOFTWARE'] ? $_SERVER['SERVER_SOFTWARE'] : $SERVER['SERVER_SOFTWARE'])); // ------------------------------------------------------------------- -$admin->row_span(_('Server Options'), 'thead'); +$admin->row_span(T('Server Options'), 'thead'); $mysql = $db->query_first("SHOW VARIABLES LIKE 'max_allowed_packet'"); -$admin->row_text(_('MySQL: Maximum Packet Size'), $mysql['Value']); +$admin->row_text(T('MySQL: Maximum Packet Size'), $mysql['Value']); -$admin->row_text(_('MySQL: Maximum Upload Size'), $funct->fetch_max_attachment_size()); +$admin->row_text(T('MySQL: Maximum Upload Size'), $funct->fetch_max_attachment_size()); $mysql = $db->query_first("SHOW VARIABLES LIKE 'ft_min_word_len'"); -$admin->row_text(_('MySQL: Full-Text Search Minimum Word Length'), $mysql['Value']); +$admin->row_text(T('MySQL: Full-Text Search Minimum Word Length'), $mysql['Value']); -$admin->row_text(_('PHP: Safe Mode'), ((ini_get('safe_mode') == 1 OR strtolower(ini_get('safe_mode')) == 'on') ? _('Yes') : _('No'))); -$admin->row_text(_('PHP: Register Globals'), ((ini_get('register_globals') == 1 OR strtolower(ini_get('register_globals')) == 'on') ? _('Yes') : _('No'))); -$admin->row_text(_('PHP: Magic Quotes GPC'), ((ini_get('magic_quotes_gpc') == 1 OR strtolower(ini_get('magic_quotes_gpc')) == 'on') ? _('Yes') : _('No'))); -$admin->row_text(_('PHP: Magic Quotes Sybase'), ((ini_get('magic_quotes_sybase') == 1 OR strtolower(ini_get('magic_quotes_sybase')) == 'on') ? _('Yes') : _('No'))); -$admin->row_text(_('PHP: Gettext Installed'), (function_exists('ngettext') ? _('Yes') : _('No'))); +$admin->row_text(T('PHP: Safe Mode'), ((ini_get('safe_mode') == 1 OR strtolower(ini_get('safe_mode')) == 'on') ? T('Yes') : T('No'))); +$admin->row_text(T('PHP: Register Globals'), ((ini_get('register_globals') == 1 OR strtolower(ini_get('register_globals')) == 'on') ? T('Yes') : T('No'))); +$admin->row_text(T('PHP: Magic Quotes GPC'), ((ini_get('magic_quotes_gpc') == 1 OR strtolower(ini_get('magic_quotes_gpc')) == 'on') ? T('Yes') : T('No'))); +$admin->row_text(T('PHP: Magic Quotes Sybase'), ((ini_get('magic_quotes_sybase') == 1 OR strtolower(ini_get('magic_quotes_sybase')) == 'on') ? T('Yes') : T('No'))); +$admin->row_text(T('PHP: Gettext Installed'), (function_exists('ngettext') ? T('Yes') : T('No'))); // ------------------------------------------------------------------- diff --git a/admin/language.php b/admin/language.php index fc39e08..fdad158 100644 --- a/admin/language.php +++ b/admin/language.php @@ -56,7 +56,7 @@ if ($_REQUEST['do'] == 'kill') if ($_REQUEST['do'] == 'delete') { - $admin->page_confirm(_('Are you sure you want to delete this language?'), 'language.php', 'kill', array('languageid' => $bugsys->input_clean('languageid', TYPE_UINT))); + $admin->page_confirm(T('Are you sure you want to delete this language?'), 'language.php', 'kill', array('languageid' => $bugsys->input_clean('languageid', TYPE_UINT))); } // ################################################################### @@ -81,19 +81,19 @@ if ($_REQUEST['do'] == 'add') NavLinks::languagesAdd(); $navigator->set_focus('link', 'options-languages-add', 'options-languages'); - $admin->page_start(_('New Language')); + $admin->page_start(T('New Language')); $admin->form_start('language.php', 'insert'); $admin->table_start(); - $admin->table_head(_('New Language')); + $admin->table_head(T('New Language')); - $admin->row_input(_('Title'), 'title'); - $admin->row_input(_('Gettext Language Code (language_COUNTRY)'), 'langcode'); - $admin->row_input(_('Character Set'), 'charset', 'utf-8'); - $admin->list_item(_('Left-to-Right'), 'ltr', true); - $admin->list_item(_('Right-to-Left'), 'rtl'); - $admin->row_list(_('Direction'), 'direction'); - $admin->row_yesno(_('User Selectable'), 'userselect', true); + $admin->row_input(T('Title'), 'title'); + $admin->row_input(T('Gettext Language Code (language_COUNTRY)'), 'langcode'); + $admin->row_input(T('Character Set'), 'charset', 'utf-8'); + $admin->list_item(T('Left-to-Right'), 'ltr', true); + $admin->list_item(T('Right-to-Left'), 'rtl'); + $admin->row_list(T('Direction'), 'direction'); + $admin->row_yesno(T('User Selectable'), 'userselect', true); $admin->row_submit(); $admin->table_end(); @@ -133,21 +133,21 @@ if ($_REQUEST['do'] == 'edit') $language =& $languageapi->objdata; - $admin->page_start(_('Edit Language')); + $admin->page_start(T('Edit Language')); $admin->form_start('language.php', 'update'); $admin->table_start(); - $admin->table_head(sprintf(_('Edit Language - %1$s'), $language['title'])); + $admin->table_head(sprintf(T('Edit Language - %1$s'), $language['title'])); $admin->form_hidden_field('languageid', $language['languageid']); - $admin->row_input(_('Title'), 'title', $language['title']); - $admin->row_input(_('Gettext Language Code (language_COUNTRY)'), 'langcode', $language['langcode']); - $admin->row_input(_('Character Set'), 'charset', $language['charset']); - $admin->list_item(_('Left-to-Right'), 'ltr', (($language['direction'] == 'ltr') ? true : false)); - $admin->list_item(_('Right-to-Left'), 'rtl', (($language['direction'] == 'rtl') ? true : false)); - $admin->row_list(_('Direction'), 'direction'); - $admin->row_yesno(_('User Selectable'), 'userselect', $language['userselect']); + $admin->row_input(T('Title'), 'title', $language['title']); + $admin->row_input(T('Gettext Language Code (language_COUNTRY)'), 'langcode', $language['langcode']); + $admin->row_input(T('Character Set'), 'charset', $language['charset']); + $admin->list_item(T('Left-to-Right'), 'ltr', (($language['direction'] == 'ltr') ? true : false)); + $admin->list_item(T('Right-to-Left'), 'rtl', (($language['direction'] == 'rtl') ? true : false)); + $admin->row_list(T('Direction'), 'direction'); + $admin->row_yesno(T('User Selectable'), 'userselect', $language['userselect']); $admin->row_submit(); $admin->table_end(); @@ -163,12 +163,12 @@ if ($_REQUEST['do'] == 'modify') NavLinks::languagesAdd(); $navigator->set_focus('link', 'options-pages-languages', 'options-pages'); - $admin->page_start(_('Manage Languages')); + $admin->page_start(T('Manage Languages')); $admin->table_start(); - $admin->table_head(_('Manage Languages'), 3, 'language_manage'); + $admin->table_head(T('Manage Languages'), 3, 'language_manage'); - $admin->table_column_head(array(_('Title'), _('Language Code / Charset'), _('Options'))); + $admin->table_column_head(array(T('Title'), T('Language Code / Charset'), T('Options'))); $languages = $db->query("SELECT * FROM " . TABLE_PREFIX . "language ORDER BY languageid ASC"); while ($language = $db->fetch_array($languages)) @@ -176,7 +176,7 @@ if ($_REQUEST['do'] == 'modify') $admin->row_multi_item(array( "$language[title]" => 'l', $language['langcode'] . ' / ' . $language['charset'] => 'c', - (($bugsys->options['defaultlanguage'] == $language['languageid']) ? '' . _('DEFAULT LANGUAGE') . ' / ' : '') . ($language['userselect'] ? _('User Selectable') : _('Private')) => 'c' + (($bugsys->options['defaultlanguage'] == $language['languageid']) ? '' . T('DEFAULT LANGUAGE') . ' / ' : '') . ($language['userselect'] ? T('User Selectable') : T('Private')) => 'c' )); } diff --git a/admin/permission.php b/admin/permission.php index 627063e..43ffea9 100755 --- a/admin/permission.php +++ b/admin/permission.php @@ -37,30 +37,30 @@ if (!can_perform('canadmingroups')) // define permissions as groups $permissions = array( - _('General Permissions') => array( - 'canviewbugs' => _('Can View Bugs'), - 'canviewhidden' => _('Can View All Hidden Bugs and Comments'), - 'canviewownhidden' => _('Can View Own Hidden Bugs'), - 'cansubscribe' => _('Can Subscribe to Bugs'), + T('General Permissions') => array( + 'canviewbugs' => T('Can View Bugs'), + 'canviewhidden' => T('Can View All Hidden Bugs and Comments'), + 'canviewownhidden' => T('Can View Own Hidden Bugs'), + 'cansubscribe' => T('Can Subscribe to Bugs'), ), - _('Posting/Submitting Permissions') => array( - 'canvote' => _('Can Vote on Polls'), - 'cansubmitbugs' => _('Can Submit Bugs'), - 'canpostcomments' => _('Can Post Comments'), - 'cangetattach' => _('Can View Attachments'), - 'canputattach' => _('Can Upload/Edit Own Attachments'), - 'caneditattach' => _('Can Manage All Attachments') + T('Posting/Submitting Permissions') => array( + 'canvote' => T('Can Vote on Polls'), + 'cansubmitbugs' => T('Can Submit Bugs'), + 'canpostcomments' => T('Can Post Comments'), + 'cangetattach' => T('Can View Attachments'), + 'canputattach' => T('Can Upload/Edit Own Attachments'), + 'caneditattach' => T('Can Manage All Attachments') ), - _('Moderation/Managment Permissions') => array( - 'caneditown' => _('Can Edit Own Bugs'), - 'caneditother' => _('Can Edit Others\' Bugs'), - 'caneditownreply' => _('Can Edit Own Comments'), - 'caneditotherreply' => _('Can Edit Others\' Comments'), - 'canassign' => _('Can Assign Bugs'), - 'canchangestatus' => _('Can Change Status'), - 'candeletedata' => _('Can Delete Bugs and Comments') + T('Moderation/Managment Permissions') => array( + 'caneditown' => T('Can Edit Own Bugs'), + 'caneditother' => T('Can Edit Others\' Bugs'), + 'caneditownreply' => T('Can Edit Own Comments'), + 'caneditotherreply' => T('Can Edit Others\' Comments'), + 'canassign' => T('Can Assign Bugs'), + 'canchangestatus' => T('Can Change Status'), + 'candeletedata' => T('Can Delete Bugs and Comments') ) ); @@ -87,7 +87,7 @@ if ($_REQUEST['do'] == 'kill') if ($_REQUEST['do'] == 'delete') { - $admin->page_confirm(_('Are you sure you want to revert this permission mask?'), 'permission.php', 'kill', array('usergroupid' => $bugsys->input_clean('usergroupid', TYPE_UINT), 'productid' => $bugsys->input_clean('productid', TYPE_UINT))); + $admin->page_confirm(T('Are you sure you want to revert this permission mask?'), 'permission.php', 'kill', array('usergroupid' => $bugsys->input_clean('usergroupid', TYPE_UINT), 'productid' => $bugsys->input_clean('productid', TYPE_UINT))); } // ################################################################### @@ -107,7 +107,7 @@ if ($_REQUEST['do'] == 'edit') $admin->error(L_INVALID_ID); } - $admin->page_start(_('Edit Permissions')); + $admin->page_start(T('Edit Permissions')); $admin->form_start('permission.php', 'update'); $admin->form_hidden_field('usergroupid', $usergroup['usergroupid']); @@ -125,7 +125,7 @@ if ($_REQUEST['do'] == 'edit') // Permission $admin->table_start(); - $admin->table_head(sprintf(_('Permissions: %1$s - %2$s'), $usergroup['title'], $product['title'])); + $admin->table_head(sprintf(T('Permissions: %1$s - %2$s'), $usergroup['title'], $product['title'])); foreach ($permissions AS $group => $settings) { @@ -175,10 +175,10 @@ if ($_POST['do'] == 'update') if ($_REQUEST['do'] == 'modify') { - $admin->page_start(_('Permission Manager')); + $admin->page_start(T('Permission Manager')); $admin->table_start(); - $admin->table_head(_('Permission Manager')); + $admin->table_head(T('Permission Manager')); $groups = $db->query("SELECT * FROM " . TABLE_PREFIX . "usergroup ORDER BY usergroupid ASC"); while ($group = $db->fetch_array($groups)) @@ -189,7 +189,7 @@ if ($_REQUEST['do'] == 'modify') foreach ($usergroups AS $group) { - $admin->row_text($group['title'], ($bugsys->in['usergroupid'] != $group['usergroupid'] ? "[" . _('Expand') . "]" : ''), 'top', 2, 'alt3'); + $admin->row_text($group['title'], ($bugsys->in['usergroupid'] != $group['usergroupid'] ? "[" . T('Expand') . "]" : ''), 'top', 2, 'alt3'); if ($bugsys->in['usergroupid'] == $group['usergroupid']) { @@ -207,14 +207,14 @@ if ($_REQUEST['do'] == 'modify') if (!isset($permissions["$product[productid]"])) { - $statuslink = _('Inherited From Usergroup Settings: '); - $statuslink .= "[" . _('Customize') . ']'; + $statuslink = T('Inherited From Usergroup Settings: '); + $statuslink .= "[" . T('Customize') . ']'; } else { - $statuslink = _('Customized: '); - $statuslink .= "[" . _('Edit') . ']'; - $statuslink .= " [" . _('Revert') . ']'; + $statuslink = T('Customized: '); + $statuslink .= "[" . T('Edit') . ']'; + $statuslink .= " [" . T('Revert') . ']'; } $admin->row_text($product['title'], $statuslink); diff --git a/admin/priority.php b/admin/priority.php index 19cacb1..93bc424 100755 --- a/admin/priority.php +++ b/admin/priority.php @@ -56,7 +56,7 @@ if ($_REQUEST['do'] == 'kill') if ($_REQUEST['do'] == 'delete') { - $admin->page_confirm(_('Are you sure you want to delete this priority? Doing so will revert all bugs to the default priority (which is set in the options panel)?'), 'priority.php', 'kill', array('priorityid' => $bugsys->input_clean('priorityid', TYPE_UINT))); + $admin->page_confirm(T('Are you sure you want to delete this priority? Doing so will revert all bugs to the default priority (which is set in the options panel)?'), 'priority.php', 'kill', array('priorityid' => $bugsys->input_clean('priorityid', TYPE_UINT))); } // ################################################################### @@ -78,13 +78,13 @@ if ($_REQUEST['do'] == 'add') NavLinks::prioritiesAdd(); $navigator->set_focus('link', 'priorities-add', 'priorities'); - $admin->page_start(_('Add New Priority')); + $admin->page_start(T('Add New Priority')); $admin->form_start('priority.php', 'insert'); $admin->table_start(); - $admin->table_head(_('New Priority')); - $admin->row_input(_('Priority Title
The title of this priority flag (eg: `Slated for Development` or `Address Now`)
'), 'priority'); - $admin->row_input(_('Display Order
The order in which the priorities are displayed. The higher the number, the lower down in the list it is.
'), 'displayorder'); + $admin->table_head(T('New Priority')); + $admin->row_input(T('Priority Title
The title of this priority flag (eg: `Slated for Development` or `Address Now`)
'), 'priority'); + $admin->row_input(T('Display Order
The order in which the priorities are displayed. The higher the number, the lower down in the list it is.
'), 'displayorder'); $admin->row_submit(); $admin->table_end(); $admin->form_end(); @@ -118,14 +118,14 @@ if ($_REQUEST['do'] == 'edit') $priority->set_condition(); $priority->fetch(); - $admin->page_start(_('Edit Priority')); + $admin->page_start(T('Edit Priority')); $admin->form_start('priority.php', 'update'); $admin->form_hidden_field('priorityid', $priority->objdata['priorityid']); $admin->table_start(); - $admin->table_head(sprintf(_('Edit Priority `%1$s` (id: %2$s)'), $priority->objdata['priority'], $priority->objdata['priorityid'])); - $admin->row_input(_('Priority Title
The title of this priority flag (eg: `Slated for Development` or `Address Now`)
'), 'priority', $priority->objdata['priority']); - $admin->row_input(_('Display Order
The order in which the priorities are displayed. The higher the number, the lower down in the list it is.
'), 'displayorder', $priority->objdata['displayorder']); + $admin->table_head(sprintf(T('Edit Priority `%1$s` (id: %2$s)'), $priority->objdata['priority'], $priority->objdata['priorityid'])); + $admin->row_input(T('Priority Title
The title of this priority flag (eg: `Slated for Development` or `Address Now`)
'), 'priority', $priority->objdata['priority']); + $admin->row_input(T('Display Order
The order in which the priorities are displayed. The higher the number, the lower down in the list it is.
'), 'displayorder', $priority->objdata['displayorder']); $admin->row_submit(); $admin->table_end(); $admin->form_end(); @@ -140,17 +140,17 @@ if ($_REQUEST['do'] == 'modify') NavLinks::prioritiesAdd(); $navigator->set_focus('link', 'fields-pages-priorities', 'fields-pages'); - $admin->page_start(_('Priority Manager')); + $admin->page_start(T('Priority Manager')); $priorities = $db->query("SELECT * FROM " . TABLE_PREFIX . "priority ORDER BY displayorder"); $admin->form_start('priority.php', 'null'); $admin->table_start(); - $admin->table_head(_('Priority Manager')); + $admin->table_head(T('Priority Manager')); while ($priority = $db->fetch_array($priorities)) { - $admin->row_text("$priority[displayorder]: $priority[priority]", "(priorityid: $priority[priorityid]) [" . _('Edit') . "] [" . _('Delete') . "]"); + $admin->row_text("$priority[displayorder]: $priority[priority]", "(priorityid: $priority[priorityid]) [" . T('Edit') . "] [" . T('Delete') . "]"); } $db->free_result($priorities); diff --git a/admin/product.php b/admin/product.php index a0b1599..82705fd 100755 --- a/admin/product.php +++ b/admin/product.php @@ -41,22 +41,22 @@ function construct_option_list($type_display, $type, $id, $edit, $addcomponent, if ($edit) { - $opt .= ''; + $opt .= ''; } if ($delete) { - $opt .= ''; + $opt .= ''; } if ($addcomponent) { - $opt .= ''; + $opt .= ''; } if ($addversion) { - $opt .= ''; + $opt .= ''; } $type = strtolower($type); @@ -65,7 +65,7 @@ function construct_option_list($type_display, $type, $id, $edit, $addcomponent, $displayorder = (($displayorder != -1) ? ' ' : ''); - return $displayorder . ' '; + return $displayorder . ' '; } // ################################################################### @@ -92,7 +92,7 @@ if ($_REQUEST['do'] == 'killversion') if ($_REQUEST['do'] == 'deleteversion') { - $admin->page_confirm(_('Are you sure you want to delete this version? Doing so will do delete all the bugs with this version.'), 'product.php', 'killversion', array('versionid' => $bugsys->input_clean('versionid', TYPE_UINT))); + $admin->page_confirm(T('Are you sure you want to delete this version? Doing so will do delete all the bugs with this version.'), 'product.php', 'killversion', array('versionid' => $bugsys->input_clean('versionid', TYPE_UINT))); } // ################################################################### @@ -124,15 +124,15 @@ if ($_REQUEST['do'] == 'addversion') $bugsys->in['productid'] = 0; } - $admin->page_start(_('Add Version')); + $admin->page_start(T('Add Version')); $admin->form_start('product.php', 'insertversion'); $admin->form_hidden_field('productid', $bugsys->in['productid']); $admin->table_start(); - $admin->table_head(_('Add New Version')); - $admin->row_input(_('Version Number
This is the version string for this product.
'), 'version'); - $admin->row_input(_('Display Order
The order in which the versions are displayed.
'), 'displayorder'); - $admin->row_yesno(_('Obsolete
An obsolete version cannot have new bugs filed against it, but existing ones can be set to it.
'), 'obsolete', false); + $admin->table_head(T('Add New Version')); + $admin->row_input(T('Version Number
This is the version string for this product.
'), 'version'); + $admin->row_input(T('Display Order
The order in which the versions are displayed.
'), 'displayorder'); + $admin->row_yesno(T('Obsolete
An obsolete version cannot have new bugs filed against it, but existing ones can be set to it.
'), 'obsolete', false); $admin->row_submit(); $admin->table_end(); $admin->form_end(); @@ -146,7 +146,7 @@ if ($_REQUEST['do'] == 'updateversion') { if (empty($bugsys->in['version'])) { - $admin->error(_('Please fill in a version number.')); + $admin->error(T('Please fill in a version number.')); } $db->query("UPDATE " . TABLE_PREFIX . "version SET version = '" . $bugsys->input_escape('version') . "', displayorder = " . $bugsys->input_clean('displayorder', TYPE_UINT) . ", obsolete = " . $bugsys->input_clean('obsolete', TYPE_UINT) . " WHERE versionid = " . $bugsys->input_clean('versionid', TYPE_UINT)); @@ -159,7 +159,7 @@ if ($_REQUEST['do'] == 'updateversion') if ($_REQUEST['do'] == 'editversion') { - $admin->page_start(_('Edit Version')); + $admin->page_start(T('Edit Version')); $version = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "version WHERE versionid = " . $bugsys->input_clean('versionid', TYPE_UINT)); if (!is_array($version)) @@ -170,10 +170,10 @@ if ($_REQUEST['do'] == 'editversion') $admin->form_start('product.php', 'updateversion'); $admin->form_hidden_field('versionid', $version['versionid']); $admin->table_start(); - $admin->table_head(sprintf(_('Edit Version - %1$s'), $version['version'])); - $admin->row_input(_('Version Number
This is the version string for this product.
'), 'version', $version['version']); - $admin->row_input(_('Display Order
The order in which the versions are displayed.
'), 'displayorder', $version['displayorder']); - $admin->row_yesno(_('Obsolete
An obsolete version cannot have new bugs filed against it, but existing ones can be set to it.
'), 'obsolete', $version['obsolete']); + $admin->table_head(sprintf(T('Edit Version - %1$s'), $version['version'])); + $admin->row_input(T('Version Number
This is the version string for this product.
'), 'version', $version['version']); + $admin->row_input(T('Display Order
The order in which the versions are displayed.
'), 'displayorder', $version['displayorder']); + $admin->row_yesno(T('Obsolete
An obsolete version cannot have new bugs filed against it, but existing ones can be set to it.
'), 'obsolete', $version['obsolete']); $admin->row_submit(); $admin->table_end(); $admin->form_end(); @@ -205,7 +205,7 @@ if ($_REQUEST['do'] == 'killproduct') if ($_REQUEST['do'] == 'deleteproduct') { - $admin->page_confirm(_('Are you sure you want to delete this product and all of it\'s versions and components and any bugs that have been assigned those products or components?'), 'product.php', 'killproduct', array('productid' => $bugsys->input_clean('productid', TYPE_UINT))); + $admin->page_confirm(T('Are you sure you want to delete this product and all of it\'s versions and components and any bugs that have been assigned those products or components?'), 'product.php', 'killproduct', array('productid' => $bugsys->input_clean('productid', TYPE_UINT))); } // ################################################################### @@ -214,7 +214,7 @@ if ($_REQUEST['do'] == 'insertproduct') { if (empty($bugsys->in['title'])) { - $admin->error(_('Please go back and fill in the title field.')); + $admin->error(T('Please go back and fill in the title field.')); } $db->query(" @@ -244,15 +244,15 @@ if ($_REQUEST['do'] == 'addproduct') } $navigator->set_focus('link', 'products-add', 'products'); - $admin->page_start(_('Add New Product')); + $admin->page_start(T('Add New Product')); $admin->form_start('product.php', 'insertproduct'); $admin->form_hidden_field('parentid', $bugsys->in['productid']); $admin->table_start(); - $admin->table_head(_('Add Product')); - $admin->row_input(_('Title'), 'title'); - $admin->row_textarea(_('Description
A short description of this product.
'), 'description'); - $admin->row_input(_('Display Order
The order in which the products are displayed.
'), 'displayorder'); + $admin->table_head(T('Add Product')); + $admin->row_input(T('Title'), 'title'); + $admin->row_textarea(T('Description
A short description of this product.
'), 'description'); + $admin->row_input(T('Display Order
The order in which the products are displayed.
'), 'displayorder'); $admin->row_submit(); $admin->table_end(); $admin->form_end(); @@ -266,7 +266,7 @@ if ($_REQUEST['do'] == 'updateproduct') { if (empty($bugsys->in['title'])) { - $admin->error(_('Please go back and fill in the title field.')); + $admin->error(T('Please go back and fill in the title field.')); } if (empty($bugsys->in['productid'])) @@ -287,7 +287,7 @@ if ($_REQUEST['do'] == 'editproduct') NavLinks::productsEdit($bugsys->input_clean('productid', TYPE_UINT)); $navigator->set_focus('link', 'products-edit', 'products-edit'); - $admin->page_start(_('Edit Product')); + $admin->page_start(T('Edit Product')); $product = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "product WHERE productid = " . $bugsys->in['productid']); if (!is_array($product)) @@ -298,10 +298,10 @@ if ($_REQUEST['do'] == 'editproduct') $admin->form_start('product.php', 'updateproduct'); $admin->form_hidden_field('productid', $product['productid']); $admin->table_start(); - $admin->table_head(sprintf(_('Edit Product - %1$s'), $product['title'])); - $admin->row_input(_('Title'), 'title', $product['title']); - $admin->row_textarea(_('Description
A short description of this product.
'), 'description', $product['description']); - $admin->row_input(_('Display Order
The order in which the products are displayed.
'), 'displayorder', $product['displayorder']); + $admin->table_head(sprintf(T('Edit Product - %1$s'), $product['title'])); + $admin->row_input(T('Title'), 'title', $product['title']); + $admin->row_textarea(T('Description
A short description of this product.
'), 'description', $product['description']); + $admin->row_input(T('Display Order
The order in which the products are displayed.
'), 'displayorder', $product['displayorder']); $admin->row_submit(); $admin->table_end(); $admin->form_end(); @@ -338,7 +338,7 @@ if ($_REQUEST['do'] == 'modify') { $navigator->set_focus('link', 'products-manage', 'products'); - $admin->page_start(_('Products and Versions')); + $admin->page_start(T('Products and Versions')); $javascript = << @@ -378,15 +378,15 @@ EOF; } $admin->table_start(); - $admin->table_head(_('Products / Versions')); + $admin->table_head(T('Products / Versions')); // Handle our global versions if (is_array($versions['0'])) { - $admin->row_text(_('Global Versions'), construct_option_list(_('Product'), 'product', -1, 0, 0, 1, 0, -1), 'middle', 2, 'alt3'); + $admin->row_text(T('Global Versions'), construct_option_list(T('Product'), 'product', -1, 0, 0, 1, 0, -1), 'middle', 2, 'alt3'); foreach ($versions['0'] AS $version) { - $admin->row_text('-- ' . $version['version'], construct_option_list(_('Version'), 'version', $version['versionid'], 1, 0, 0, 1, $version['displayorder']), 'middle', 2, 'alt2'); + $admin->row_text('-- ' . $version['version'], construct_option_list(T('Version'), 'version', $version['versionid'], 1, 0, 0, 1, $version['displayorder']), 'middle', 2, 'alt2'); } } @@ -394,14 +394,14 @@ EOF; foreach ($products AS $product) { // Product - $admin->row_text("$product[title]", construct_option_list(_('Product'), 'product', $product['productid'], 1, 1, 1, 1, $product['displayorder']), 'middle', 2, 'alt3'); + $admin->row_text("$product[title]", construct_option_list(T('Product'), 'product', $product['productid'], 1, 1, 1, 1, $product['displayorder']), 'middle', 2, 'alt3'); // Versions if (is_array($versions["$product[productid]"])) { foreach ($versions["$product[productid]"] AS $version) { - $admin->row_text('-- ' . $version['version'], construct_option_list(_('Version'), 'version', $version['versionid'], 1, 0, 0, 1, $version['displayorder']), 'middle', 2, 'alt2'); + $admin->row_text('-- ' . $version['version'], construct_option_list(T('Version'), 'version', $version['versionid'], 1, 0, 0, 1, $version['displayorder']), 'middle', 2, 'alt2'); } } @@ -410,21 +410,21 @@ EOF; { foreach ($components["$product[productid]"] AS $comp) { - $admin->row_text("-- $comp[title]", construct_option_list(_('Component'), 'component', $comp['productid'], 1, 0, 1, 1, $comp['displayorder']), 'middle', 2, 'alt1'); + $admin->row_text("-- $comp[title]", construct_option_list(T('Component'), 'component', $comp['productid'], 1, 0, 1, 1, $comp['displayorder']), 'middle', 2, 'alt1'); // Component versions if (is_array($versions["$comp[productid]"])) { foreach ($versions["$comp[productid]"] AS $version) { - $admin->row_text('---- ' . $version['version'], construct_option_list(_('Version'), 'version', $version['versionid'], 1, 0, 0, 1, $version['displayorder']), 'middle', 2, 'alt2'); + $admin->row_text('---- ' . $version['version'], construct_option_list(T('Version'), 'version', $version['versionid'], 1, 0, 0, 1, $version['displayorder']), 'middle', 2, 'alt2'); } } } } } - $admin->row_submit(null, _('Save Display Order'), null); + $admin->row_submit(null, T('Save Display Order'), null); $admin->table_end(); diff --git a/admin/resolution.php b/admin/resolution.php index d74cffa..1f8d389 100755 --- a/admin/resolution.php +++ b/admin/resolution.php @@ -56,7 +56,7 @@ if ($_REQUEST['do'] == 'kill') if ($_REQUEST['do'] == 'delete') { - $admin->page_confirm(_('Are you sure you want to delete this resolution? Doing so will revert all bugs to the default resolution (which is set in the options panel)?'), 'resolution.php', 'kill', array('resolutionid' => $bugsys->input_clean('resolutionid', TYPE_UINT))); + $admin->page_confirm(T('Are you sure you want to delete this resolution? Doing so will revert all bugs to the default resolution (which is set in the options panel)?'), 'resolution.php', 'kill', array('resolutionid' => $bugsys->input_clean('resolutionid', TYPE_UINT))); } // ################################################################### @@ -78,13 +78,13 @@ if ($_REQUEST['do'] == 'add') NavLinks::resolutionsAdd(); $navigator->set_focus('link', 'resolutions-add', 'resolutions'); - $admin->page_start(_('Add New Resolution')); + $admin->page_start(T('Add New Resolution')); $admin->form_start('resolution.php', 'insert'); $admin->table_start(); - $admin->table_head(_('New Resolution')); - $admin->row_input(_('Resolution Title
The title of this resolution flag (eg: `Fixed` or `Bogus`)
'), 'resolution'); - $admin->row_input(_('Display Order
The order in which the resolutions are displayed. The higher the number, the lower down in the list it is.
'), 'displayorder'); + $admin->table_head(T('New Resolution')); + $admin->row_input(T('Resolution Title
The title of this resolution flag (eg: `Fixed` or `Bogus`)
'), 'resolution'); + $admin->row_input(T('Display Order
The order in which the resolutions are displayed. The higher the number, the lower down in the list it is.
'), 'displayorder'); $admin->row_submit(); $admin->table_end(); $admin->form_end(); @@ -118,14 +118,14 @@ if ($_REQUEST['do'] == 'edit') $resolution->set_condition(); $resolution->fetch(); - $admin->page_start(_('Edit Resolution')); + $admin->page_start(T('Edit Resolution')); $admin->form_start('resolution.php', 'update'); $admin->form_hidden_field('resolutionid', $resolution->objdata['resolutionid']); $admin->table_start(); - $admin->table_head(sprintf(_('Edit Resolution - %1$s (id: %2$s)'), $resolution->objdata['resolution'], $resolution->objdata['resolutionid'])); - $admin->row_input(_('Resolution Title
The title of this resolution flag (eg: `Fixed` or `Bogus`)
'), 'resolution', $resolution->objdata['resolution']); - $admin->row_input(_('Display Order
The order in which the resolutions are displayed. The higher the number, the lower down in the list it is.
'), 'displayorder', $resolution->objdata['displayorder']); + $admin->table_head(sprintf(T('Edit Resolution - %1$s (id: %2$s)'), $resolution->objdata['resolution'], $resolution->objdata['resolutionid'])); + $admin->row_input(T('Resolution Title
The title of this resolution flag (eg: `Fixed` or `Bogus`)
'), 'resolution', $resolution->objdata['resolution']); + $admin->row_input(T('Display Order
The order in which the resolutions are displayed. The higher the number, the lower down in the list it is.
'), 'displayorder', $resolution->objdata['displayorder']); $admin->row_submit(); $admin->table_end(); $admin->form_end(); @@ -140,17 +140,17 @@ if ($_REQUEST['do'] == 'modify') NavLinks::resolutionsAdd(); $navigator->set_focus('link', 'fields-pages-resolutions', 'fields-pages'); - $admin->page_start(_('Resolution Manager')); + $admin->page_start(T('Resolution Manager')); $resolutions = $db->query("SELECT * FROM " . TABLE_PREFIX . "resolution ORDER BY displayorder"); $admin->form_start('resolution.php', 'null'); $admin->table_start(); - $admin->table_head(_('Resolution Manager')); + $admin->table_head(T('Resolution Manager')); while ($resolution = $db->fetch_array($resolutions)) { - $admin->row_text("$resolution[displayorder]: $resolution[resolution]", "(resolutionid: $resolution[resolutionid]) [" . _('Edit') . "] [" . _('Delete') . "]"); + $admin->row_text("$resolution[displayorder]: $resolution[resolution]", "(resolutionid: $resolution[resolutionid]) [" . T('Edit') . "] [" . T('Delete') . "]"); } $db->free_result($resolutions); diff --git a/admin/setting.php b/admin/setting.php index e7b5c08..17d486d 100755 --- a/admin/setting.php +++ b/admin/setting.php @@ -72,7 +72,7 @@ if ($_POST['do'] == 'update') if ($_REQUEST['do'] == 'modify') { - $admin->page_start(_('Settings')); + $admin->page_start(T('Settings')); $admin->form_start('setting.php', 'update'); @@ -80,10 +80,10 @@ if ($_REQUEST['do'] == 'modify') // ################################################################### $admin->table_start(); - $admin->table_head(_('General Options')); + $admin->table_head(T('General Options')); // authmethod - $admin->row_span(_('Authentication Method'), 'thead'); + $admin->row_span(T('Authentication Method'), 'thead'); $methods = $funct->scandir('./includes/auth/'); foreach ($methods[''] AS $path) { @@ -92,129 +92,129 @@ if ($_REQUEST['do'] == 'modify') $admin->list_item(ucwords(str_replace('_', ' ', $matches[1])), $matches[1], ($matches[1] == $bugsys->options['authmethod'])); } } - $admin->row_list(_('The authentication class to use to validate cookie data and longins. You may need to edit the actual file for certain authentication systems.'), 'setting[authmethod]'); + $admin->row_list(T('The authentication class to use to validate cookie data and longins. You may need to edit the actual file for certain authentication systems.'), 'setting[authmethod]'); // allownewreg - $admin->row_span(_('Allow New Registrations'), 'thead'); - $admin->row_yesno(_('If this is set to yes, then new users will be allowed to register.'), 'setting[allownewreg]', $bugsys->options['allownewreg']); + $admin->row_span(T('Allow New Registrations'), 'thead'); + $admin->row_yesno(T('If this is set to yes, then new users will be allowed to register.'), 'setting[allownewreg]', $bugsys->options['allownewreg']); // verifyemail - $admin->row_span(_('Require Activation Email'), 'thead'); - $admin->row_yesno(_('Setting this to yes will force all new users to verify their account with an email activation link.'), 'setting[verifyemail]', $bugsys->options['verifyemail']); + $admin->row_span(T('Require Activation Email'), 'thead'); + $admin->row_yesno(T('Setting this to yes will force all new users to verify their account with an email activation link.'), 'setting[verifyemail]', $bugsys->options['verifyemail']); // moderatenewusers - $admin->row_span(_('Moderate New Users'), 'thead'); - $admin->row_yesno(_('All new users will have to be approved by the administration before being able to have normal user rights.'), 'setting[moderatenewusers]', $bugsys->options['moderatenewusers']); + $admin->row_span(T('Moderate New Users'), 'thead'); + $admin->row_yesno(T('All new users will have to be approved by the administration before being able to have normal user rights.'), 'setting[moderatenewusers]', $bugsys->options['moderatenewusers']); // sendwelcomemail - $admin->row_span(_('Send New Use Welcome Email'), 'thead'); - $admin->row_yesno(_('Setting this option to yes will send each new verified user a welcome email.'), 'setting[sendwelcomemail]', $bugsys->options['sendwelcomemail']); + $admin->row_span(T('Send New Use Welcome Email'), 'thead'); + $admin->row_yesno(T('Setting this option to yes will send each new verified user a welcome email.'), 'setting[sendwelcomemail]', $bugsys->options['sendwelcomemail']); // webmasteremail - $admin->row_span(_('Webmaster Email Address'), 'thead'); - $admin->row_input(_('The email address from which emails will be sent out.'), 'setting[webmasteremail]', $bugsys->options['webmasteremail']); + $admin->row_span(T('Webmaster Email Address'), 'thead'); + $admin->row_input(T('The email address from which emails will be sent out.'), 'setting[webmasteremail]', $bugsys->options['webmasteremail']); // trackertitle - $admin->row_span(_('Tracker Title'), 'thead'); - $admin->row_input(_('The global name of the bug tracker. Example: Blue Static Bug Tracker'), 'setting[trackertitle]', $bugsys->options['trackertitle']); + $admin->row_span(T('Tracker Title'), 'thead'); + $admin->row_input(T('The global name of the bug tracker. Example: Blue Static Bug Tracker'), 'setting[trackertitle]', $bugsys->options['trackertitle']); // trackerurl - $admin->row_span(_('Tracker Base URL'), 'thead'); - $admin->row_input(_('The base URL of the tracker. This is used when creating external links to the tracker. Be sure that this does not end in a trailing slash ("/").
Example: http://www.bluestatic.org/bugs'), 'setting[trackerurl]', $bugsys->options['trackerurl']); + $admin->row_span(T('Tracker Base URL'), 'thead'); + $admin->row_input(T('The base URL of the tracker. This is used when creating external links to the tracker. Be sure that this does not end in a trailing slash ("/").
Example: http://www.bluestatic.org/bugs'), 'setting[trackerurl]', $bugsys->options['trackerurl']); // dateformat - $admin->row_span(_('Date Format'), 'thead'); - $admin->row_input(_('Set the date format used for bug report and comment information. This is based on PHP\'s date() function.'), 'setting[dateformat]', $bugsys->options['dateformat']); + $admin->row_span(T('Date Format'), 'thead'); + $admin->row_input(T('Set the date format used for bug report and comment information. This is based on PHP\'s date() function.'), 'setting[dateformat]', $bugsys->options['dateformat']); // defaulttimezone - $admin->row_span(_('Default Time Zone'), 'thead'); - $admin->row_text(_('This controls the time zone that all unregistered users view the tracker with.'), construct_option_select('setting[defaulttimezone]', $bugsys->datef->fetch_timezone_list(), $bugsys->options['defaulttimezone']), $bugsys->options['defaulttimezone']); + $admin->row_span(T('Default Time Zone'), 'thead'); + $admin->row_text(T('This controls the time zone that all unregistered users view the tracker with.'), construct_option_select('setting[defaulttimezone]', $bugsys->datef->fetch_timezone_list(), $bugsys->options['defaulttimezone']), $bugsys->options['defaulttimezone']); // defaultlanguage - $admin->row_span(_('Default Language'), 'thead'); - $admin->row_text(_('You can set the default language that all new users (and guests) will use.'), construct_option_select('setting[defaultlanguage]', $bugsys->datastore['language'], $bugsys->options['defaultlanguage'], 'languageid', 'title'), $bugsys->options['defaultlanguage']); + $admin->row_span(T('Default Language'), 'thead'); + $admin->row_text(T('You can set the default language that all new users (and guests) will use.'), construct_option_select('setting[defaultlanguage]', $bugsys->datastore['language'], $bugsys->options['defaultlanguage'], 'languageid', 'title'), $bugsys->options['defaultlanguage']); // syndicateditems - $admin->row_span(_('Number of Syndicated Items'), 'thead'); - $admin->row_input(_('The number of bugs to be syndicated at any one time by the Atom XML feed.'), 'setting[syndicateditems]', $bugsys->options['syndicateditems']); + $admin->row_span(T('Number of Syndicated Items'), 'thead'); + $admin->row_input(T('The number of bugs to be syndicated at any one time by the Atom XML feed.'), 'setting[syndicateditems]', $bugsys->options['syndicateditems']); // redirectheaders - $admin->row_span(_('Use Header Redirects'), 'thead'); - $admin->row_yesno(_('Instead of displaying an intermediate page informing the user that their action was a success and a redirect is occurring, just send the user to the next screen using HTTP headers. This can save bandwidth.'), 'setting[redirectheaders]', $bugsys->options['redirectheaders']); + $admin->row_span(T('Use Header Redirects'), 'thead'); + $admin->row_yesno(T('Instead of displaying an intermediate page informing the user that their action was a success and a redirect is occurring, just send the user to the next screen using HTTP headers. This can save bandwidth.'), 'setting[redirectheaders]', $bugsys->options['redirectheaders']); $admin->table_end(); // ################################################################### $admin->table_start(); - $admin->table_head(_('Bug Reporting Options')); + $admin->table_head(T('Bug Reporting Options')); // allowhtml - $admin->row_span(_('Allow HTML in Bug Reports'), 'thead'); - $admin->row_yesno(_('Set this to yes if you want to allow users to post raw HTML in their bug reports. This is very dangerous and it is not recommended.'), 'setting[allowhtml]', $bugsys->options['allowhtml']); + $admin->row_span(T('Allow HTML in Bug Reports'), 'thead'); + $admin->row_yesno(T('Set this to yes if you want to allow users to post raw HTML in their bug reports. This is very dangerous and it is not recommended.'), 'setting[allowhtml]', $bugsys->options['allowhtml']); // defaultseverity - $admin->row_span(_('Default Severity'), 'thead'); - $admin->row_text(_('The default severity that is selected when creating a new bug report.'), construct_option_select('setting[defaultseverity]', $bugsys->datastore['severity'], $bugsys->options['defaultseverity'], 'severityid', 'severity')); + $admin->row_span(T('Default Severity'), 'thead'); + $admin->row_text(T('The default severity that is selected when creating a new bug report.'), construct_option_select('setting[defaultseverity]', $bugsys->datastore['severity'], $bugsys->options['defaultseverity'], 'severityid', 'severity')); // defaultpriority - $admin->row_span(_('Default Priority'), 'thead'); - $admin->row_text(_('The default priority that will be selected when creating a new bug report. Depending on your permission setup, the user may not be able to set this in a new report so this will act as the value.'), construct_option_select('setting[defaultpriority]', $bugsys->datastore['priority'], $bugsys->options['defaultpriority'], 'priorityid', 'priority')); + $admin->row_span(T('Default Priority'), 'thead'); + $admin->row_text(T('The default priority that will be selected when creating a new bug report. Depending on your permission setup, the user may not be able to set this in a new report so this will act as the value.'), construct_option_select('setting[defaultpriority]', $bugsys->datastore['priority'], $bugsys->options['defaultpriority'], 'priorityid', 'priority')); // defaultstatus - $admin->row_span(_('Default Status'), 'thead'); - $admin->row_text(_('The default default that is selected when creating a new bug report. If a user can not assign a status, this will be the one inserted into the database.'), construct_option_select('setting[defaultstatus]', $bugsys->datastore['status'], $bugsys->options['defaultstatus'], 'statusid', 'status')); + $admin->row_span(T('Default Status'), 'thead'); + $admin->row_text(T('The default default that is selected when creating a new bug report. If a user can not assign a status, this will be the one inserted into the database.'), construct_option_select('setting[defaultstatus]', $bugsys->datastore['status'], $bugsys->options['defaultstatus'], 'statusid', 'status')); // defaultresolve - $admin->row_span(_('Default Resolution'), 'thead'); - $admin->row_text(_('This is the default bug resolution. If a user is not able to change this field, setting this will act as the default value.'), construct_option_select('setting[defaultresolve]', $bugsys->datastore['resolution'], $bugsys->options['defaultresolve'], 'resolutionid', 'resolution')); + $admin->row_span(T('Default Resolution'), 'thead'); + $admin->row_text(T('This is the default bug resolution. If a user is not able to change this field, setting this will act as the default value.'), construct_option_select('setting[defaultresolve]', $bugsys->datastore['resolution'], $bugsys->options['defaultresolve'], 'resolutionid', 'resolution')); // defaultassign - $admin->row_span(_('Default Bug Assignment'), 'thead'); - $admin->row_text(_('This is the default developer new bugs will be assigned to. If a user does not have permisssion to assign bugs, this will be the default. If you don\'t want any default assignment, leave this as Not Selected.'), construct_option_select('setting[defaultassign]', $bugsys->datastore['assignto'], $bugsys->options['defaultassign'], 'userid', 'displayname', 0)); + $admin->row_span(T('Default Bug Assignment'), 'thead'); + $admin->row_text(T('This is the default developer new bugs will be assigned to. If a user does not have permisssion to assign bugs, this will be the default. If you don\'t want any default assignment, leave this as Not Selected.'), construct_option_select('setting[defaultassign]', $bugsys->datastore['assignto'], $bugsys->options['defaultassign'], 'userid', 'displayname', 0)); // defaultcomment - $admin->row_span(_('Default Comment Text'), 'thead'); - $admin->row_textarea(_('If you wish to set a template for entering the initial comment of a bug report, then you may specify this here. However, the template will only take effect on the initial report/comment. Note: the template cannot be forced on the user as there is no way to validate it.'), 'setting[defaultcomment]', $bugsys->options['defaultcomment']); + $admin->row_span(T('Default Comment Text'), 'thead'); + $admin->row_textarea(T('If you wish to set a template for entering the initial comment of a bug report, then you may specify this here. However, the template will only take effect on the initial report/comment. Note: the template cannot be forced on the user as there is no way to validate it.'), 'setting[defaultcomment]', $bugsys->options['defaultcomment']); $admin->table_end(); // ################################################################### $admin->table_start(); - $admin->table_head(_('Bug Listing Display Options')); + $admin->table_head(T('Bug Listing Display Options')); // hidestatuses - $admin->row_span(_('Hide Statuses on Bug Listings'), 'thead'); - $admin->row_text(_('Here you can specify which statuses to hide on the bug list displays. Users have options in their controls to change this from these values, and this does not affect searches or the favorites list.'), construct_option_select('setting[hidestatuses]', $bugsys->datastore['status'], $bugsys->options['hidestatuses'], 'statusid', 'status', 0, true)); + $admin->row_span(T('Hide Statuses on Bug Listings'), 'thead'); + $admin->row_text(T('Here you can specify which statuses to hide on the bug list displays. Users have options in their controls to change this from these values, and this does not affect searches or the favorites list.'), construct_option_select('setting[hidestatuses]', $bugsys->datastore['status'], $bugsys->options['hidestatuses'], 'statusid', 'status', 0, true)); // defaultsortkey - $admin->row_span(_('Default Sort Column'), 'thead'); - $admin->row_text(_('Select the column to sort bugs by on listings. This is only a default setting which users can override in their preferences.'), construct_option_select('setting[defaultsortkey]', ListSorter::fetch_by_text(false), $bugsys->options['defaultsortkey'])); + $admin->row_span(T('Default Sort Column'), 'thead'); + $admin->row_text(T('Select the column to sort bugs by on listings. This is only a default setting which users can override in their preferences.'), construct_option_select('setting[defaultsortkey]', ListSorter::fetch_by_text(false), $bugsys->options['defaultsortkey'])); // defaultsortas - $admin->row_span(_('Default Sort Direction'), 'thead'); - $admin->row_text(_('Specify the default direction to sort bugs in the selected column. This works with and follows the same rules as the Sort Column.'), construct_option_select('setting[defaultsortas]', ListSorter::fetch_as_text(false), $bugsys->options['defaultsortas'])); + $admin->row_span(T('Default Sort Direction'), 'thead'); + $admin->row_text(T('Specify the default direction to sort bugs in the selected column. This works with and follows the same rules as the Sort Column.'), construct_option_select('setting[defaultsortas]', ListSorter::fetch_as_text(false), $bugsys->options['defaultsortas'])); // columnoptions - $admin->row_span(_('Default Column Ordering Options'), 'thead'); - $admin->row_text(_('Specify the order of the columns for bug listings. The value 0 disables the display of a column and if two or more columns have the same position number, they will be displayed in the same column.'), ConstructColumnOptionsSetting()); + $admin->row_span(T('Default Column Ordering Options'), 'thead'); + $admin->row_text(T('Specify the order of the columns for bug listings. The value 0 disables the display of a column and if two or more columns have the same position number, they will be displayed in the same column.'), ConstructColumnOptionsSetting()); $admin->table_end(); // ################################################################### $admin->table_start(); - $admin->table_head(_('Pagination Options')); + $admin->table_head(T('Pagination Options')); // defaultpp - $admin->row_span(_('Default Per-Page Amount'), 'thead'); - $admin->row_input(_('The number of items (e.g. bugs) to be displayed on a page by default. The user will have the option of over-riding these values.'), 'setting[defaultpp]', $bugsys->options['defaultpp']); + $admin->row_span(T('Default Per-Page Amount'), 'thead'); + $admin->row_input(T('The number of items (e.g. bugs) to be displayed on a page by default. The user will have the option of over-riding these values.'), 'setting[defaultpp]', $bugsys->options['defaultpp']); // maxpp - $admin->row_span(_('Maximum Per-Page Value'), 'thead'); - $admin->row_input(_('To prevent your server from experiencing load problems, set the maximum per page limit. Specifying a value here will make sure any user-entered value will not be higher than this, preventing server load problems.'), 'setting[maxpp]', $bugsys->options['maxpp']); + $admin->row_span(T('Maximum Per-Page Value'), 'thead'); + $admin->row_input(T('To prevent your server from experiencing load problems, set the maximum per page limit. Specifying a value here will make sure any user-entered value will not be higher than this, preventing server load problems.'), 'setting[maxpp]', $bugsys->options['maxpp']); // pagelinks - $admin->row_span(_('Number of Page Links'), 'thead'); - $admin->row_input(_('The number of pages that will appear in the page navigation system on either side of the current page. Set this to 0 to display all pages.'), 'setting[pagelinks]', $bugsys->options['pagelinks']); + $admin->row_span(T('Number of Page Links'), 'thead'); + $admin->row_input(T('The number of pages that will appear in the page navigation system on either side of the current page. Set this to 0 to display all pages.'), 'setting[pagelinks]', $bugsys->options['pagelinks']); $admin->table_end(); @@ -227,6 +227,9 @@ if ($_REQUEST['do'] == 'modify') // trackerversion $admin->row_span('Version Number', 'thead'); $admin->row_input('Version Number', 'setting[trackerversion]', $bugsys->options['trackerversion']); + + $admin->row_span('Custom Gettext Localizer', 'thead'); + $admin->row_yesno('Use the custom MOReader implementation rather than the built-in Gettext extension.', 'setting[devgettext]', $bugsys->options['devgettext']); } // ################################################################### diff --git a/admin/severity.php b/admin/severity.php index 59bac7b..6b7aa7e 100755 --- a/admin/severity.php +++ b/admin/severity.php @@ -56,7 +56,7 @@ if ($_REQUEST['do'] == 'kill') if ($_REQUEST['do'] == 'delete') { - $admin->page_confirm(_('Are you sure you want to delete this severity? Doing so will revert all bugs to the default severity (which is set in the options panel)?'), 'severity.php', 'kill', array('severityid' => $bugsys->input_clean('severityid', TYPE_UINT))); + $admin->page_confirm(T('Are you sure you want to delete this severity? Doing so will revert all bugs to the default severity (which is set in the options panel)?'), 'severity.php', 'kill', array('severityid' => $bugsys->input_clean('severityid', TYPE_UINT))); } // ################################################################### @@ -78,13 +78,13 @@ if ($_REQUEST['do'] == 'add') NavLinks::severitiesAdd(); $navigator->set_focus('link', 'severities-add', 'severities'); - $admin->page_start(_('Add New Severity')); + $admin->page_start(T('Add New Severity')); $admin->form_start('severity.php', 'insert'); $admin->table_start(); - $admin->table_head(_('New Severity')); - $admin->row_input(_('Severity Title
The title of this severity flag (eg: `Major` or `Critical`)
'), 'severity'); - $admin->row_input(_('Display Order
The order in which the severities are displayed. The higher the number, the lower down in the list it is.
'), 'displayorder'); + $admin->table_head(T('New Severity')); + $admin->row_input(T('Severity Title
The title of this severity flag (eg: `Major` or `Critical`)
'), 'severity'); + $admin->row_input(T('Display Order
The order in which the severities are displayed. The higher the number, the lower down in the list it is.
'), 'displayorder'); $admin->row_submit(); $admin->table_end(); $admin->form_end(); @@ -118,14 +118,14 @@ if ($_REQUEST['do'] == 'edit') $severity->set_condition(); $severity->fetch(); - $admin->page_start(_('Edit Severity')); + $admin->page_start(T('Edit Severity')); $admin->form_start('severity.php', 'update'); $admin->form_hidden_field('severityid', $severity->objdata['severityid']); $admin->table_start(); - $admin->table_head(sprintf(_('Edit Severity - %1$s (id: %2$s)'), $severity->objdata['severity'], $severity->objdata['severityid'])); - $admin->row_input(_('Severity Title
The title of this severity flag (eg: `Major` or `Critical`)
'), 'severity', $severity->objdata['severity']); - $admin->row_input(_('Display Order
The order in which the severities are displayed. The higher the number, the lower down in the list it is.
'), 'displayorder', $severity->objdata['displayorder']); + $admin->table_head(sprintf(T('Edit Severity - %1$s (id: %2$s)'), $severity->objdata['severity'], $severity->objdata['severityid'])); + $admin->row_input(T('Severity Title
The title of this severity flag (eg: `Major` or `Critical`)
'), 'severity', $severity->objdata['severity']); + $admin->row_input(T('Display Order
The order in which the severities are displayed. The higher the number, the lower down in the list it is.
'), 'displayorder', $severity->objdata['displayorder']); $admin->row_submit(); $admin->table_end(); $admin->form_end(); @@ -140,17 +140,17 @@ if ($_REQUEST['do'] == 'modify') NavLinks::severitiesAdd(); $navigator->set_focus('link', 'fields-pages-severities', 'fields-pages'); - $admin->page_start(_('Severity Manager')); + $admin->page_start(T('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(_('Severity Manager')); + $admin->table_head(T('Severity Manager')); while ($severity = $db->fetch_array($severities)) { - $admin->row_text("$severity[displayorder]: $severity[severity]", "(severityid: $severity[severityid]) [" . _('Edit') . "] [" . _('Delete') . "]"); + $admin->row_text("$severity[displayorder]: $severity[severity]", "(severityid: $severity[severityid]) [" . T('Edit') . "] [" . T('Delete') . "]"); } $db->free_result($severities); diff --git a/admin/status.php b/admin/status.php index ccc2371..88ea3cd 100755 --- a/admin/status.php +++ b/admin/status.php @@ -56,7 +56,7 @@ if ($_REQUEST['do'] == 'kill') if ($_REQUEST['do'] == 'delete') { - $admin->page_confirm(_('Are you sure you want to delete this status? Doing so will revert all bugs to the default status (which is set in the options panel)?'), 'status.php', 'kill', array('statusid' => $bugsys->input_clean('statusid', TYPE_UINT))); + $admin->page_confirm(T('Are you sure you want to delete this status? Doing so will revert all bugs to the default status (which is set in the options panel)?'), 'status.php', 'kill', array('statusid' => $bugsys->input_clean('statusid', TYPE_UINT))); } // ################################################################### @@ -79,14 +79,14 @@ if ($_REQUEST['do'] == 'add') NavLinks::statusesAdd(); $navigator->set_focus('link', 'statuses-add', 'statuses'); - $admin->page_start(_('Add New Status')); + $admin->page_start(T('Add New Status')); $admin->form_start('status.php', 'insert'); $admin->table_start(); - $admin->table_head(_('New Status')); - $admin->row_input(_('Status Title
The title of this status flag (eg: `Confirmed` or `Closed (Fixed)`)
'), 'status'); - $admin->row_input(_('Display Order
The order in which the statuses ar displayed.
'), 'displayorder'); - $admin->row_input(_('Status Color
The color of the status. This will be displayed on bug listings page to make viewing easier. Note: you must enter the # sign if you are using HEX values.
'), 'color'); + $admin->table_head(T('New Status')); + $admin->row_input(T('Status Title
The title of this status flag (eg: `Confirmed` or `Closed (Fixed)`)
'), 'status'); + $admin->row_input(T('Display Order
The order in which the statuses ar displayed.
'), 'displayorder'); + $admin->row_input(T('Status Color
The color of the status. This will be displayed on bug listings page to make viewing easier. Note: you must enter the # sign if you are using HEX values.
'), 'color'); $admin->row_submit(); $admin->table_end(); $admin->form_end(); @@ -121,15 +121,15 @@ if ($_REQUEST['do'] == 'edit') $status->set_condition(); $status->fetch(); - $admin->page_start(_('Edit Status')); + $admin->page_start(T('Edit Status')); $admin->form_start('status.php', 'update'); $admin->form_hidden_field('statusid', $status->objdata['statusid']); $admin->table_start(); - $admin->table_head(sprintf(_('Edit Status - %1$s (id: %2$s)'), $status->objdata['status'], $status->objdata['statusid'])); - $admin->row_input(_('Status Title
The title of this status flag (eg: `Confirmed` or `Closed (Fixed)`)
'), 'status', $status->objdata['status']); - $admin->row_input(_('Display Order
The order in which the statuses ar displayed.
'), 'displayorder', $status->objdata['displayorder']); - $admin->row_input(_('Status Color
The color of the status. This will be displayed on bug listings page to make viewing easier. Note: you must enter the # sign if you are using HEX values.
'), 'color', $status->objdata['color']); + $admin->table_head(sprintf(T('Edit Status - %1$s (id: %2$s)'), $status->objdata['status'], $status->objdata['statusid'])); + $admin->row_input(T('Status Title
The title of this status flag (eg: `Confirmed` or `Closed (Fixed)`)
'), 'status', $status->objdata['status']); + $admin->row_input(T('Display Order
The order in which the statuses ar displayed.
'), 'displayorder', $status->objdata['displayorder']); + $admin->row_input(T('Status Color
The color of the status. This will be displayed on bug listings page to make viewing easier. Note: you must enter the # sign if you are using HEX values.
'), 'color', $status->objdata['color']); $admin->row_submit(); $admin->table_end(); $admin->form_end(); @@ -144,17 +144,17 @@ if ($_REQUEST['do'] == 'modify') NavLinks::statusesAdd(); $navigator->set_focus('link', 'fields-pages-statuses', 'fields-pages'); - $admin->page_start(_('Status Manager')); + $admin->page_start(T('Status Manager')); $statuses = $db->query("SELECT * FROM " . TABLE_PREFIX . "status"); $admin->table_start(); - $admin->table_head(_('Status Manager')); + $admin->table_head(T('Status Manager')); while ($status = $db->fetch_array($statuses)) { $colorblock = '
'; - $admin->row_text("$colorblock$status[displayorder]: $status[status]", "(statusid: $status[statusid]) [" . _('Edit') . "] [" . _('Delete') . "]"); + $admin->row_text("$colorblock$status[displayorder]: $status[status]", "(statusid: $status[statusid]) [" . T('Edit') . "] [" . T('Delete') . "]"); } $db->free_result($statuses); diff --git a/admin/user.php b/admin/user.php index 0a5da95..a2d9a0e 100644 --- a/admin/user.php +++ b/admin/user.php @@ -73,7 +73,7 @@ if ($_REQUEST['do'] == 'kill') if ($_REQUEST['do'] == 'delete') { - $admin->page_confirm(_('Are you sure you want to delete this user?'), 'user.php', 'kill', array('userid' => $bugsys->input_clean('userid', TYPE_UINT))); + $admin->page_confirm(T('Are you sure you want to delete this user?'), 'user.php', 'kill', array('userid' => $bugsys->input_clean('userid', TYPE_UINT))); } // ################################################################### @@ -179,7 +179,7 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add') $navigator->set_focus('link', 'users-add', 'users'); } - $admin->page_start(($add ? _('Add User') : _('Edit User'))); + $admin->page_start(($add ? T('Add User') : T('Edit User'))); $admin->form_start('user.php', ($add ? 'insert' : 'update')); @@ -190,17 +190,17 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add') $admin->table_start(); - $admin->table_head(($add ? _('Add User') : sprintf(_('Edit User (userid: %1$s)'), $user->objdata['userid']))); + $admin->table_head(($add ? T('Add User') : sprintf(T('Edit User (userid: %1$s)'), $user->objdata['userid']))); - $admin->row_input(_('Display Name'), 'displayname', $user->objdata['displayname']); - $admin->row_input(_('Email'), 'email', $user->objdata['email']); - $admin->row_input(($add ? _('Password') : _('Password (Leave blank for no change)')), 'password'); + $admin->row_input(T('Display Name'), 'displayname', $user->objdata['displayname']); + $admin->row_input(T('Email'), 'email', $user->objdata['email']); + $admin->row_input(($add ? T('Password') : T('Password (Leave blank for no change)')), 'password'); foreach ($bugsys->datastore['usergroup'] AS $group) { $admin->list_item($group['title'], $group['usergroupid'], ($user->objdata['usergroupid'] == $group['usergroupid'])); } - $admin->row_list(_('Primary Usergroup'), 'usergroupid'); + $admin->row_list(T('Primary Usergroup'), 'usergroupid'); $ids = explode(',', $user->objdata['groupids']); foreach ($bugsys->datastore['usergroup'] AS $id => $group) @@ -211,33 +211,33 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add') } $admin->list_item($group['title'], $group['usergroupid'], in_array($id, $ids)); } - $admin->row_checkbox(_('Secondary Usergroups'), 'groupids'); + $admin->row_checkbox(T('Secondary Usergroups'), 'groupids'); - $admin->row_yesno(_('Show Email Publicly'), 'showemail', $user->objdata['showemail']); - $admin->row_yesno(_('Show Status Colors on Bug Listings'), 'showcolors', $user->objdata['showcolors']); + $admin->row_yesno(T('Show Email Publicly'), 'showemail', $user->objdata['showemail']); + $admin->row_yesno(T('Show Status Colors on Bug Listings'), 'showcolors', $user->objdata['showcolors']); foreach ($bugsys->datastore['language'] AS $language) { $admin->list_item($language['title'], $language['languageid'], ($user->objdata['languageid'] == $language['languageid'])); } - $admin->row_list(_('Language'), 'languageid'); + $admin->row_list(T('Language'), 'languageid'); foreach ($datef->fetch_timezone_list() AS $value => $string) { $admin->list_item($string, $value, ($user->objdata['timezone'] == $value)); } - $admin->row_list(_('Timezone'), 'timezone'); + $admin->row_list(T('Timezone'), 'timezone'); - $admin->row_yesno(_('Observe Daylight Savings Time (DST)'), 'usedst', $user->objdata['usedst']); - $admin->row_text(_('Hidden Statuses on Bug Listing'), construct_option_select('hidestatuses', $bugsys->datastore['status'], $user->objdata['hidestatuses'], 'statusid', 'status', 0, true)); - $admin->row_text(_('Default Sort Order Column'), construct_option_select('defaultsortkey', ListSorter::fetch_by_text(false), $user->objdata['defaultsortkey'])); - $admin->row_text(_('Default Sort Order Direction'), construct_option_select('defaultsortas', ListSorter::fetch_as_text(false), $user->objdata['defaultsortas'])); + $admin->row_yesno(T('Observe Daylight Savings Time (DST)'), 'usedst', $user->objdata['usedst']); + $admin->row_text(T('Hidden Statuses on Bug Listing'), construct_option_select('hidestatuses', $bugsys->datastore['status'], $user->objdata['hidestatuses'], 'statusid', 'status', 0, true)); + $admin->row_text(T('Default Sort Order Column'), construct_option_select('defaultsortkey', ListSorter::fetch_by_text(false), $user->objdata['defaultsortkey'])); + $admin->row_text(T('Default Sort Order Direction'), construct_option_select('defaultsortas', ListSorter::fetch_as_text(false), $user->objdata['defaultsortas'])); $admin->table_end(); // ------------------------------------------------------------------- $admin->table_start(false); - $admin->table_head(_('Email Options'), 6); + $admin->table_head(T('Email Options'), 6); if ($user->objdata['userid']) { @@ -257,16 +257,16 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add') } } - $admin->table_column_head(array('', _('Reporter'), _('Assignee'), _('Favorite'), _('Voter'), _('Commenter'))); + $admin->table_column_head(array('', T('Reporter'), T('Assignee'), T('Favorite'), T('Voter'), T('Commenter'))); // ------------------------------------------------------------------- - $admin->row_text(_('New bug is added'), '
' . draw_checkbox('emailopts[0][2048]', $checked[0][2048]) . '
', 'top', 6); + $admin->row_text(T('New bug is added'), '
' . draw_checkbox('emailopts[0][2048]', $checked[0][2048]) . '
', 'top', 6); - $admin->row_text(_('I am made the assignee'), '
' . draw_checkbox('emailopts[0][32]', $checked[0][32]) . '
', 'top', 6); + $admin->row_text(T('I am made the assignee'), '
' . draw_checkbox('emailopts[0][32]', $checked[0][32]) . '
', 'top', 6); $admin->row_multi_item(array( - _('Status or resolution changes') => 'l', + T('Status or resolution changes') => 'l', draw_checkbox('emailopts[1][64]', $checked[1][64]) => 'c', draw_checkbox('emailopts[2][64]', $checked[2][64]) => 'c', draw_checkbox('emailopts[4][64]', $checked[4][64]) => 'c', @@ -275,7 +275,7 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add') )); $admin->row_multi_item(array( - _("'Duplicates' field is changed") => 'l', + T("'Duplicates' field is changed") => 'l', draw_checkbox('emailopts[1][128]', $checked[1][128]) => 'c', draw_checkbox('emailopts[2][128]', $checked[2][128]) => 'c', draw_checkbox('emailopts[4][128]', $checked[4][128]) => 'c', @@ -284,7 +284,7 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add') )); $admin->row_multi_item(array( - _('A new comment is added') => 'l', + T('A new comment is added') => 'l', draw_checkbox('emailopts[1][256]', $checked[1][256]) => 'c', draw_checkbox('emailopts[2][256]', $checked[2][256]) => 'c', draw_checkbox('emailopts[4][256]', $checked[4][256]) => 'c', @@ -293,7 +293,7 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add') )); $admin->row_multi_item(array( - _('A new attachment is added') => 'l', + T('A new attachment is added') => 'l', draw_checkbox('emailopts[1][512]', $checked[1][512]) => 'c', draw_checkbox('emailopts[2][512]', $checked[2][512]) => 'c', draw_checkbox('emailopts[4][512]', $checked[4][512]) => 'c', @@ -302,7 +302,7 @@ if ($_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == 'add') )); $admin->row_multi_item(array( - _('Any other field changes') => 'l', + T('Any other field changes') => 'l', draw_checkbox('emailopts[1][1024]', $checked[1][1024]) => 'c', draw_checkbox('emailopts[2][1024]', $checked[2][1024]) => 'c', draw_checkbox('emailopts[4][1024]', $checked[4][1024]) => 'c', @@ -351,11 +351,11 @@ if ($_REQUEST['do'] == 'search') } else { - $admin->page_start(_('Search Results')); + $admin->page_start(T('Search Results')); $admin->table_start(); - $admin->table_head(_('Search Results'), 4); - $admin->table_column_head(array(_('Display Name'), _('Email'), _('User ID'), _('Actions'))); + $admin->table_head(T('Search Results'), 4); + $admin->table_column_head(array(T('Display Name'), T('Email'), T('User ID'), T('Actions'))); while ($row = $db->fetch_array($results)) { @@ -363,7 +363,7 @@ if ($_REQUEST['do'] == 'search') $row['displayname'] => 'l', $row['email'] => 'c', $row['userid'] => 'c', - '[' . _('Edit') . ']' => 'c' + '[' . T('Edit') . ']' => 'c' )); } @@ -375,7 +375,7 @@ if ($_REQUEST['do'] == 'search') if ($fail) { - $admin->error(_('Sorry, we could not find any users that matched your criteria.')); + $admin->error(T('Sorry, we could not find any users that matched your criteria.')); } } @@ -390,10 +390,10 @@ if ($_REQUEST['do'] == 'showall') $pagination->setBitProcessor('AdminPageNavigatorBitCallback'); $pagination->setNavigatorProcessor('AdminPageNavigatorCallback'); - $admin->page_start(_('Show All Users')); + $admin->page_start(T('Show All Users')); $admin->table_start(); - $admin->table_head(_('Show All Users'), 4); - $admin->table_column_head(array(_('Display Name'), _('Email'), _('User ID'), _('Actions'))); + $admin->table_head(T('Show All Users'), 4); + $admin->table_column_head(array(T('Display Name'), T('Email'), T('User ID'), T('Actions'))); $count = $db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "user"); $pagination->setTotal($count['count']); @@ -406,7 +406,7 @@ if ($_REQUEST['do'] == 'showall') $user['displayname'] => 'l', $user['email'] => 'c', $user['userid'] => 'c', - '[' . _('Edit') . ']' => 'c' + '[' . T('Edit') . ']' => 'c' )); } @@ -424,13 +424,13 @@ if ($_REQUEST['do'] == 'modify') NavLinks::usersAdd(); $navigator->set_focus('link', 'users-pages-users', 'users-pages'); - $admin->page_start(_('User Search')); + $admin->page_start(T('User Search')); $admin->form_start('user.php', 'search'); $admin->table_start(true, '45%'); - $admin->table_head(_('User Search')); - $admin->row_input(_('Name/Email/ID'), 'userdata'); + $admin->table_head(T('User Search')); + $admin->row_input(T('Name/Email/ID'), 'userdata'); $admin->row_submit('', ':save:', ''); diff --git a/admin/usergroup.php b/admin/usergroup.php index 0a7362a..7cefd89 100755 --- a/admin/usergroup.php +++ b/admin/usergroup.php @@ -37,42 +37,42 @@ if (!can_perform('canadmingroups')) // define permissions as groups $permissions = array( - _('General Permissions') => array( - 'canviewbugs' => _('Can View Bugs'), - 'canviewhidden' => _('Can View Hidden Bugs and Comments'), - 'canviewownhidden' => _('Can View Own Hidden Bugs'), - 'cansearch' => _('Can Search Bugs'), - 'cansubscribe' => _('Can Subscribe to Bugs'), - 'canbeassignedto' => _('Can Be Assigned Bugs') + T('General Permissions') => array( + 'canviewbugs' => T('Can View Bugs'), + 'canviewhidden' => T('Can View Hidden Bugs and Comments'), + 'canviewownhidden' => T('Can View Own Hidden Bugs'), + 'cansearch' => T('Can Search Bugs'), + 'cansubscribe' => T('Can Subscribe to Bugs'), + 'canbeassignedto' => T('Can Be Assigned Bugs') ), - _('Posting/Submitting Permissions') => array( - 'canvote' => _('Can Vote on Polls'), - 'cansubmitbugs' => _('Can Submit Bugs'), - 'canpostcomments' => _('Can Post Comments'), - 'cangetattach' => _('Can View Attachments'), - 'canputattach' => _('Can Upload/Edit Own Attachments'), - 'caneditattach' => _('Can Manage All Attachments') + T('Posting/Submitting Permissions') => array( + 'canvote' => T('Can Vote on Polls'), + 'cansubmitbugs' => T('Can Submit Bugs'), + 'canpostcomments' => T('Can Post Comments'), + 'cangetattach' => T('Can View Attachments'), + 'canputattach' => T('Can Upload/Edit Own Attachments'), + 'caneditattach' => T('Can Manage All Attachments') ), - _('Moderation/Managment Permissions') => array( - 'caneditown' => _('Can Edit Own Bugs'), - 'caneditother' => _('Can Edit Others\' Bugs'), - 'caneditownreply' => _('Can Edit Own Comments'), - 'caneditotherreply' => _('Can Edit Others\' Comments'), - 'canassign' => _('Can Assign Bugs'), - 'canchangestatus' => _('Can Change Status'), - 'candeletedata' => _('Can Delete Bugs and Comments') + T('Moderation/Managment Permissions') => array( + 'caneditown' => T('Can Edit Own Bugs'), + 'caneditother' => T('Can Edit Others\' Bugs'), + 'caneditownreply' => T('Can Edit Own Comments'), + 'caneditotherreply' => T('Can Edit Others\' Comments'), + 'canassign' => T('Can Assign Bugs'), + 'canchangestatus' => T('Can Change Status'), + 'candeletedata' => T('Can Delete Bugs and Comments') ), - _('Administrator Permissions') => array( - 'canadminpanel' => _('Can Access Control Panel'), - 'canadminbugs' => _('Can Administer Bug Reports'), - 'canadminfields' => _('Can Administer Additional Bug Fields'), - 'canadminversions' => _('Can Administer Products / Components / Versions'), - 'canadminusers' => _('Can Administer Users'), - 'canadmingroups' => _('Can Administer Usergroups'), - 'canadmintools' => _('Can Administer Settings / Maintenance Tools') + T('Administrator Permissions') => array( + 'canadminpanel' => T('Can Access Control Panel'), + 'canadminbugs' => T('Can Administer Bug Reports'), + 'canadminfields' => T('Can Administer Additional Bug Fields'), + 'canadminversions' => T('Can Administer Products / Components / Versions'), + 'canadminusers' => T('Can Administer Users'), + 'canadmingroups' => T('Can Administer Usergroups'), + 'canadmintools' => T('Can Administer Settings / Maintenance Tools') ) ); @@ -101,10 +101,10 @@ if ($_REQUEST['do'] == 'delete') { if ($bugsys->in['usergroupid'] < 7) { - $admin->error(_('You can\'t delete a default usergroup.')); + $admin->error(T('You can\'t delete a default usergroup.')); } - $admin->page_confirm(_('Are you sure you want to delete this usergroup? All users in this group will be set back to the default registered usergroup (id: 2).'), 'usergroup.php', 'kill', array('usergroupid' => $bugsys->in['usergroupid'])); + $admin->page_confirm(T('Are you sure you want to delete this usergroup? All users in this group will be set back to the default registered usergroup (id: 2).'), 'usergroup.php', 'kill', array('usergroupid' => $bugsys->in['usergroupid'])); } // ################################################################### @@ -126,7 +126,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == $navigator->set_focus('link', 'usergroups-add', 'usergroups'); } - $admin->page_start(($add ? _('New Usergroup') : _('Edit Usergroup'))); + $admin->page_start(($add ? T('New Usergroup') : T('Edit Usergroup'))); $admin->form_start('usergroup.php', ($add ? 'insert' : 'update')); @@ -153,15 +153,15 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == // Details $admin->table_start(); - $admin->table_head(_('Usergroup Details')); - $admin->row_input(_('Usergroup Title'), 'title', (($add AND $clone) ? '' : $bugsys->sanitize($usergroup->objdata['title']))); - $admin->row_input(_('Display Title
This is the title that others will be able to see when comments are posted.
'), 'displaytitle', (($add AND $clone) ? '' : $bugsys->sanitize($usergroup->objdata['displaytitle']))); + $admin->table_head(T('Usergroup Details')); + $admin->row_input(T('Usergroup Title'), 'title', (($add AND $clone) ? '' : $bugsys->sanitize($usergroup->objdata['title']))); + $admin->row_input(T('Display Title
This is the title that others will be able to see when comments are posted.
'), 'displaytitle', (($add AND $clone) ? '' : $bugsys->sanitize($usergroup->objdata['displaytitle']))); $admin->table_end(); // Permission $admin->table_start(); - $admin->table_head(_('Permission Settings')); + $admin->table_head(T('Permission Settings')); foreach ($permissions AS $group => $settings) { @@ -176,7 +176,7 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == // custom field permissions $admin->table_start(); - $admin->table_head(_('Custom Field Permissions')); + $admin->table_head(T('Custom Field Permissions')); if ($edit OR $clone) { @@ -191,9 +191,9 @@ if ($_REQUEST['do'] == 'add' OR $_REQUEST['do'] == 'edit' OR $_REQUEST['do'] == while ($field = $db->fetch_array($fields)) { unset($listitem); - $admin->list_item(_('No Permission'), 0, $permissions["$field[fieldid]"] == 0); - $admin->list_item(_('Can View Field'), 1, $permissions["$field[fieldid]"] == 1); - $admin->list_item(_('Can View, Edit Field'), 2, $permissions["$field[fieldid]"] == 2); + $admin->list_item(T('No Permission'), 0, $permissions["$field[fieldid]"] == 0); + $admin->list_item(T('Can View Field'), 1, $permissions["$field[fieldid]"] == 1); + $admin->list_item(T('Can View, Edit Field'), 2, $permissions["$field[fieldid]"] == 2); $admin->row_list($field['name'], "custom[$field[fieldid]]"); } @@ -345,7 +345,7 @@ if ($_POST['do'] == 'doapprove') $db->query("UPDATE " . TABLE_PREFIX . "user SET usergroupid = 2 WHERE userid IN (" . implode(',', $idlist) . ")"); } - $admin->redirect('usergroup.php', _('The selected users have been promoted to the "Registered" usergroup.')); + $admin->redirect('usergroup.php', T('The selected users have been promoted to the "Registered" usergroup.')); } // ################################################################### @@ -355,13 +355,13 @@ if ($_REQUEST['do'] == 'approve') NavLinks::usergroupsAdd(); $navigator->set_focus('link', 'usergroups-approve', 'usergroups'); - $admin->page_start(_('Moderate Awaiting Users'), 3); + $admin->page_start(T('Moderate Awaiting Users'), 3); $admin->form_start('usergroup.php', 'doapprove'); $admin->table_start(); - $admin->table_head(_('Moderate Un-Approved Users'), 3); + $admin->table_head(T('Moderate Un-Approved Users'), 3); - $admin->table_column_head(array(_('Display Name'), _('Usergroup'), _('Approve'))); + $admin->table_column_head(array(T('Display Name'), T('Usergroup'), T('Approve'))); $users = $db->query("SELECT * FROM " . TABLE_PREFIX . "user WHERE usergroupid IN (3, 4)"); while ($user = $db->fetch_array($users)) @@ -387,11 +387,11 @@ if ($_REQUEST['do'] == 'modify') NavLinks::usergroupsAdd(); $navigator->set_focus('link', 'users-pages-usergroups', 'users-pages'); - $admin->page_start(_('Usergroup Manager')); + $admin->page_start(T('Usergroup Manager')); $admin->form_start('usergroup.php', 'null'); $admin->table_start(); - $admin->table_head(_('Usergroup Manager'), 3, 'usergroups'); + $admin->table_head(T('Usergroup Manager'), 3, 'usergroups'); $groups = $db->query("SELECT * FROM " . TABLE_PREFIX . "usergroup ORDER BY usergroupid ASC"); while ($group = $db->fetch_array($groups)) @@ -412,16 +412,16 @@ if ($_REQUEST['do'] == 'modify') $usergroups["$group[usergroupid]"]['total'] = $group['total']; } - $admin->table_column_head(array(_('Usergroup'), _('Number of Users'), _('Action'))); + $admin->table_column_head(array(T('Usergroup'), T('Number of Users'), T('Action'))); foreach ($usergroups AS $group) { $admin->row_multi_item(array( "$group[title]" => 'l', (!$group['total'] ? '-' : $group['total']) => 'c', - "[" . _('Edit') . "] " . - "[" . _('Clone') . "]" . - ($group['usergroupid'] > 6 ? " [" . _('Delete') . "]" : '') => 'c' + "[" . T('Edit') . "] " . + "[" . T('Clone') . "]" . + ($group['usergroupid'] > 6 ? " [" . T('Delete') . "]" : '') => 'c' )); } diff --git a/admin/userhelp.php b/admin/userhelp.php index e747780..5500055 100755 --- a/admin/userhelp.php +++ b/admin/userhelp.php @@ -59,7 +59,7 @@ if ($_REQUEST['do'] == 'kill') if ($_REQUEST['do'] == 'delete') { - $admin->page_confirm(_('Are you sure you want to delete help text?'), 'userhelp.php', 'kill', array('keystring' => $bugsys->in['keystring'])); + $admin->page_confirm(T('Are you sure you want to delete help text?'), 'userhelp.php', 'kill', array('keystring' => $bugsys->in['keystring'])); } // ################################################################### @@ -81,16 +81,16 @@ if ($_REQUEST['do'] == 'add') { $navigator->set_focus('link', 'options-userhelp-add', 'options-userhelp'); - $admin->page_start(_('New Help Text')); + $admin->page_start(T('New Help Text')); $admin->form_start('userhelp.php', 'insert'); $admin->table_start(); - $admin->table_head(_('New Help Text')); + $admin->table_head(T('New Help Text')); - $admin->row_input(_('Topic Title'), 'title'); - $admin->row_input(_('Unique Key
(lowercase letters, underscores, and numbers only)'), 'keystring'); - $admin->row_textarea(_('Body Text'), 'body'); + $admin->row_input(T('Topic Title'), 'title'); + $admin->row_input(T('Unique Key
(lowercase letters, underscores, and numbers only)'), 'keystring'); + $admin->row_textarea(T('Body Text'), 'body'); $admin->row_submit(); @@ -127,18 +127,18 @@ if ($_REQUEST['do'] == 'modify') { $navigator->set_focus('link', 'options-pages-userhelp', 'options-pages'); - $admin->page_start(_('Edit User Help')); + $admin->page_start(T('Edit User Help')); $admin->form_start('userhelp.php', 'update'); $admin->table_start(); - $admin->table_head(_('Edit User Help')); + $admin->table_head(T('Edit User Help')); $topics = $db->query("SELECT * FROM " . TABLE_PREFIX . "fieldhelp ORDER BY keystring ASC"); while ($topic = $db->fetch_array($topics)) { $inputfield = ''; - $delete = (!in_array($topic['keystring'], UserHelpAPI::not_able_to_delete()) ? '

[' . _('Delete') . ']' : ''); + $delete = (!in_array($topic['keystring'], UserHelpAPI::not_able_to_delete()) ? '

[' . T('Delete') . ']' : ''); $admin->row_textarea($inputfield . '
' . $topic['keystring'] . '' . $delete, 'help[' . $topic['keystring'] . '][body]', $topic['body']); } diff --git a/attachment.php b/attachment.php index a2ba792..3406c8d 100755 --- a/attachment.php +++ b/attachment.php @@ -84,24 +84,24 @@ if ($_POST['do'] == 'insert') switch ($FILE['error']) { case 0: break; - case 1: $message->addError(_('PHP said the file you uploaded was too big.')); break; - case 2: $message->addError(_('The file exceeds the allowed upload size.')); break; - case 3: $message->addError(_('The file was only partially uploaded.')); break; - case 4: $message->addError(_('The file was not uploaded at all.')); break; - case 6: $message->addError(_('PHP could not find the /tmp directory.')); break; + case 1: $message->addError(T('PHP said the file you uploaded was too big.')); break; + case 2: $message->addError(T('The file exceeds the allowed upload size.')); break; + case 3: $message->addError(T('The file was only partially uploaded.')); break; + case 4: $message->addError(T('The file was not uploaded at all.')); break; + case 6: $message->addError(T('PHP could not find the /tmp directory.')); break; } // did it upload? if (!is_uploaded_file($FILE['tmp_name'])) { - $message->addError(_('The file you specified did not upload.')); + $message->addError(T('The file you specified did not upload.')); } // TODO - put some MIME-type validation here if (filesize($FILE['tmp_name']) > $var['Value']) { - $message->addError(_('The file you specified exceeds MySQL\'s maximum allowed packet.')); + $message->addError(T('The file you specified exceeds MySQL\'s maximum allowed packet.')); } $attachapi->set('attachment', file_get_contents($FILE['tmp_name'])); @@ -154,7 +154,7 @@ if ($_POST['do'] == 'insert') $notif->finalize(); - $message->redirect(_('The attachment has been added to the bug.'), "showreport.php?bugid=$bug[bugid]"); + $message->redirect(T('The attachment has been added to the bug.'), "showreport.php?bugid=$bug[bugid]"); } else { @@ -211,7 +211,7 @@ if ($_POST['do'] == 'update') $attachapi->delete(); - $message->redirect(_('The attachment was successfully deleted.'), "showreport.php?bugid=$bug[bugid]"); + $message->redirect(T('The attachment was successfully deleted.'), "showreport.php?bugid=$bug[bugid]"); } else { @@ -231,7 +231,7 @@ if ($_POST['do'] == 'update') $log->update_history(); - $message->redirect(_('The attachment was successfully modified.'), "showreport.php?bugid=$bug[bugid]"); + $message->redirect(T('The attachment was successfully modified.'), "showreport.php?bugid=$bug[bugid]"); } } diff --git a/docs/changes.txt b/docs/changes.txt index 69a2f7e..19ea960 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -8,6 +8,7 @@ - Fixed: Users of UTF8 languages would experience problems after upgrading (if the $utf8 config directive as ON) because the installer wasn't running in UTF8 - Fixed: In Authentication::_createBugdarUser there was a variable capitalization error (bug://report/106) - Fixed: Comments posted by guests could not be deleted (bug://report/120) +- Change: There's now a (hidden debug) option to use a custom .mo reader instead of the built-in Gettext extension for localization (bug://report/49) 1.2.1 =============================== diff --git a/editcomment.php b/editcomment.php index a9ca64d..2dbf56e 100644 --- a/editcomment.php +++ b/editcomment.php @@ -99,7 +99,7 @@ if ($_POST['do'] == 'kill') ); } - $message->redirect(_('The comment has been deleted. You will be redirected back to the bug.'), 'showreport.php?bugid=' . $bug['bugid']); + $message->redirect(T('The comment has been deleted. You will be redirected back to the bug.'), 'showreport.php?bugid=' . $bug['bugid']); } // ################################################################### @@ -113,10 +113,10 @@ if ($_REQUEST['do'] == 'delete') if ($bug['initialreport'] == $comment['commentid']) { - $message->error(_('You cannot delete this comment because it is attached to the bug as the first comment. You have to delete the entire bug instead (which is not recommended unless it is spam).')); + $message->error(T('You cannot delete this comment because it is attached to the bug as the first comment. You have to delete the entire bug instead (which is not recommended unless it is spam).')); } - $message->confirm(_('Are you sure you want to delete this comment? After you do so, the data will be lost forever. We recommend only deleting spam comments and nothing else.'), 'editcomment.php', 'kill', _('Delete Comment'), 'showreport.php?bugid=' . $bug['bugid'], array('commentid' => $comment['commentid'])); + $message->confirm(T('Are you sure you want to delete this comment? After you do so, the data will be lost forever. We recommend only deleting spam comments and nothing else.'), 'editcomment.php', 'kill', T('Delete Comment'), 'showreport.php?bugid=' . $bug['bugid'], array('commentid' => $comment['commentid'])); } // ################################################################### @@ -134,7 +134,7 @@ if ($_POST['do'] == 'update') if ($bugsys->in['commentid'] == $bug['initialreport'] AND $bugsys->in['hidden']) { - $message->addError(_('You cannot hide the first comment/initial report of a bug. Instead, hide the entire bug.')); + $message->addError(T('You cannot hide the first comment/initial report of a bug. Instead, hide the entire bug.')); } if (!$message->hasErrors()) @@ -168,7 +168,7 @@ if ($_POST['do'] == 'update') $log->update_history(); - $message->redirect(_('The comment was modified successfully.'), "showreport.php?bugid=$bug[bugid]"); + $message->redirect(T('The comment was modified successfully.'), "showreport.php?bugid=$bug[bugid]"); } else { diff --git a/editreport.php b/editreport.php index f7128e0..fe27347 100644 --- a/editreport.php +++ b/editreport.php @@ -74,7 +74,7 @@ if ($_POST['do'] == 'kill') $bugapi->delete(); - $message->redirect(_('The entire bug has been deleted.'), 'index.php'); + $message->redirect(T('The entire bug has been deleted.'), 'index.php'); } // ################################################################### @@ -86,7 +86,7 @@ if ($_REQUEST['do'] == 'delete') $message->errorPermission(); } - $message->confirm(_('Are you sure you want to delete this bug? Doing so will destroy all associated data, including comments, attachments, and votes. We strongly recommend only deleting span records and nothing else as users may wish to go back and look at any bug to check its status.'), 'editreport.php', 'kill', _('Delete Bug Permanently'), 'showreport.php?bugid=' . $bug['bugid'], array('bugid' => $bug['bugid'])); + $message->confirm(T('Are you sure you want to delete this bug? Doing so will destroy all associated data, including comments, attachments, and votes. We strongly recommend only deleting span records and nothing else as users may wish to go back and look at any bug to check its status.'), 'editreport.php', 'kill', T('Delete Bug Permanently'), 'showreport.php?bugid=' . $bug['bugid'], array('bugid' => $bug['bugid'])); } // ################################################################### @@ -133,7 +133,7 @@ if ($_POST['do'] == 'update') { if (!empty($bugsys->in['comment']) AND $automation['comment']) { - $commenttext = $bugsys->in['comment'] . "\n\n" . _('--------------- AUTOMATIC RESPONSE ---------------') . "\n" . $automation['comment']; + $commenttext = $bugsys->in['comment'] . "\n\n" . T('--------------- AUTOMATIC RESPONSE ---------------') . "\n" . $automation['comment']; } else if (empty($bugsys->in['comment']) AND $automation['comment']) { @@ -166,7 +166,7 @@ if ($_POST['do'] == 'update') { $bugapi->update(); $notif->finalize(); - $message->redirect(_('Your reply has been added to the comment list.'), "showreport.php?bugid=$bug[bugid]"); + $message->redirect(T('Your reply has been added to the comment list.'), "showreport.php?bugid=$bug[bugid]"); } } @@ -226,7 +226,7 @@ if ($_POST['do'] == 'update') $notif->finalize(); - $message->redirect(_('Your changes to the bug have been saved.'), "showreport.php?bugid=$bug[bugid]"); + $message->redirect(T('Your changes to the bug have been saved.'), "showreport.php?bugid=$bug[bugid]"); } /*=====================================================================*\ diff --git a/explain.php b/explain.php index 3657568..1e13099 100644 --- a/explain.php +++ b/explain.php @@ -44,7 +44,7 @@ if ($_REQUEST['do'] == 'products') { if (!is_array($bugsys->datastore['product'])) { - $message->error(_('There are no products set up.')); + $message->error(T('There are no products set up.')); } foreach ($bugsys->datastore['product'] AS $product) @@ -129,7 +129,7 @@ if ($_REQUEST['do'] == 'automations') if ($automation['comment']) { - $left = _('Add Comment'); + $left = T('Add Comment'); $right = $automation['comment']; $trextra = ' class="altcolor"'; @@ -157,7 +157,7 @@ if ($_REQUEST['do'] == 'automations') continue; } - $left = $fields["$id"]['name'] . ' ' . sprintf(_('(Custom #%1$d, type: %2$s)'), $id, $fields["$id"]['type']); + $left = $fields["$id"]['name'] . ' ' . sprintf(T('(Custom #%1$d, type: %2$s)'), $id, $fields["$id"]['type']); $right = $value; eval('$automations .= "' . $template->fetch('explain_row') . '";'); } diff --git a/favorite.php b/favorite.php index e549116..b9a5951 100644 --- a/favorite.php +++ b/favorite.php @@ -56,12 +56,12 @@ if ($_REQUEST['do'] == 'handle') if ($db->query_first("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE userid = " . $bugsys->userinfo['userid'] . " AND bugid = " . $bugsys->in['bugid'])) { $db->query("DELETE FROM " . TABLE_PREFIX . "favorite WHERE userid = " . $bugsys->userinfo['userid'] . " AND bugid = " . $bugsys->in['bugid']); - $message->redirect(_('This bug has been removed from your favorites list.'), "showreport.php?bugid=" . $bugsys->in['bugid']); + $message->redirect(T('This bug has been removed from your favorites list.'), "showreport.php?bugid=" . $bugsys->in['bugid']); } else { $db->query("INSERT INTO " . TABLE_PREFIX . "favorite (userid, bugid) VALUES (" . $bugsys->userinfo['userid'] . ", " . $bugsys->in['bugid'] . ")"); - $message->redirect(_('This bug has been added to your favorites list.'), "showreport.php?bugid=" . $bugsys->in['bugid']); + $message->redirect(T('This bug has been added to your favorites list.'), "showreport.php?bugid=" . $bugsys->in['bugid']); } } @@ -84,7 +84,7 @@ if ($_REQUEST['do'] == 'manage') if ($db->num_rows($favorites) < 1) { - $message->error(_('You do not have any favorites in your list. To add a bug to your list, while viewing the report, click the [Add to Favorites] link next to the bug\'s ID.')); + $message->error(T('You do not have any favorites in your list. To add a bug to your list, while viewing the report, click the [Add to Favorites] link next to the bug\'s ID.')); } $sort = new ListSorter('favorite'); diff --git a/global.php b/global.php index e37eead..0405f84 100755 --- a/global.php +++ b/global.php @@ -30,6 +30,7 @@ $template->setExtension('tpl'); $template->setPreParseHook('isso_pre_parse_hook'); $template->setTemplateDir('templates/'); $template->setDatabaseCache(TABLE_PREFIX . 'template'); +$template->langcall = 'T'; // ################################################################### // global template variables diff --git a/help.php b/help.php index 9f874b7..c22ba31 100644 --- a/help.php +++ b/help.php @@ -29,8 +29,8 @@ require_once('./global.php'); if (!$bugsys->in['topic'] OR !isset($bugsys->datastore['help'][ $bugsys->in['topic'] ])) { - $topic['title'] = _('Invalid'); - $topic['body'] = _('That help topic does not exist in the system.'); + $topic['title'] = T('Invalid'); + $topic['body'] = T('That help topic does not exist in the system.'); } else { diff --git a/includes/api_automation.php b/includes/api_automation.php index f559bb3..becfda3 100644 --- a/includes/api_automation.php +++ b/includes/api_automation.php @@ -104,12 +104,12 @@ class AutomationAPI extends API { if (!is_array($this->values['fieldchanges']) OR sizeof($this->values['fieldchanges']) != 2 OR !is_array($this->values['fieldchanges']['custom']) OR !is_array($this->values['fieldchanges']['builtin'])) { - return _('Invalid array type passed. The fieldchaneges array must be a two-dimensional array: array("builtin" => array("fieldname" => "newvalue" ...), "custom" => array("fieldname" => "fieldvalue" ...))'); + return T('Invalid array type passed. The fieldchaneges array must be a two-dimensional array: array("builtin" => array("fieldname" => "newvalue" ...), "custom" => array("fieldname" => "fieldvalue" ...))'); } if (sizeof($this->values['fieldchanges']['custom']) < 1 AND sizeof($this->values['fieldchanges']['builtin']) < 1) { - return _('You need to specify some fields to change.'); + return T('You need to specify some fields to change.'); } $this->values['fieldchanges'] = serialize($this->values['fieldchanges']); diff --git a/includes/api_comment.php b/includes/api_comment.php index b33f2f7..738c0f2 100644 --- a/includes/api_comment.php +++ b/includes/api_comment.php @@ -84,7 +84,7 @@ class CommentAPI extends API $comment = $this->values['comment']; if ($this->values['parselinks']) { - $comment = str_replace('bug://new', '' . _('New Bug') . '', $comment); + $comment = str_replace('bug://new', '' . T('New Bug') . '', $comment); $comment = preg_replace('#bug://((report|problem)/)?([0-9]*)#i', 'bug \3', $comment); $comment = preg_replace('#(https?://|www\.)\S+#i', '\0', $comment); } @@ -120,7 +120,7 @@ class CommentAPI extends API { if ($this->registry->db->query_first("SELECT * FROM " . TABLE_PREFIX . "bug WHERE initialreport = " . $this->values['commentid'])) { - $this->error(_('You cannot delete this comment because it is attached to the bug as the first comment. You have to delete the entire bug instead (which is not recommended unless it is spam).')); + $this->error(T('You cannot delete this comment because it is attached to the bug as the first comment. You have to delete the entire bug instead (which is not recommended unless it is spam).')); } } } diff --git a/includes/api_field.php b/includes/api_field.php index e74ce9d..cb30369 100644 --- a/includes/api_field.php +++ b/includes/api_field.php @@ -82,9 +82,9 @@ class FieldAPI extends API { global $lang; $types = array( - 'input_text' => _('Single-Line Text Box'), - 'input_checkbox' => _('Checkbox Flag'), - 'select_single' => _('Drop-Down Menu'), + 'input_text' => T('Single-Line Text Box'), + 'input_checkbox' => T('Checkbox Flag'), + 'select_single' => T('Drop-Down Menu'), ); if ($type == null) @@ -168,7 +168,7 @@ class FieldAPI extends API array_walk($selects, 'trim'); if (sizeof($selects) < 1) { - return _('You need to specify some select values.'); + return T('You need to specify some select values.'); } else { diff --git a/includes/api_language.php b/includes/api_language.php index f97ce4c..856f701 100644 --- a/includes/api_language.php +++ b/includes/api_language.php @@ -93,12 +93,12 @@ class LanguageAPI extends API $count = $this->registry->db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "language"); if ($count['count'] < 2) { - $this->error(_('At least one language needs to be present. Deleting this language would violate that.')); + $this->error(T('At least one language needs to be present. Deleting this language would violate that.')); } if ($this->registry->options['defaultlanguage'] == $this->values['languageid']) { - $this->error(_('You cannot delete the default language. Please select another language to be the default language and then delete this one.')); + $this->error(T('You cannot delete the default language. Please select another language to be the default language and then delete this one.')); } } @@ -123,7 +123,7 @@ class LanguageAPI extends API { if (!in_array($this->values['direction'], array('ltr', 'rtl'))) { - return _('The direction must be ltr (left-to-right) or rtl (right-to-left)'); + return T('The direction must be ltr (left-to-right) or rtl (right-to-left)'); } return true; } diff --git a/includes/api_user.php b/includes/api_user.php index d8e563c..1b1ee9a 100644 --- a/includes/api_user.php +++ b/includes/api_user.php @@ -146,11 +146,11 @@ class UserAPI extends API if (!$this->registry->funct->is_valid_email($this->values['email'])) { - return _('The specified email is invalid.'); + return T('The specified email is invalid.'); } if ($this->registry->db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE email = '" . $this->registry->db->escape_string($this->values['email']) . "' AND userid <> " . $this->registry->clean($this->values['userid'], TYPE_UINT))) { - return _('The specified email is already in use.'); + return T('The specified email is already in use.'); } return true; } @@ -170,7 +170,7 @@ class UserAPI extends API if ($this->registry->db->query_first("SELECT * FROM " . TABLE_PREFIX . "user WHERE displayname = '" . $this->registry->db->escape_string($this->values['displayname']) . "' AND userid <> " . $this->registry->clean($this->values['userid'], TYPE_UINT))) { - return _('That display name is already in use by another user.'); + return T('That display name is already in use by another user.'); } return true; } @@ -274,7 +274,7 @@ class UserAPI extends API { if ($this->values['userid'] == $this->registry->userinfo['userid']) { - $this->error(_('You cannot delete your own account!')); + $this->error(T('You cannot delete your own account!')); } if ($this->values['usergroupid'] == 6) @@ -282,7 +282,7 @@ class UserAPI extends API $count = $this->registry->db->query_first("SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "user WHERE usergroupid = 6 AND userid <> " . $this->values['userid']); if ($count['count'] < 1) { - $this->error(_('At least one other administrator needs to be present before you can delete this user')); + $this->error(T('At least one other administrator needs to be present before you can delete this user')); } } } diff --git a/includes/api_usergroup.php b/includes/api_usergroup.php index cd52322..2344287 100644 --- a/includes/api_usergroup.php +++ b/includes/api_usergroup.php @@ -93,7 +93,7 @@ class UsergroupAPI extends API { if ($this->values['usergroupid'] < 7) { - return _('You can\'t delete a default usergroup.'); + return T('You can\'t delete a default usergroup.'); } } diff --git a/includes/api_userhelp.php b/includes/api_userhelp.php index 1c8605b..5cedef2 100644 --- a/includes/api_userhelp.php +++ b/includes/api_userhelp.php @@ -165,12 +165,12 @@ class UserHelpAPI extends API if (preg_match('#[^a-z0-9_]#', $this->values['keystring'])) { - return _('The unique key can only contain lowercase letters, underscores, and numbers.'); + return T('The unique key can only contain lowercase letters, underscores, and numbers.'); } if ($this->registry->db->query_first("SELECT * FROM " . TABLE_PREFIX . "fieldhelp WHERE keystring = '" . $this->registry->escape($this->values['keystring']) . "'")) { - return _('The unique key must be unique.'); + return T('The unique key must be unique.'); } return true; diff --git a/includes/class_admin_navigation.php b/includes/class_admin_navigation.php index 9dc176b..7e7549c 100644 --- a/includes/class_admin_navigation.php +++ b/includes/class_admin_navigation.php @@ -43,11 +43,11 @@ class NavLinks { global $navigator; - $navigator->add_component('section', 'options-pages', 'options', _('Options'), null); - $navigator->add_component('link', 'options-pages-home', 'options-pages', _('Home'), 'index.php'); - $navigator->add_component('link', 'options-pages-settings', 'options-pages', _('Bugdar Settings'), 'setting.php'); - $navigator->add_component('link', 'options-pages-languages', 'options-pages', _('Languages'), 'language.php'); - $navigator->add_component('link', 'options-pages-userhelp', 'options-pages', _('User Help Items'), 'userhelp.php'); + $navigator->add_component('section', 'options-pages', 'options', T('Options'), null); + $navigator->add_component('link', 'options-pages-home', 'options-pages', T('Home'), 'index.php'); + $navigator->add_component('link', 'options-pages-settings', 'options-pages', T('Bugdar Settings'), 'setting.php'); + $navigator->add_component('link', 'options-pages-languages', 'options-pages', T('Languages'), 'language.php'); + $navigator->add_component('link', 'options-pages-userhelp', 'options-pages', T('User Help Items'), 'userhelp.php'); } // ################################################################### @@ -60,8 +60,8 @@ class NavLinks { global $navigator; - $navigator->add_component('section', 'options-languages', 'options', _('Languages'), null); - $navigator->add_component('link', 'options-languages-add', 'options-languages', _('Add New Language'), 'language.php?do=add'); + $navigator->add_component('section', 'options-languages', 'options', T('Languages'), null); + $navigator->add_component('link', 'options-languages-add', 'options-languages', T('Add New Language'), 'language.php?do=add'); } // ################################################################### @@ -77,8 +77,8 @@ class NavLinks global $navigator; NavLinks::languagesAdd(); - $navigator->add_component('link', 'options-languages-edit', 'options-languages', _('Edit Language'), 'language.php?do=edit&languageid=' . $id); - $navigator->add_component('link', 'options-languages-delete', 'options-languages', _('Delete'), 'language.php?do=delete&languageid=' . $id); + $navigator->add_component('link', 'options-languages-edit', 'options-languages', T('Edit Language'), 'language.php?do=edit&languageid=' . $id); + $navigator->add_component('link', 'options-languages-delete', 'options-languages', T('Delete'), 'language.php?do=delete&languageid=' . $id); } // ################################################################### @@ -91,8 +91,8 @@ class NavLinks { global $navigator; - $navigator->add_component('section', 'options-userhelp', 'options', _('User Help Items'), null); - $navigator->add_component('link', 'options-userhelp-add', 'options-userhelp', _('Add New Item'), 'userhelp.php?do=add'); + $navigator->add_component('section', 'options-userhelp', 'options', T('User Help Items'), null); + $navigator->add_component('link', 'options-userhelp-add', 'options-userhelp', T('Add New Item'), 'userhelp.php?do=add'); } // ################################################################### @@ -105,9 +105,9 @@ class NavLinks { global $navigator; - $navigator->add_component('section', 'products', 'products', _('Products'), null); - $navigator->add_component('link', 'products-manage', 'products', _('Manage Products'), 'product.php'); - $navigator->add_component('link', 'products-add', 'products', _('Add New Product'), 'product.php?do=addproduct'); + $navigator->add_component('section', 'products', 'products', T('Products'), null); + $navigator->add_component('link', 'products-manage', 'products', T('Manage Products'), 'product.php'); + $navigator->add_component('link', 'products-add', 'products', T('Add New Product'), 'product.php?do=addproduct'); } // ################################################################### @@ -123,10 +123,10 @@ class NavLinks global $navigator; NavLinks::productsAdd(); - $navigator->add_component('section', 'products-edit', 'products', _('Edit Product'), null); - $navigator->add_component('link', 'products-edit', 'products-edit', _('Edit Product'), 'product.php?do=editproduct&productid=' . $id); - $navigator->add_component('link', 'products-edit-version', 'products-edit', _('Add New Version'), 'product.php?do=addversion&productid=' . $id); - $navigator->add_component('link', 'products-edit-delete', 'products-edit', _('Delete Product'), 'product.php?do=deleteproduct&productid=' . $id); + $navigator->add_component('section', 'products-edit', 'products', T('Edit Product'), null); + $navigator->add_component('link', 'products-edit', 'products-edit', T('Edit Product'), 'product.php?do=editproduct&productid=' . $id); + $navigator->add_component('link', 'products-edit-version', 'products-edit', T('Add New Version'), 'product.php?do=addversion&productid=' . $id); + $navigator->add_component('link', 'products-edit-delete', 'products-edit', T('Delete Product'), 'product.php?do=deleteproduct&productid=' . $id); } // ################################################################### @@ -139,13 +139,13 @@ class NavLinks { global $navigator; - $navigator->add_component('section', 'fields-pages', 'fields', _('Fields'), null); - $navigator->add_component('link', 'fields-pages-fields', 'fields-pages', _('Custom Fields'), 'field.php'); - $navigator->add_component('link', 'fields-pages-priorities', 'fields-pages', _('Priorities'), 'priority.php'); - $navigator->add_component('link', 'fields-pages-resolutions', 'fields-pages', _('Resolutions'), 'resolution.php'); - $navigator->add_component('link', 'fields-pages-severities', 'fields-pages', _('Severities'), 'severity.php'); - $navigator->add_component('link', 'fields-pages-statuses', 'fields-pages', _('Statuses'), 'status.php'); - $navigator->add_component('link', 'fields-pages-automations', 'fields-pages', _('Automations'), 'automation.php'); + $navigator->add_component('section', 'fields-pages', 'fields', T('Fields'), null); + $navigator->add_component('link', 'fields-pages-fields', 'fields-pages', T('Custom Fields'), 'field.php'); + $navigator->add_component('link', 'fields-pages-priorities', 'fields-pages', T('Priorities'), 'priority.php'); + $navigator->add_component('link', 'fields-pages-resolutions', 'fields-pages', T('Resolutions'), 'resolution.php'); + $navigator->add_component('link', 'fields-pages-severities', 'fields-pages', T('Severities'), 'severity.php'); + $navigator->add_component('link', 'fields-pages-statuses', 'fields-pages', T('Statuses'), 'status.php'); + $navigator->add_component('link', 'fields-pages-automations', 'fields-pages', T('Automations'), 'automation.php'); } // ################################################################### @@ -158,8 +158,8 @@ class NavLinks { global $navigator; - $navigator->add_component('section', 'fields', 'fields', _('Custom Fields'), null); - $navigator->add_component('link', 'fields-add', 'fields', _('Add New Custom Field'), 'field.php?do=add'); + $navigator->add_component('section', 'fields', 'fields', T('Custom Fields'), null); + $navigator->add_component('link', 'fields-add', 'fields', T('Add New Custom Field'), 'field.php?do=add'); } // ################################################################### @@ -175,7 +175,7 @@ class NavLinks global $navigator; NavLinks::fieldsAdd(); - $navigator->add_component('link', 'fields-delete', 'fields', _('Delete'), 'field.php?do=delete&fieldid=' . $id); + $navigator->add_component('link', 'fields-delete', 'fields', T('Delete'), 'field.php?do=delete&fieldid=' . $id); } // ################################################################### @@ -188,8 +188,8 @@ class NavLinks { global $navigator; - $navigator->add_component('section', 'priorities', 'fields', _('Priorities'), null); - $navigator->add_component('link', 'priorities-add', 'priorities', _('Add New Priority'), 'priority.php?do=add'); + $navigator->add_component('section', 'priorities', 'fields', T('Priorities'), null); + $navigator->add_component('link', 'priorities-add', 'priorities', T('Add New Priority'), 'priority.php?do=add'); } // ################################################################### @@ -205,7 +205,7 @@ class NavLinks global $navigator; NavLinks::prioritiesAdd(); - $navigator->add_component('link', 'priorities-delete', 'priorities', _('Delete'), 'priority.php?do=delete&priorityid=' . $id); + $navigator->add_component('link', 'priorities-delete', 'priorities', T('Delete'), 'priority.php?do=delete&priorityid=' . $id); } // ################################################################### @@ -218,8 +218,8 @@ class NavLinks { global $navigator; - $navigator->add_component('section', 'resolutions', 'fields', _('Resolutions'), null); - $navigator->add_component('link', 'resolutions-add', 'resolutions', _('Add New Resolution'), 'resolution.php?do=add'); + $navigator->add_component('section', 'resolutions', 'fields', T('Resolutions'), null); + $navigator->add_component('link', 'resolutions-add', 'resolutions', T('Add New Resolution'), 'resolution.php?do=add'); } // ################################################################### @@ -235,7 +235,7 @@ class NavLinks global $navigator; NavLinks::resolutionsAdd(); - $navigator->add_component('link', 'resolutions-delete', 'resolutions', _('Delete'), 'resolution.php?do=delete&resolutionid=' . $id); + $navigator->add_component('link', 'resolutions-delete', 'resolutions', T('Delete'), 'resolution.php?do=delete&resolutionid=' . $id); } // ################################################################### @@ -248,8 +248,8 @@ class NavLinks { global $navigator; - $navigator->add_component('section', 'severities', 'fields', _('Severities'), null); - $navigator->add_component('link', 'severities-add', 'severities', _('Add New Severity'), 'severity.php?do=add'); + $navigator->add_component('section', 'severities', 'fields', T('Severities'), null); + $navigator->add_component('link', 'severities-add', 'severities', T('Add New Severity'), 'severity.php?do=add'); } // ################################################################### @@ -265,7 +265,7 @@ class NavLinks global $navigator; NavLinks::severitiesAdd(); - $navigator->add_component('link', 'severities-delete', 'severities', _('Delete'), 'severity.php?do=delete&severityid=' . $id); + $navigator->add_component('link', 'severities-delete', 'severities', T('Delete'), 'severity.php?do=delete&severityid=' . $id); } // ################################################################### @@ -278,8 +278,8 @@ class NavLinks { global $navigator; - $navigator->add_component('section', 'statuses', 'fields', _('Severities'), null); - $navigator->add_component('link', 'statuses-add', 'statuses', _('Add New Status'), 'status.php?do=add'); + $navigator->add_component('section', 'statuses', 'fields', T('Severities'), null); + $navigator->add_component('link', 'statuses-add', 'statuses', T('Add New Status'), 'status.php?do=add'); } // ################################################################### @@ -295,7 +295,7 @@ class NavLinks global $navigator; NavLinks::statusesAdd(); - $navigator->add_component('link', 'statuses-delete', 'statuses', _('Delete'), 'status.php?do=delete&statusid=' . $id); + $navigator->add_component('link', 'statuses-delete', 'statuses', T('Delete'), 'status.php?do=delete&statusid=' . $id); } // ################################################################### @@ -308,8 +308,8 @@ class NavLinks { global $navigator; - $navigator->add_component('section', 'automations', 'fields', _('Automations'), null); - $navigator->add_component('link', 'automations-add', 'automations', _('Add New Automation'), 'automation.php?do=add'); + $navigator->add_component('section', 'automations', 'fields', T('Automations'), null); + $navigator->add_component('link', 'automations-add', 'automations', T('Add New Automation'), 'automation.php?do=add'); } // ################################################################### @@ -325,7 +325,7 @@ class NavLinks global $navigator; NavLinks::automationsAdd(); - $navigator->add_component('link', 'automations-delete', 'automations', _('Delete'), 'automation.php?do=delete&actionid=' . $id); + $navigator->add_component('link', 'automations-delete', 'automations', T('Delete'), 'automation.php?do=delete&actionid=' . $id); } // ################################################################### @@ -338,10 +338,10 @@ class NavLinks { global $navigator; - $navigator->add_component('section', 'users-pages', 'users', _('Users & Permissions'), null); - $navigator->add_component('link', 'users-pages-users', 'users-pages', _('Users'), 'user.php'); - $navigator->add_component('link', 'users-pages-usergroups', 'users-pages', _('Usergroups'), 'usergroup.php'); - $navigator->add_component('link', 'users-pages-permissions', 'users-pages', _('Product-Level Permissions'), 'permission.php'); + $navigator->add_component('section', 'users-pages', 'users', T('Users & Permissions'), null); + $navigator->add_component('link', 'users-pages-users', 'users-pages', T('Users'), 'user.php'); + $navigator->add_component('link', 'users-pages-usergroups', 'users-pages', T('Usergroups'), 'usergroup.php'); + $navigator->add_component('link', 'users-pages-permissions', 'users-pages', T('Product-Level Permissions'), 'permission.php'); } // ################################################################### @@ -354,9 +354,9 @@ class NavLinks { global $navigator; - $navigator->add_component('section', 'users', 'users', _('Users'), null); - $navigator->add_component('link', 'users-showall', 'users', _('Show All Users'), 'user.php?do=showall'); - $navigator->add_component('link', 'users-add', 'users', _('Add New User'), 'user.php?do=add'); + $navigator->add_component('section', 'users', 'users', T('Users'), null); + $navigator->add_component('link', 'users-showall', 'users', T('Show All Users'), 'user.php?do=showall'); + $navigator->add_component('link', 'users-add', 'users', T('Add New User'), 'user.php?do=add'); } // ################################################################### @@ -372,7 +372,7 @@ class NavLinks global $navigator; NavLinks::usersAdd(); - $navigator->add_component('link', 'users-delete', 'users', _('Delete'), 'user.php?do=delete&userid=' . $id); + $navigator->add_component('link', 'users-delete', 'users', T('Delete'), 'user.php?do=delete&userid=' . $id); } // ################################################################### @@ -385,9 +385,9 @@ class NavLinks { global $navigator; - $navigator->add_component('section', 'usergroups', 'users', _('Usergroups'), null); - $navigator->add_component('link', 'usergroups-add', 'usergroups', _('Add New Usergroup'), 'usergroup.php?do=add'); - $navigator->add_component('link', 'usergroups-approve', 'usergroups', _('Moderate Awaiting Users'), 'usergroup.php?do=approve'); + $navigator->add_component('section', 'usergroups', 'users', T('Usergroups'), null); + $navigator->add_component('link', 'usergroups-add', 'usergroups', T('Add New Usergroup'), 'usergroup.php?do=add'); + $navigator->add_component('link', 'usergroups-approve', 'usergroups', T('Moderate Awaiting Users'), 'usergroup.php?do=approve'); } // ################################################################### @@ -403,7 +403,7 @@ class NavLinks global $navigator; NavLinks::usergroupsAdd(); - $navigator->add_component('link', 'usergroups-delete', 'usergroups', _('Delete'), 'usergroup.php?do=delete&userid=' . $id); + $navigator->add_component('link', 'usergroups-delete', 'usergroups', T('Delete'), 'usergroup.php?do=delete&userid=' . $id); } } diff --git a/includes/class_message_reporter.php b/includes/class_message_reporter.php index 5321f51..8473bb8 100755 --- a/includes/class_message_reporter.php +++ b/includes/class_message_reporter.php @@ -100,7 +100,7 @@ class MessageReporter */ function errorPermission() { - $this->error(_('You do not have permission to access this page. If you think that this is an error, please contact an administrator.')); + $this->error(T('You do not have permission to access this page. If you think that this is an error, please contact an administrator.')); } // ################################################################### diff --git a/includes/class_mo.php b/includes/class_mo.php new file mode 100644 index 0000000..abe37f0 --- /dev/null +++ b/includes/class_mo.php @@ -0,0 +1,177 @@ +filename = $filename; + $this->_loadFile(); + } + + /** + * Returns the translated string for T, or the original if none exists + * + * @param string Native string to look up a translation for + * + * @return string + */ + function T($str) + { + if (empty($this->strings[$str])) + { + return $str; + } + return $this->strings[$str]; + } + + /** + * Reads $size number of bytes + * + * @param integer Number of bytes to read + * + * @return string + */ + function _readBytes($size) + { + $stream = fread($this->file, 4 * $size); + if ($this->bigEndian) + { + return unpack('N' . $size, $stream); + } + else + { + return unpack('V' . $size, $stream); + } + } + + /** + * Lodas the MO data information into the stirng table + */ + function _loadFile() + { + global $bugsys; + + $this->file = @fopen($this->filename, 'r'); + if (!$this->file) + { + $bugsys->debug("could not open MO file {$this->filename}"); + return; + } + + // read the magic number + $stream = $this->_readBytes(1); + $stream = dechex($stream[1]); + if ($stream == '950412de') + { + $this->bigEndian = false; + } + else if ($stream == 'de120495') + { + $this->bigEndian = true; + } + else + { + trigger_error('Invalid MO file format'); + } + + // read the revision (unused in MOs) + $this->_readBytes(1); + + // read the number of strings + $count = $this->_readBytes(1); + $count = $count[1]; + + // get the start positions of the original and translated tables + $offsetO = $this->_readBytes(1); + $offsetT = $this->_readBytes(1); + + fseek($this->file, $offsetO[1]); + $tableO = $this->_readBytes(2 * $count); + fseek($this->file, $offsetT[1]); + $tableT = $this->_readBytes(2 * $count); + + for ($i = 0; $i < $count; $i++) + { + if ($tableO[$i * 2 + 1] > 0) + { + fseek($this->file, $tableO[$i * 2 + 2]); + $O = fread($this->file, $tableO[$i * 2 + 1]); + } + + if ($tableT[$i * 2 + 1] > 0) + { + fseek($this->file, $tableT[$i * 2 + 2]); + $this->strings[$O] = fread($this->file, $tableT[$i * 2 + 1]); + } + } + + fclose($this->file); + } +} + +/*=====================================================================*\ +|| ################################################################### +|| # $HeadURL$ +|| # $Id$ +|| ################################################################### +\*=====================================================================*/ +?> \ No newline at end of file diff --git a/includes/class_sort.php b/includes/class_sort.php index cc98d01..4f47faf 100644 --- a/includes/class_sort.php +++ b/includes/class_sort.php @@ -200,19 +200,19 @@ class ListSorter global $lang; $keys = array( - 'lastpost' => _('Last Post Time'), - 'bugid' => _('Bug ID'), - 'summary' => _('Summary'), - 'reporter' => _('Reporter'), - 'product' => _('Product'), - 'component' => _('Component'), - 'version' => _('Version'), - 'status' => _('Status'), - 'resolution' => _('Resolution'), - 'priority' => _('Priority'), - 'severity' => _('Severity'), - 'votes' => _('Votes'), - 'assignedto' => _('Assigned To') + 'lastpost' => T('Last Post Time'), + 'bugid' => T('Bug ID'), + 'summary' => T('Summary'), + 'reporter' => T('Reporter'), + 'product' => T('Product'), + 'component' => T('Component'), + 'version' => T('Version'), + 'status' => T('Status'), + 'resolution' => T('Resolution'), + 'priority' => T('Priority'), + 'severity' => T('Severity'), + 'votes' => T('Votes'), + 'assignedto' => T('Assigned To') ); if ($key === false) @@ -240,8 +240,8 @@ class ListSorter global $lang; $keys = array( - 'desc' => _('Descending'), - 'asc' => _('Ascending') + 'desc' => T('Descending'), + 'asc' => T('Ascending') ); if ($key === false) @@ -433,11 +433,11 @@ class ListSorter case 'summary': return $open . '' . $bug['summary'] . '' . $close; case 'reporter': - return $open . ($bug['userid'] ? $bug['username'] : _('Guest')) . $close; + return $open . ($bug['userid'] ? $bug['username'] : T('Guest')) . $close; case 'lastpost': - return "\n\t\t
" . $bug['lastposttime'] . "
\n\t\t
" . _('by') . ' ' . ($bug['lastpost'] ? $bug['lastpost'] : _('Guest')) . "
\n\t"; + return "\n\t\t
" . $bug['lastposttime'] . "
\n\t\t
" . T('by') . ' ' . ($bug['lastpost'] ? $bug['lastpost'] : T('Guest')) . "
\n\t"; case 'votes': - return "\n\t\t
" . _('For:') . ' ' . $bug['votefor'] . "
\n\t\t
" . _('Against:') . ' ' . $bug['voteagainst'] . "
\n\t"; + return "\n\t\t
" . T('For:') . ' ' . $bug['votefor'] . "
\n\t\t
" . T('Against:') . ' ' . $bug['voteagainst'] . "
\n\t"; default: return $open . $bug["$column"] . $close; } diff --git a/includes/functions.php b/includes/functions.php index d1b56e7..da654bc 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -67,7 +67,7 @@ function construct_user_display($userinfo, $html = true) if (!$userinfo['userid']) { - $userinfo['displayname'] = _('Guest'); + $userinfo['displayname'] = T('Guest'); $userinfo['showemail'] = false; } @@ -79,7 +79,7 @@ function construct_user_display($userinfo, $html = true) { if ($userinfo['showemail']) { - $username = sprintf(_('%1$s <%2$s>'), $userinfo['displayname'], $userinfo['email']); + $username = sprintf(T('%1$s <%2$s>'), $userinfo['displayname'], $userinfo['email']); } else { @@ -401,7 +401,7 @@ function process_custom_fields(&$bugapi, &$msg, $errorbox = false, $searchMode = if ($field['required'] AND empty($inputdata["$fieldname"]) AND !$searchMode) { - $errorlist[] = sprintf(_('The field "%1$s" is a required.'), $field['name']); + $errorlist[] = sprintf(T('The field "%1$s" is a required.'), $field['name']); continue; } @@ -409,7 +409,7 @@ function process_custom_fields(&$bugapi, &$msg, $errorbox = false, $searchMode = { if (!preg_match('#' . str_replace('#', '\#', $field['regexmatch']) . '#si', $inputdata["$fieldname"])) { - $errorlist[] = sprintf(_('%1$s does not match the specified format'), $field['name']); + $errorlist[] = sprintf(T('%1$s does not match the specified format'), $field['name']); continue; } } diff --git a/includes/init.php b/includes/init.php index 84a77a6..757c684 100755 --- a/includes/init.php +++ b/includes/init.php @@ -148,15 +148,22 @@ $stylevar['left'] = ($language['direction'] == 'ltr' ? 'left' : 'right'); $stylevar['right'] = ($language['direction'] == 'ltr' ? 'right' : 'left'); // start gettext engine -putenv("LANG=$language[langcode]"); -putenv("LANGUAGE=$language[langcode]"); +if (!$bugsys->options['devgettext']) +{ + putenv("LANG=$language[langcode]"); + putenv("LANGUAGE=$language[langcode]"); -setlocale(LC_ALL, $language['langcode']); + setlocale(LC_ALL, $language['langcode']); -bindtextdomain('MESSAGES', $bugsys->apppath . 'locale/'); -textdomain('MESSAGES'); + bindtextdomain('MESSAGES', $bugsys->apppath . 'locale/'); + textdomain('MESSAGES'); -bind_textdomain_codeset('MESSAGES', $language['charset']); + bind_textdomain_codeset('MESSAGES', $language['charset']); +} +else +{ + $bugsys->debug("using custom MOReader instead of Gettext"); +} require_once('./includes/definitions.php'); @@ -171,7 +178,7 @@ $datef->fetch_offset(); // mail system $bugsys->load('mail', 'mail', true); $mail->setFromAddress($bugsys->options['webmasteremail']); -$mail->setFromName(_('Bugdar Notification')); +$mail->setFromName(T('Bugdar Notification')); /*=====================================================================*\ || ################################################################### diff --git a/includes/language.php b/includes/language.php index 2fd9661..e808ca9 100644 --- a/includes/language.php +++ b/includes/language.php @@ -36,7 +36,7 @@ if (!function_exists('gettext')) // ################################################################### // LEXICAL STRING CONSTANTS -define('L_INVALID_ID', _('That is an invalid ID.')); +define('L_INVALID_ID', T('That is an invalid ID.')); // ################################################################### // determines the user's language @@ -71,6 +71,41 @@ function fetch_user_language() return $lang; } +/** + * Translation function. This will take in a native (English) string and return either + * a translated version or, if it cannot find one, the native string back. If the devgettext + * setting is enabled, this will use MOReader to load a .mo file, otherwise it will fall back onto + * making a call to _(), the built-in Gettext implementation. + * + * @param string Native string + * + * @return string Translated string + */ +function T($str) +{ + global $bugsys; + static $mo; + + if (!$bugsys->options['devgettext']) + { + return _($str); + } + + if ($mo === null) + { + require_once './includes/class_mo.php'; + $info = fetch_user_language(); + if ($info['langcode'] == null) + { + $bugsys->debug("cannot translate '$str'"); + return $str; + } + $mo = new MOReader("locale/$info[langcode]/LC_MESSAGES/messages.mo"); + } + + return $mo->T($str); +} + /*=====================================================================*\ || ################################################################### || # $HeadURL$ diff --git a/index.php b/index.php index 71958bb..9181c6c 100644 --- a/index.php +++ b/index.php @@ -54,7 +54,7 @@ $count = $db->query_first(" if (!$count['count']) { - $message->error(_('There are no bugs to display. This could be because you do not have permission to view bugs, or there may be none in the database.')); + $message->error(T('There are no bugs to display. This could be because you do not have permission to view bugs, or there may be none in the database.')); } $pagination->setTotal($count['count']); diff --git a/login.php b/login.php index f620776..e1e54b5 100755 --- a/login.php +++ b/login.php @@ -39,7 +39,7 @@ APIError(array(new API_Error_Handler($message), 'user_cumulative')); if ($bugsys->userinfo['userid'] AND $_REQUEST['do'] != 'logout' AND $_POST['do'] != 'cplogin' AND $_REQUEST['do'] != 'cplogout') { - $message->error(_('You are already logged in.')); + $message->error(T('You are already logged in.')); } // ################################################################### @@ -77,11 +77,11 @@ if ($_POST['do'] == 'login' OR $_POST['do'] == 'cplogin') $db->query("INSERT INTO " . TABLE_PREFIX . "adminsession (sessionid, userid, dateline) VALUES ('$hash', " . $auth->bugdarUser['userid'] . ", " . TIMENOW . ")"); $funct->cookie(COOKIE_PREFIX . 'adminsession', $hash, false); } - $message->redirect(_('Welcome back! You are now logged in.'), $url); + $message->redirect(T('Welcome back! You are now logged in.'), $url); } else { - $message->error(_('Invalid email or password.')); + $message->error(T('Invalid email or password.')); } } @@ -94,11 +94,11 @@ if ($_REQUEST['do'] == 'logout') $db->query("DELETE FROM " . TABLE_PREFIX . "adminsession WHERE sessionid = '" . $bugsys->input_escape(COOKIE_PREFIX . 'adminsession') . "'"); $auth->clearCookies(); $funct->cookie(COOKIE_PREFIX . 'adminsession'); - $message->redirect(_('You have been logged out.'), ($_SERVER['HTTP_REFERER'] ? $_SERVER['HTTP_REFERER'] : 'index.php')); + $message->redirect(T('You have been logged out.'), ($_SERVER['HTTP_REFERER'] ? $_SERVER['HTTP_REFERER'] : 'index.php')); } else { - $message->error(_('You need to be logged in to access this feature.')); + $message->error(T('You need to be logged in to access this feature.')); } } @@ -129,7 +129,7 @@ if ($_POST['do'] == 'sendpw') $mail->send($user->objdata['email'], $user->objdata['displayname']); - $message->message(sprintf(_('An email has been dispatched to %1$s that contains instructions on how to reset your password.'), $user->objdata['email'])); + $message->message(sprintf(T('An email has been dispatched to %1$s that contains instructions on how to reset your password.'), $user->objdata['email'])); } } @@ -160,11 +160,11 @@ if ($_POST['do'] == 'resetpw') if ($bugsys->in['fix_password'] != $bugsys->in['confirm_password']) { - $message->addError(_('The passwords you entered do not patch.')); + $message->addError(T('The passwords you entered do not patch.')); } if (empty($bugsys->in['fix_password'])) { - $message->addError(_('Your new password cannot be empty.')); + $message->addError(T('Your new password cannot be empty.')); } $user->set('password', $bugsys->in['fix_password']); @@ -175,7 +175,7 @@ if ($_POST['do'] == 'resetpw') $db->query("DELETE FROM " . TABLE_PREFIX . "passwordreset WHERE userid = " . $activation['userid']); $user->update(); - $message->redirect(_('Your password has been changed successfully. You will now be redirected to the login page.'), 'login.php'); + $message->redirect(T('Your password has been changed successfully. You will now be redirected to the login page.'), 'login.php'); } else { @@ -195,7 +195,7 @@ if ($_REQUEST['do'] == 'recoverpw') $activation = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "passwordreset WHERE activatorid = '" . $bugsys->input_escape('activator') . "'"); if (!$activation) { - $message->error(_('Invalid activation reset key. Please make sure you copied the URL exactly as it appeared in the email.')); + $message->error(T('Invalid activation reset key. Please make sure you copied the URL exactly as it appeared in the email.')); } eval('$template->flush("' . $template->fetch('passwordreset') . '");'); @@ -209,11 +209,11 @@ if ($_REQUEST['do'] == 'cplogout') { $db->query("DELETE FROM " . TABLE_PREFIX . "adminsession WHERE sessionid = '" . $bugsys->input_escape(COOKIE_PREFIX . 'adminsession') . "'"); $funct->cookie(COOKIE_PREFIX . 'adminsession'); - $message->redirect(_('You have been logged out.'), 'admin/'); + $message->redirect(T('You have been logged out.'), 'admin/'); } else { - $message->error(_('You are not logged in.')); + $message->error(T('You are not logged in.')); } } diff --git a/newreport.php b/newreport.php index cf8dcaf..5255a56 100755 --- a/newreport.php +++ b/newreport.php @@ -126,7 +126,7 @@ if ($_POST['do'] == 'insert') $notif->finalize(); - $message->redirect(_('The bug has been added to the database.'), ($bugsys->in['submit_reload'] == '' ? "showreport.php?bugid=" . $bug->values['bugid'] : 'newreport.php')); + $message->redirect(T('The bug has been added to the database.'), ($bugsys->in['submit_reload'] == '' ? "showreport.php?bugid=" . $bug->values['bugid'] : 'newreport.php')); } else { @@ -141,11 +141,11 @@ if ($_REQUEST['do'] == 'add') { if (!is_array($bugsys->datastore['product'])) { - $message->error(_('No products have been setup, therefore no bugs can be added.')); + $message->error(T('No products have been setup, therefore no bugs can be added.')); } if (!is_array($bugsys->datastore['version'])) { - $message->error(_('No versions have been setup underneath your product(s), therefore no bugs can be added.')); + $message->error(T('No versions have been setup underneath your product(s), therefore no bugs can be added.')); } $select['severity'] = construct_datastore_select('severity', 'severity', 'severityid', ($bugsys->in['severity'] ? $bugsys->in['severity'] : $bugsys->options['defaultseverity'])); diff --git a/register.php b/register.php index ccb7aa5..c849890 100755 --- a/register.php +++ b/register.php @@ -39,22 +39,22 @@ if ($_POST['do'] == 'insert') { if ($bugsys->userinfo['userid']) { - $message->error(_('Sorry, you are already registered.')); + $message->error(T('Sorry, you are already registered.')); } if (!$bugsys->options['allownewreg']) { - $message->error(_('Sorry, we don\'t allow new registrations.')); + $message->error(T('Sorry, we don\'t allow new registrations.')); } if ($bugsys->in['email'] != $bugsys->in['confirmemail']) { - $message->addError(_('The emails you entered do not match.')); + $message->addError(T('The emails you entered do not match.')); } if ($bugsys->in['password'] != $bugsys->in['confirmpassword']) { - $message->addError(_('The passwords you entered did not match.')); + $message->addError(T('The passwords you entered did not match.')); } if ($bugsys->options['verifyemail']) @@ -103,7 +103,7 @@ if ($_POST['do'] == 'insert') $mail->send($bugsys->in['email'], $bugsys->in['displayname']); - $message->message(_('You now need to activate your account via email.')); + $message->message(T('You now need to activate your account via email.')); } else if ($usergroupid == 4 OR $usergroupid == 2) { @@ -119,11 +119,11 @@ if ($_POST['do'] == 'insert') if ($usergroupid == 4) { - $message->message(_('Your account is pending approval.')); + $message->message(T('Your account is pending approval.')); } else { - $message->message(_('Thank you for registering. You may now use your account.')); + $message->message(T('Thank you for registering. You may now use your account.')); } } } @@ -140,12 +140,12 @@ if (empty($_REQUEST['do'])) { if ($bugsys->userinfo['userid']) { - $message->error(_('Sorry, you are already registered.')); + $message->error(T('Sorry, you are already registered.')); } if (!$bugsys->options['allownewreg']) { - $message->error(_('Sorry, we don\'t allow new registrations.')); + $message->error(T('Sorry, we don\'t allow new registrations.')); } foreach ($bugsys->datastore['language'] AS $value => $temp) @@ -179,11 +179,11 @@ if ($_REQUEST['do'] == 'activate') $mail->send($user['email'], $user['displayname']); } - $message->message(_('Your account is now activated and you can now login.')); + $message->message(T('Your account is now activated and you can now login.')); } else { - $message->error(_('Sorry, we could not match your registration string. Please make sure you entered the correct URL.')); + $message->error(T('Sorry, we could not match your registration string. Please make sure you entered the correct URL.')); } } diff --git a/search.php b/search.php index 6381110..e22c3b6 100644 --- a/search.php +++ b/search.php @@ -111,12 +111,12 @@ if ($_REQUEST['do'] == 'search') { if (!is_array($bugsys->datastore['product'])) { - $message->error(_('No products are setup, therefore there can be no bugs and thus search cannot function.')); + $message->error(T('No products are setup, therefore there can be no bugs and thus search cannot function.')); } if (!is_array($bugsys->datastore['version'])) { - $message->error(_('No versions have been added underneath your product(s), there can be no bugs and thus search cannot function.')); + $message->error(T('No versions have been added underneath your product(s), there can be no bugs and thus search cannot function.')); } $productSelect = ConstructProductSelect(); @@ -359,7 +359,7 @@ if ($_REQUEST['do'] == 'process') // have to search something if (sizeof($querybuild) < 1) { - $message->error(sprintf(_('You have to enter some criteria to search for. Note that words less than %1$d characters are ignored by the search engine (and some other very common words, too).'), SEARCH_WORD_MIN)); + $message->error(sprintf(T('You have to enter some criteria to search for. Note that words less than %1$d characters are ignored by the search engine (and some other very common words, too).'), SEARCH_WORD_MIN)); } // ------------------------------------------------------------------- @@ -389,7 +389,7 @@ if ($_REQUEST['do'] == 'process') if ($numrows < 1) { - $message->error(_('No search results were returned that matched your criteria. Please try again with different search requirements.')); + $message->error(T('No search results were returned that matched your criteria. Please try again with different search requirements.')); } while ($result = $db->fetch_array($search)) @@ -564,7 +564,7 @@ if ($_POST['do'] == 'doupdate') $log->update_history(); } - $message->redirect(_('The specified bugs have been updated and you will now return to your search results.'), 'search.php?searchid=' . $bugsys->in['searchid']); + $message->redirect(T('The specified bugs have been updated and you will now return to your search results.'), 'search.php?searchid=' . $bugsys->in['searchid']); } // ################################################################### @@ -581,12 +581,12 @@ if ($_REQUEST['do'] == 'export') } else { - $message->error(_('The search results are trying to export are invalid. Please start over here and try again.')); + $message->error(T('The search results are trying to export are invalid. Please start over here and try again.')); } if (!$search) { - $message->error(_('Your search has expired because it is older than one hour. Please start over here.')); + $message->error(T('Your search has expired because it is older than one hour. Please start over here.')); } $bugs = $db->query("SELECT * FROM " . TABLE_PREFIX . "bug WHERE bugid IN ($search[ids]) $search[orderby]"); @@ -628,7 +628,7 @@ if ($_REQUEST['do'] == 'export') $xml .= "\n"; - $funct->download_file($xml, _('bugdar-search-' . $search['searchid'] . '.xml'), true); + $funct->download_file($xml, T('bugdar-search-' . $search['searchid'] . '.xml'), true); } // ################################################################### @@ -638,21 +638,21 @@ if ($_POST['do'] == 'dosave') $search = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->input_clean('searchid', TYPE_UINT) . " AND userid = " . $bugsys->userinfo['userid']); if (!$search) { - $message->addError(_('The search does not exist.')); + $message->addError(T('The search does not exist.')); } if ($search['name']) { - $message->addError(sprintf(_('This search has already been named "%1$s".'), $search['name'])); + $message->addError(sprintf(T('This search has already been named "%1$s".'), $search['name'])); } if (empty($bugsys->in['name'])) { - $message->addError(_('The name cannot be empty.')); + $message->addError(T('The name cannot be empty.')); } if (!$message->hasErrors()) { $db->query("UPDATE " . TABLE_PREFIX . "search SET name = '" . $bugsys->input_escape('name') . "' WHERE searchid = " . $bugsys->in['searchid']); - $message->redirect(_('Your search has been saved.'), 'search.php?searchid=' . $search['searchid']); + $message->redirect(T('Your search has been saved.'), 'search.php?searchid=' . $search['searchid']); } else { @@ -679,7 +679,7 @@ if ($_POST['do'] == 'results') { if (!$search['ids']) { - $message->error(_('No bugs matched your search criteria. Please try again with different search requirements.')); + $message->error(T('No bugs matched your search criteria. Please try again with different search requirements.')); } $searchid = $search['searchid']; diff --git a/showhistory.php b/showhistory.php index 8f608ce..ebef405 100644 --- a/showhistory.php +++ b/showhistory.php @@ -66,7 +66,7 @@ $customfields = $db->query(" while ($field = $db->fetch_array($customfields)) { - $fieldlist["$field[fieldid]"] = sprintf(_('Custom Field %1$s (%2$s)'), $field['fieldid'], $field['name']); + $fieldlist["$field[fieldid]"] = sprintf(T('Custom Field %1$s (%2$s)'), $field['fieldid'], $field['name']); } // ################################################################### @@ -108,11 +108,11 @@ foreach ($logs AS $dateline => $logitems) { if ($matches[1] == 'comment') { - $log['field'] = sprintf(_('Comment #%1$s %2$s'), $log['commentid'], ucwords($matches[2])); + $log['field'] = sprintf(T('Comment #%1$s %2$s'), $log['commentid'], ucwords($matches[2])); } else if ($matches[1] == 'attachment') { - $log['field'] = sprintf(_('Attachment #2%1$s %2$s'), $log['attachmentid'], ucwords($matches[2])); + $log['field'] = sprintf(T('Attachment #2%1$s %2$s'), $log['attachmentid'], ucwords($matches[2])); } } else if (preg_match('#^.?custom(.field)?([0-9]+?)#', $log['field'], $matches)) diff --git a/showreport.php b/showreport.php index 68f7f14..7119bad 100644 --- a/showreport.php +++ b/showreport.php @@ -197,7 +197,7 @@ else $show['subscribe'] = can_perform('cansubscribe', $bug['product']); $favorite = (bool)$db->query_first("SELECT * FROM " . TABLE_PREFIX . "favorite WHERE bugid = $bug[bugid] AND userid = " . $bugsys->userinfo['userid']); -$favoritetext = ($favorite ? _('Remove from Favorites') : _('Add to Favorites')); +$favoritetext = ($favorite ? T('Remove from Favorites') : T('Add to Favorites')); $bug['userinfo'] = construct_user_display($bug); $bug['datetime'] = $datef->format($bugsys->options['dateformat'], $bug['dateline']); diff --git a/syndicate.php b/syndicate.php index 2240ad2..0f0329b 100644 --- a/syndicate.php +++ b/syndicate.php @@ -59,23 +59,23 @@ while ($bug = $db->fetch_array($bugs_fetch)) ' . htmlspecialchars(' - + - + - + - + - +
' . _('Bug ID') . ':' . T('Bug ID') . ': ' . $bug['bugid'] . '
' . _('Summary') . ':' . T('Summary') . ': ' . $bug['summary'] . '
' . _('Product/Component/Version') . ':' . T('Product/Component/Version') . ': ' . $bugsys->datastore['product']["$bug[product]"]['title'] . '/' . (($bug['component']) ? $bugsys->datastore['product']["$bug[component]"]['title'] . '/' : '') . $bugsys->datastore['version']["$bug[version]"]['version'] . '
' . _('Status') . ':' . T('Status') . ': ' . $bugsys->datastore['status']["$bug[status]"]['status'] . '
' . _('Severity') . ':' . T('Severity') . ': ' . $bugsys->datastore['severity']["$bug[severity]"]['severity'] . '
@@ -91,7 +91,7 @@ while ($bug = $db->fetch_array($bugs_fetch)) echo ' - ' . sprintf(_('%1$s Syndication Feed'), $bugsys->options['trackertitle']) . ' + ' . sprintf(T('%1$s Syndication Feed'), $bugsys->options['trackertitle']) . ' ' . gmdate('Y-m-d\TH:i:s\Z', $lastupdated) . ' diff --git a/userctrl.php b/userctrl.php index 64f5a8a..7ef2dcb 100644 --- a/userctrl.php +++ b/userctrl.php @@ -65,7 +65,7 @@ if ($_POST['do'] == 'killsearch') $db->query("DELETE FROM " . TABLE_PREFIX . "search WHERE searchid = " . $bugsys->in['searchid']); - $message->redirect(_('This saved search has been removed from your list.'), 'userctrl.php'); + $message->redirect(T('This saved search has been removed from your list.'), 'userctrl.php'); } // ################################################################### @@ -78,7 +78,7 @@ if ($_REQUEST['do'] == 'deletesearch') $message->errorPermission(); } - $message->confirm(_('Are you sure you want to delete this saved search?'), 'userctrl.php', 'killsearch', _('Delete'), _('Cancel'), array('searchid' => $bugsys->in['searchid'])); + $message->confirm(T('Are you sure you want to delete this saved search?'), 'userctrl.php', 'killsearch', T('Delete'), T('Cancel'), array('searchid' => $bugsys->in['searchid'])); } // ################################################################### @@ -91,13 +91,13 @@ if ($_POST['do'] == 'update') { if (empty($bugsys->in['validate'])) { - $message->addError(_('You need to enter your current password to change your email or password')); + $message->addError(T('You need to enter your current password to change your email or password')); } else { if (md5(md5($bugsys->in['validate']) . md5($bugsys->userinfo['salt'])) != $bugsys->userinfo['password']) { - $message->addError(_('Your authentication password does not match the one in our records')); + $message->addError(T('Your authentication password does not match the one in our records')); } } } @@ -108,12 +108,12 @@ if ($_POST['do'] == 'update') { if (!empty($bugsys->in['email_change']) AND empty($bugsys->in['email_confirm'])) { - $message->addError(_('You need to enter both the email and confirm email fields to change your address')); + $message->addError(T('You need to enter both the email and confirm email fields to change your address')); } if ($bugsys->in['email_change'] != $bugsys->in['email_confirm']) { - $message->addError(_('Your email and confirm email addresses do not match')); + $message->addError(T('Your email and confirm email addresses do not match')); } $userapi->set('email', $bugsys->in['email_change']); @@ -125,13 +125,13 @@ if ($_POST['do'] == 'update') { if (!empty($bugsys->in['password_change']) AND empty($bugsys->in['password_confirm'])) { - $message->addError(_('You need to enter both the password and confirm password fields to change your password')); + $message->addError(T('You need to enter both the password and confirm password fields to change your password')); } else { if ($bugsys->in['password_change'] != $bugsys->in['password_confirm']) { - $message->addError(_('Your password and confirm password do not match')); + $message->addError(T('Your password and confirm password do not match')); } } @@ -194,7 +194,7 @@ if ($_POST['do'] == 'update') } } - $message->redirect(_('The changes to your account have been made.'), 'userctrl.php'); + $message->redirect(T('The changes to your account have been made.'), 'userctrl.php'); } } diff --git a/vote.php b/vote.php index bf6f2a6..7c35db3 100644 --- a/vote.php +++ b/vote.php @@ -56,7 +56,7 @@ if ($_REQUEST['do'] == 'vote') if ($vote['uservote']) { - $message->error(_('You have already voted on this bug.')); + $message->error(T('You have already voted on this bug.')); } // handle userids @@ -88,12 +88,12 @@ if ($_REQUEST['do'] == 'vote') } else { - $message->error(_('You need to specify whether you want to vote for or against this bug.')); + $message->error(T('You need to specify whether you want to vote for or against this bug.')); } $db->query("UPDATE " . TABLE_PREFIX . "vote SET userids = '$userids', votefor = $votefor, voteagainst = $voteagainst WHERE bugid = $bug[bugid]"); - $message->redirect(_('Your vote has been added.'), "showreport.php?bugid=$bug[bugid]"); + $message->redirect(T('Your vote has been added.'), "showreport.php?bugid=$bug[bugid]"); } /*=====================================================================*\ -- 2.22.5