1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 23:02:42 +01:00

PHT's on Audit and Macro

Summary:
Went through some files and pht'd some stuff while the kid was in the bath.

LINT

Test Plan: Doinked all over each of these apps, didn't spot anything out of the ordinary.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4613
This commit is contained in:
Chad Little 2013-01-23 19:36:23 -08:00
parent 3440892d7b
commit 99e7810572
9 changed files with 79 additions and 74 deletions

View file

@ -3,7 +3,7 @@
final class PhabricatorApplicationAudit extends PhabricatorApplication {
public function getShortDescription() {
return 'Audit Code';
return pht('Audit Code');
}
public function getBaseURI() {

View file

@ -6,7 +6,7 @@ abstract class PhabricatorAuditController extends PhabricatorController {
$page = $this->buildStandardPageView();
$page->setApplicationName('Audit');
$page->setApplicationName(pht('Audit'));
$page->setBaseURI('/audit/');
$page->setTitle(idx($data, 'title'));
$page->setGlyph("\xE2\x9C\x8D");

View file

@ -49,13 +49,13 @@ final class PhabricatorAuditListController extends PhabricatorAuditController {
if (!$handle) {
switch ($this->filter) {
case 'project':
$title = 'Choose A Project';
$message = 'Choose a project to view audits for.';
$title = pht('Choose A Project');
$message = pht('Choose a project to view audits for.');
break;
case 'package':
case 'packagecommits':
$title = 'Choose a Package';
$message = 'Choose a package to view audits for.';
$title = pht('Choose a Package');
$message = pht('Choose a package to view audits for.');
break;
}
}
@ -73,26 +73,26 @@ final class PhabricatorAuditListController extends PhabricatorAuditController {
return $this->buildStandardPageResponse(
$nav,
array(
'title' => 'Audits',
'title' => pht('Audits'),
));
}
private function buildNavAndSelectFilter() {
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI('/audit/view/'));
$nav->addLabel('Active');
$nav->addFilter('active', 'Need Attention');
$nav->addLabel(pht('Active'));
$nav->addFilter('active', pht('Need Attention'));
$nav->addLabel('Audits');
$nav->addFilter('audits', 'All');
$nav->addFilter('user', 'By User');
$nav->addFilter('project', 'By Project');
$nav->addFilter('package', 'By Package');
$nav->addLabel(pht('Audits'));
$nav->addFilter('audits', pht('All'));
$nav->addFilter('user', pht('By User'));
$nav->addFilter('project', pht('By Project'));
$nav->addFilter('package', pht('By Package'));
$nav->addLabel('Commits');
$nav->addFilter('commits', 'All');
$nav->addFilter('author', 'By Author');
$nav->addFilter('packagecommits', 'By Package');
$nav->addLabel(pht('Commits'));
$nav->addFilter('commits', pht('All'));
$nav->addFilter('author', pht('By Author'));
$nav->addFilter('packagecommits', pht('By Package'));
$this->filter = $nav->selectFilter($this->filter, 'active');
@ -138,13 +138,13 @@ final class PhabricatorAuditListController extends PhabricatorAuditController {
if ($show_user || $show_project || $show_package) {
if ($show_user) {
$uri = '/typeahead/common/users/';
$label = 'User';
$label = pht('User');
} else if ($show_project) {
$uri = '/typeahead/common/projects/';
$label = 'Project';
$label = pht('Project');
} else if ($show_package) {
$uri = '/typeahead/common/packages/';
$label = 'Package';
$label = pht('Package');
}
$tok_value = null;
@ -167,19 +167,19 @@ final class PhabricatorAuditListController extends PhabricatorAuditController {
$form->appendChild(
id(new AphrontFormToggleButtonsControl())
->setName('status')
->setLabel('Status')
->setLabel(pht('Status'))
->setBaseURI($request->getRequestURI(), 'status')
->setValue($this->filterStatus)
->setButtons(
array(
'all' => 'All',
'open' => 'Open',
'all' => pht('All'),
'open' => pht('Open'),
)));
}
$form->appendChild(
id(new AphrontFormSubmitControl())
->setValue('Filter Audits'));
->setValue(pht('Filter Audits')));
$view = new AphrontListFilterView();
$view->appendChild($form);
@ -342,24 +342,24 @@ final class PhabricatorAuditListController extends PhabricatorAuditController {
switch ($this->filter) {
case 'active':
$header = 'Required Audits';
$nodata = 'No commits require your audit.';
$header = pht('Required Audits');
$nodata = pht('No commits require your audit.');
break;
case 'user':
$header = "Audits for {$handle_name}";
$nodata = "No matching audits by {$handle_name}.";
$header = pht("Audits for %s", $handle_name);
$nodata = pht("No matching audits by %s.", $handle_name);
break;
case 'audits':
$header = "Audits";
$nodata = "No matching audits.";
$header = pht('Audits');
$nodata = pht('No matching audits.');
break;
case 'project':
$header = "Audits in Project '{$handle_name}'";
$nodata = "No matching audits in project '{$handle_name}'.";
$header = pht("Audits in Project %s", $handle_name);
$nodata = pht("No matching audits in project %s.", $handle_name);
break;
case 'package':
$header = "Audits for Package '{$handle_name}'";
$nodata = "No matching audits in package '{$handle_name}'.";
$header = pht("Audits for Package %s", $handle_name);
$nodata = pht("No matching audits in package %s.", $handle_name);
break;
}
@ -442,20 +442,20 @@ final class PhabricatorAuditListController extends PhabricatorAuditController {
switch ($this->filter) {
case 'active':
$header = 'Problem Commits';
$nodata = 'None of your commits have open concerns.';
$header = pht('Problem Commits');
$nodata = pht('None of your commits have open concerns.');
break;
case 'author':
$header = "Commits by {$handle_name}";
$nodata = "No matching commits by {$handle_name}.";
$header = pht("Commits by %s", $handle_name);
$nodata = pht("No matching commits by %s.", $handle_name);
break;
case 'commits':
$header = "Commits";
$nodata = "No matching commits.";
$header = pht("Commits");
$nodata = pht("No matching commits.");
break;
case 'packagecommits':
$header = "Commits in Package '{$handle_name}'";
$nodata = "No matching commits in package '{$handle_name}'.";
$header = pht("Commits in Package %s", $handle_name);
$nodata = pht("No matching commits in package %s.", $handle_name);
break;
}

View file

@ -7,7 +7,7 @@ final class PhabricatorApplicationMacro extends PhabricatorApplication {
}
public function getShortDescription() {
return 'Image Macros and Memes';
return pht('Image Macros and Memes');
}
public function getIconName() {

View file

@ -8,14 +8,18 @@ abstract class PhabricatorMacroController
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
if ($for_app) {
$nav->addLabel('Create');
$nav->addFilter('', 'Create Macro', $this->getApplicationURI('/create/'));
$nav->addLabel(pht('Create'));
$nav->addFilter('',
pht('Create Macro'),
$this->getApplicationURI('/create/'));
}
$nav->addLabel('Macros');
$nav->addFilter('/', 'All Macros');
$nav->addLabel(pht('Macros'));
$nav->addFilter('/', pht('All Macros'));
if ($has_search) {
$nav->addFilter('search', 'Search', $this->getRequest()->getRequestURI());
$nav->addFilter('search',
pht('Search'),
$this->getRequest()->getRequestURI());
}

View file

@ -42,13 +42,13 @@ final class PhabricatorMacroDisableController
$dialog = new AphrontDialogView();
$dialog
->setUser($request->getUser())
->setTitle('Really disable macro?')
->setTitle(pht('Really disable macro?'))
->appendChild(
'<p>Really disable the much-beloved image macro "'.
phutil_escape_html($macro->getName()).'"? It will be sorely missed.'.
'<p>'.pht('Really disable the much-beloved image macro %s? '.
'It will be sorely missed.', phutil_escape_html($macro->getName())).
'</p>')
->setSubmitURI($this->getApplicationURI('/disable/'.$this->id.'/'))
->addSubmitButton('Disable')
->addSubmitButton(pht('Disable'))
->addCancelButton($view_uri);
return id(new AphrontDialogResponse())->setDialog($dialog);

View file

@ -37,13 +37,13 @@ final class PhabricatorMacroEditController
$macro->setName($new_name);
if (!strlen($macro->getName())) {
$errors[] = 'Macro name is required.';
$e_name = 'Required';
$errors[] = pht('Macro name is required.');
$e_name = pht('Required');
} else if (!preg_match('/^[a-z0-9_-]{3,}$/', $macro->getName())) {
$errors[] = 'Macro must be at least three characters long and '.
$errors[] = pht('Macro must be at least three characters long and '.
'contain only lowercase letters, digits, hyphen and '.
'underscore.';
$e_name = 'Invalid';
'underscore.');
$e_name = pht('Invalid');
} else {
$e_name = null;
}
@ -74,7 +74,7 @@ final class PhabricatorMacroEditController
}
if (!$macro->getID() && !$file) {
$errors[] = 'You must upload an image to create a macro.';
$errors[] = pht('You must upload an image to create a macro.');
$e_file = pht('Required');
}
@ -110,15 +110,15 @@ final class PhabricatorMacroEditController
return id(new AphrontRedirectResponse())->setURI($view_uri);
} catch (AphrontQueryDuplicateKeyException $ex) {
throw $ex;
$errors[] = 'Macro name is not unique!';
$e_name = 'Duplicate';
$errors[] = pht('Macro name is not unique!');
$e_name = pht('Duplicate');
}
}
}
if ($errors) {
$error_view = new AphrontErrorView();
$error_view->setTitle('Form Errors');
$error_view->setTitle(pht('Form Errors'));
$error_view->setErrors($errors);
} else {
$error_view = null;
@ -141,10 +141,11 @@ final class PhabricatorMacroEditController
->setEncType('multipart/form-data')
->appendChild(
id(new AphrontFormTextControl())
->setLabel('Name')
->setLabel(pht('Name'))
->setName('name')
->setValue($macro->getName())
->setCaption('This word or phrase will be replaced with the image.')
->setCaption(
pht('This word or phrase will be replaced with the image.'))
->setError($e_name));
if (!$macro->getID()) {
@ -158,7 +159,7 @@ final class PhabricatorMacroEditController
$form->addHiddenInput('phid', $current_file->getPHID());
$form->appendChild(
id(new AphrontFormMarkupControl())
->setLabel('Selected File')
->setLabel(pht('Selected File'))
->setValue($current_file_view));
$other_label = pht('Change File');
@ -223,11 +224,11 @@ final class PhabricatorMacroEditController
->setUser($request->getUser())
->appendChild(
id(new AphrontFormFileControl())
->setLabel('File')
->setLabel(pht('File'))
->setName('file'))
->appendChild(
id(new AphrontFormSubmitControl())
->setValue('Upload File'));
->setValue(pht('Upload File')));
$upload = array($upload_header, $upload_form);
}

View file

@ -90,7 +90,7 @@ final class PhabricatorMacroListController
->appendChild(
id(new AphrontFormTextControl())
->setName('name')
->setLabel('Name')
->setLabel(pht('Name'))
->setValue($filter))
->appendChild(
id(new AphrontFormTokenizerControl())
@ -100,7 +100,7 @@ final class PhabricatorMacroListController
->setValue(mpull($author_handles, 'getFullName')))
->appendChild(
id(new AphrontFormSubmitControl())
->setValue('Filter Image Macros'));
->setValue(pht('Filter Image Macros')));
$filter_view = new AphrontListFilterView();
$filter_view->appendChild($filter_form);
@ -132,7 +132,7 @@ final class PhabricatorMacroListController
phutil_render_tag(
'div',
array(),
'Created on '.$datetime));
pht('Created on %s', $datetime)));
}
$item->setURI($this->getApplicationURI('/view/'.$macro->getID().'/'));
$item->setHeader($macro->getName());
@ -159,7 +159,7 @@ final class PhabricatorMacroListController
$nav,
array(
'device' => true,
'title' => 'Image Macros',
'title' => pht('Image Macros'),
));
}
}

View file

@ -112,21 +112,21 @@ final class PhabricatorMacroViewController
$view->setObject($macro);
$view->addAction(
id(new PhabricatorActionView())
->setName('Edit Macro')
->setName(pht('Edit Macro'))
->setHref($this->getApplicationURI('/edit/'.$macro->getID().'/'))
->setIcon('edit'));
if ($macro->getIsDisabled()) {
$view->addAction(
id(new PhabricatorActionView())
->setName('Restore Macro')
->setName(pht('Restore Macro'))
->setHref($this->getApplicationURI('/disable/'.$macro->getID().'/'))
->setWorkflow(true)
->setIcon('undo'));
} else {
$view->addAction(
id(new PhabricatorActionView())
->setName('Disable Macro')
->setName(pht('Disable Macro'))
->setHref($this->getApplicationURI('/disable/'.$macro->getID().'/'))
->setWorkflow(true)
->setIcon('delete'));