Skip to content

Commit

Permalink
i18n: Eliminate duplicate or incorrect texts
Browse files Browse the repository at this point in the history
This is my attempt at removing similar texts from the translator work load.
It also makes an attempt at dropping some misspelled words and works toward
standardizing some phrases.
  • Loading branch information
Jared Hancock committed Mar 24, 2016
1 parent 6217b75 commit 6f6e418
Show file tree
Hide file tree
Showing 87 changed files with 235 additions and 245 deletions.
4 changes: 2 additions & 2 deletions include/ajax.content.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function ticket_variables() {
<tr><td>%{ticket.phone}</td><td>'.__('Phone number | ext').'</td></tr>
<tr><td>%{ticket.status}</td><td>'.__('Status').'</td></tr>
<tr><td>%{ticket.priority}</td><td>'.__('Priority').'</td></tr>
<tr><td>%{ticket.assigned}</td><td>'.__('Assigned agent and/or team').'</td></tr>
<tr><td>%{ticket.assigned}</td><td>'.__('Assigned Agent / Team').'</td></tr>
<tr><td>%{ticket.create_date}</td><td>'.__('Date created').'</td></tr>
<tr><td>%{ticket.due_date}</td><td>'.__('Due date').'</td></tr>
<tr><td>%{ticket.close_date}</td><td>'.__('Date closed').'</td></tr>
Expand All @@ -82,7 +82,7 @@ function ticket_variables() {
<tr><td>%{response}</td><td>'.__('Outgoing response').'</td></tr>
<tr><td>%{comments}</td><td>'.__('Assign/transfer comments').'</td></tr>
<tr><td>%{note}</td><td>'.__('Internal note <em>(expandable)</em>').'</td></tr>
<tr><td>%{assignee}</td><td>'.__('Assigned agent/team').'</td></tr>
<tr><td>%{assignee}</td><td>'.__('Assigned Agent / Team').'</td></tr>
<tr><td>%{assigner}</td><td>'.__('Agent assigning the ticket').'</td></tr>
<tr><td>%{url}</td><td>'.__('osTicket\'s base url (FQDN)').'</td></tr>
<tr><td>%{reset_link}</td>
Expand Down
9 changes: 0 additions & 9 deletions include/ajax.draft.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,14 +354,6 @@ function getFileList() {
Http::response(500, 'Unable to lookup files');

$files = array();
$folders = array(
'C' => __('Canned Responses'),
'F' => __('FAQ Articles'),
'T' => __('Email Templates'),
'L' => __('Logos'),
'P' => __('Pages'),
'H' => __('This Thread'),
);
while (list($id, $type, $name) = db_fetch_row($res)) {
$f = AttachmentFile::lookup((int) $id);
$url = $f->getDownloadUrl();
Expand All @@ -371,7 +363,6 @@ function getFileList() {
'thumb'=>$url.($type != 'H' ? '&s=128' : ''),
'image'=>$url,
'title'=>$name ?: $f->getName(),
'folder'=>$folders[$type]
);
}
echo JsonDataEncoder::encode($files);
Expand Down
2 changes: 1 addition & 1 deletion include/ajax.kbase.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function faq($id, $format='html') {
'<div style="width:650px;">
<strong>%s</strong><div class="thread-body">%s</div>
<div class="clear"></div>
<div class="faded">'.__('Last updated %s').'</div>
<div class="faded">'.__('Last Updated %s').'</div>
<hr>
<a href="faq.php?id=%d">'.__('View').'</a> | <a href="faq.php?id=%d">'.__('Attachments (%d)').'</a>',
$faq->getQuestion(),
Expand Down
39 changes: 19 additions & 20 deletions include/ajax.tasks.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function edit($tid) {
Http::response(404, __('No such task'));

if (!$task->checkStaffPerm($thisstaff, Task::PERM_EDIT))
Http::response(403, __('Permission Denied'));
Http::response(403, __('Permission denied'));

$info = $errors = array();
$forms = DynamicFormEntry::forObject($task->getId(),
Expand All @@ -128,7 +128,9 @@ function edit($tid) {
if ($task->update($forms, $_POST, $errors)) {
Http::response(201, 'Task updated successfully');
} elseif(!$errors['err']) {
$errors['err']=__('Unable to update the task. Correct the errors below and try again!');
$errors['err']=sprintf(
__('Unable to update %s. Correct any errors below and try again.'),
__('task'));
}
$info = Format::htmlchars($_POST);
}
Expand Down Expand Up @@ -170,7 +172,7 @@ function massProcess($action, $w=null) {
if ($_POST) {
if (!$_POST['tids'] || !($count=count($_POST['tids'])))
$errors['err'] = sprintf(
__('You must select at least %s.'),
__('You must select at least %s'),
__('one task'));
} else {
$count = $_REQUEST['count'];
Expand Down Expand Up @@ -289,8 +291,7 @@ function massProcess($action, $w=null) {

if (!$i) {
$info['error'] = sprintf(
__('Unable to %1$s %2$s'),
__('assign'),
__('Unable to assign %s' /* %s may be pluralized */),
_N('selected task', 'selected tasks', $count));
}
}
Expand All @@ -315,8 +316,7 @@ function massProcess($action, $w=null) {

if (!$i) {
$info['error'] = sprintf(
__('Unable to %1$s %2$s'),
__('transfer'),
__('Unable to transfer %s' /* %s may be pluralized */),
_N('selected task', 'selected tasks', $count));
}
}
Expand Down Expand Up @@ -358,9 +358,9 @@ function massProcess($action, $w=null) {
// will be checked below.
if ($perm && !$thisstaff->hasPerm($perm, false))
$errors['err'] = sprintf(
__('You do not have permission to %s %s'),
__($action),
__('tasks'));
__('You do not have permission to %s tasks'
/* %s will be an action verb */ ),
__($action));

if ($_POST && !$errors) {
if (!$_POST['status']
Expand Down Expand Up @@ -410,8 +410,7 @@ function massProcess($action, $w=null) {

if (!$i) {
$info['error'] = sprintf(
__('Unable to %1$s %2$s'),
__('delete'),
__('Unable to delete %s'),
_N('selected task', 'selected tasks', $count));
}
}
Expand All @@ -427,7 +426,7 @@ function massProcess($action, $w=null) {
if ($i==$count) {
$msg = sprintf(__('Successfully %s %s.'),
$actions[$action]['verbed'],
sprintf(__('%1$d %2$s'),
sprintf('%1$d %2$s',
$count,
_N('selected task', 'selected tasks', $count))
);
Expand All @@ -443,7 +442,7 @@ function massProcess($action, $w=null) {
Http::response(201, 'processed');
} elseif($_POST && !isset($info['error'])) {
$info['error'] = $errors['err'] ?: sprintf(
__('Unable to %1$s %2$s'),
__('Unable to %1$s %2$s'),
__('process'),
_N('selected task', 'selected tasks', $count));
}
Expand Down Expand Up @@ -476,7 +475,7 @@ function transfer($tid) {
Http::response(404, __('No such task'));

if (!$task->checkStaffPerm($thisstaff, Task::PERM_TRANSFER))
Http::response(403, __('Permission Denied'));
Http::response(403, __('Permission denied'));

$errors = array();

Expand Down Expand Up @@ -520,7 +519,7 @@ function assign($tid, $target=null) {
if (!$task->checkStaffPerm($thisstaff, Task::PERM_ASSIGN)
|| !($form=$task->getAssignmentForm($_POST, array(
'target' => $target))))
Http::response(403, __('Permission Denied'));
Http::response(403, __('Permission denied'));

$errors = array();
$info = array(
Expand Down Expand Up @@ -566,7 +565,7 @@ function claim($tid) {
// Check for premissions and such
if (!$task->checkStaffPerm($thisstaff, Task::PERM_ASSIGN)
|| !($form = $task->getClaimForm($_POST)))
Http::response(403, __('Permission Denied'));
Http::response(403, __('Permission denied'));

$errors = array();
$info = array(
Expand Down Expand Up @@ -621,7 +620,7 @@ function delete($tid) {
Http::response(404, __('No such task'));

if (!$task->checkStaffPerm($thisstaff, Task::PERM_DELETE))
Http::response(403, __('Permission Denied'));
Http::response(403, __('Permission denied'));

$errors = array();
$info = array(
Expand Down Expand Up @@ -700,8 +699,8 @@ function changeStatus($tid, $status) {

if (!$errors && (!$perm || !$task->checkStaffPerm($thisstaff, $perm)))
$errors['err'] = sprintf(
__('You do not have permission to %s %s'),
$statuses[$status], __('tasks'));
__('You do not have permission to %s tasks'),
$statuses[$status]);

if ($_POST && !$errors) {
if ($task->setStatus($status, $_POST['comments'], $errors))
Expand Down
47 changes: 24 additions & 23 deletions include/ajax.tickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ function transfer($tid) {
Http::response(404, __('No such ticket'));

if (!$ticket->checkStaffPerm($thisstaff, Ticket::PERM_TRANSFER))
Http::response(403, __('Permission Denied'));
Http::response(403, __('Permission denied'));

$errors = array();

Expand Down Expand Up @@ -426,7 +426,7 @@ function assign($tid, $target=null) {
if (!$ticket->checkStaffPerm($thisstaff, Ticket::PERM_ASSIGN)
|| !($form = $ticket->getAssignmentForm($_POST,
array('target' => $target))))
Http::response(403, __('Permission Denied'));
Http::response(403, __('Permission denied'));

$errors = array();
$info = array(
Expand Down Expand Up @@ -486,7 +486,7 @@ function claim($tid) {
|| !$ticket->isOpen() // Claim only open
|| $ticket->getStaff() // cannot claim assigned ticket
|| !($form = $ticket->getClaimForm($_POST)))
Http::response(403, __('Permission Denied'));
Http::response(403, __('Permission denied'));

$errors = array();
$info = array(
Expand Down Expand Up @@ -568,7 +568,7 @@ function massProcess($action, $w=null) {
if ($_POST) {
if (!$_POST['tids'] || !($count=count($_POST['tids'])))
$errors['err'] = sprintf(
__('You must select at least %s.'),
__('You must select at least %s'),
__('one ticket'));
} else {
$count = $_REQUEST['count'];
Expand Down Expand Up @@ -736,9 +736,8 @@ function massProcess($action, $w=null) {
// Generic permission check.
if (!$thisstaff->hasPerm(Ticket::PERM_DELETE, false))
$errors['err'] = sprintf(
__('You do not have permission to %s %s'),
__('delete'),
__('tickets'));
__('You do not have permission %s'),
__('to delete tickets'))


if ($_POST && !$errors) {
Expand Down Expand Up @@ -768,14 +767,16 @@ function massProcess($action, $w=null) {
if ($i==$count) {
$msg = sprintf(__('Successfully %s %s.'),
$actions[$action]['verbed'],
sprintf(__('%1$d %2$s'),
sprintf('%1$d %2$s',
$count,
_N('selected ticket', 'selected tickets', $count))
);
$_SESSION['::sysmsgs']['msg'] = $msg;
} else {
$warn = sprintf(
__('%1$d of %2$d %3$s %4$s'), $i, $count,
__('%1$d of %2$d %3$s %4$s'
/* Tokens are <x> of <y> <selected ticket(s)> <actioned> */),
$i, $count,
_N('selected ticket', 'selected tickets',
$count),
$actions[$action]['verbed']);
Expand All @@ -784,7 +785,7 @@ function massProcess($action, $w=null) {
Http::response(201, 'processed');
} elseif($_POST && !isset($info['error'])) {
$info['error'] = $errors['err'] ?: sprintf(
__('Unable to %1$s %2$s'),
__('Unable to %1$s %2$s'),
__('process'),
_N('selected ticket', 'selected tickets', $count));
}
Expand Down Expand Up @@ -846,8 +847,8 @@ function changeTicketStatus($tid, $status, $id=0) {
break;
default:
$state = $ticket->getStatus()->getState();
$info['warn'] = sprintf('%s %s',
__('Unknown or invalid'), __('status'));
$info['warn'] = sprintf(__('%s: Unknown or invalid'),
__('status'));
}

$info['status_id'] = $id ?: $ticket->getStatusId();
Expand Down Expand Up @@ -879,17 +880,17 @@ function setTicketStatus($tid) {
case 'open':
if (!$role->hasPerm(TicketModel::PERM_CLOSE)
&& !$role->hasPerm(TicketModel::PERM_CREATE))
$errors['err'] = sprintf(__('You do not have permission %s.'),
$errors['err'] = sprintf(__('You do not have permission %s'),
__('to reopen tickets'));
break;
case 'closed':
if (!$role->hasPerm(TicketModel::PERM_CLOSE))
$errors['err'] = sprintf(__('You do not have permission %s.'),
$errors['err'] = sprintf(__('You do not have permission %s'),
__('to resolve/close tickets'));
break;
case 'deleted':
if (!$role->hasPerm(TicketModel::PERM_DELETE))
$errors['err'] = sprintf(__('You do not have permission %s.'),
$errors['err'] = sprintf(__('You do not have permission %s'),
__('to archive/delete tickets'));
break;
default:
Expand Down Expand Up @@ -974,11 +975,11 @@ function setSelectedTicketsStatus($state) {
$errors = $info = array();
if (!$thisstaff || !$thisstaff->canManageTickets())
$errors['err'] = sprintf('%s %s',
sprintf(__('You do not have permission %s.'),
sprintf(__('You do not have permission %s'),
__('to mass manage tickets')),
__('Contact admin for such access'));
elseif (!$_REQUEST['tids'] || !count($_REQUEST['tids']))
$errors['err']=sprintf(__('You must select at least %s.'),
$errors['err']=sprintf(__('You must select at least %s'),
__('one ticket'));
elseif (!($status= TicketStatus::lookup($_REQUEST['status_id'])))
$errors['status_id'] = sprintf('%s %s',
Expand All @@ -989,17 +990,17 @@ function setSelectedTicketsStatus($state) {
case 'open':
if (!$thisstaff->hasPerm(TicketModel::PERM_CLOSE, false)
&& !$thisstaff->hasPerm(TicketModel::PERM_CREATE, false))
$errors['err'] = sprintf(__('You do not have permission %s.'),
$errors['err'] = sprintf(__('You do not have permission %s'),
__('to reopen tickets'));
break;
case 'closed':
if (!$thisstaff->hasPerm(TicketModel::PERM_CLOSE, false))
$errors['err'] = sprintf(__('You do not have permission %s.'),
$errors['err'] = sprintf(__('You do not have permission %s'),
__('to resolve/close tickets'));
break;
case 'deleted':
if (!$thisstaff->hasPerm(TicketModel::PERM_DELETE, false))
$errors['err'] = sprintf(__('You do not have permission %s.'),
$errors['err'] = sprintf(__('You do not have permission %s'),
__('to archive/delete tickets'));
break;
default:
Expand Down Expand Up @@ -1031,7 +1032,7 @@ function setSelectedTicketsStatus($state) {
if ($i==$count) {

if (!strcasecmp($status->getState(), 'deleted')) {
$msg = sprintf(__( 'Successfully deleted %s.'),
$msg = sprintf(__( 'Successfully deleted %s'),
_N('selected ticket', 'selected tickets',
$count));
} else {
Expand All @@ -1048,7 +1049,7 @@ function setSelectedTicketsStatus($state) {
} else {

if (!strcasecmp($status->getState(), 'deleted')) {
$warn = sprintf(__('Successfully deleted %s.'),
$warn = sprintf(__('Successfully deleted %s'),
sprintf(__('%1$d of %2$d selected tickets'),
$i, $count)
);
Expand Down Expand Up @@ -1229,7 +1230,7 @@ function addTask($tid) {
$info['title'] = sprintf(
__( 'Ticket #%1$s: %2$s'),
$ticket->getNumber(),
_('Add New Task')
__('Add New Task')
);

include STAFFINC_DIR . 'templates/task.tmpl.php';
Expand Down
2 changes: 1 addition & 1 deletion include/ajax.users.php
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ function updateOrg($id, $orgId = 0) {
}

if ($org && $user->getOrgId() && $org->getId() != $user->getOrgId())
$info['warning'] = __("Are you sure you want to change user's organization?");
$info['warning'] = __("Are you sure you want to change the user's organization?");

$tmpl = $tmpl ?: 'org-lookup.tmpl.php';

Expand Down
4 changes: 2 additions & 2 deletions include/class.api.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ function save($id, $vars, &$errors) {
if(db_query($sql))
return true;

$errors['err']=sprintf(__('Unable to update %s.'), __('this API key'))
.' '.__('Internal error occurred');
$errors['err']=sprintf(__('Unable to update %s'), __('this API key'))
.' '.__('Internal error occurred');

} else {
$sql='INSERT INTO '.API_KEY_TABLE.' SET '.$sql
Expand Down
4 changes: 2 additions & 2 deletions include/class.auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ function login($staff, $bk) {
return false;

//Log debug info.
$ost->logDebug(_S('Agent login'),
$ost->logDebug(_S('Agent Login'),
sprintf(_S("%s logged in [%s], via %s"), $staff->getUserName(),
$_SERVER['REMOTE_ADDR'], get_class($bk))); //Debug.

Expand Down Expand Up @@ -948,7 +948,7 @@ function authstrike($credentials) {
_S('Time').": ".date('M j, Y, g:i a T')."\n\n".
_S('Attempts').": {$authsession['strikes']}";
$ost->logError(_S('Excessive login attempts (user)'), $alert, ($cfg->alertONLoginError()));
return new AccessDenied(__('Access Denied'));
return new AccessDenied(__('Access denied'));
} elseif($authsession['strikes']%3==0) { //Log every third failed login attempt as a warning.
$alert=_S('Username').": {$username}\n".
_S('IP').": {$_SERVER['REMOTE_ADDR']}\n".
Expand Down
Loading

0 comments on commit 6f6e418

Please sign in to comment.