1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

pht for Daemons.

Summary: Scan Daemons app for pht and fix a form or two.

Test Plan: Used Daemons app as much as I could, check all caps language.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5133
This commit is contained in:
Chad Little 2013-02-26 19:51:36 -08:00
parent 82e41e7fa1
commit f01213b089
8 changed files with 46 additions and 43 deletions

View file

@ -3,11 +3,11 @@
final class PhabricatorApplicationDaemons extends PhabricatorApplication { final class PhabricatorApplicationDaemons extends PhabricatorApplication {
public function getName() { public function getName() {
return 'Daemons'; return pht('Daemons');
} }
public function getShortDescription() { public function getShortDescription() {
return 'Manage Daemons'; return pht('Manage Daemons');
} }
public function getBaseURI() { public function getBaseURI() {

View file

@ -37,7 +37,7 @@ final class PhabricatorDaemonCombinedLogController
return $this->buildApplicationPage( return $this->buildApplicationPage(
$nav, $nav,
array( array(
'title' => 'Combined Daemon Log', 'title' => pht('Combined Daemon Log'),
)); ));
} }

View file

@ -66,7 +66,7 @@ final class PhabricatorDaemonConsoleController
$daemon_table->setDaemonLogs($logs); $daemon_table->setDaemonLogs($logs);
$daemon_panel = new AphrontPanelView(); $daemon_panel = new AphrontPanelView();
$daemon_panel->setHeader('Active Daemons'); $daemon_panel->setHeader(pht('Active Daemons'));
$daemon_panel->appendChild($daemon_table); $daemon_panel->appendChild($daemon_table);
$daemon_panel->setNoBackground(); $daemon_panel->setNoBackground();
@ -87,18 +87,18 @@ final class PhabricatorDaemonConsoleController
'href' => '/daemon/task/'.$task->getID().'/', 'href' => '/daemon/task/'.$task->getID().'/',
'class' => 'button small grey', 'class' => 'button small grey',
), ),
'View Task'), pht('View Task')),
); );
} }
$leased_table = new AphrontTableView($rows); $leased_table = new AphrontTableView($rows);
$leased_table->setHeaders( $leased_table->setHeaders(
array( array(
'ID', pht('ID'),
'Class', pht('Class'),
'Owner', pht('Owner'),
'Expires', pht('Expires'),
'Failures', pht('Failures'),
'', '',
)); ));
$leased_table->setColumnClasses( $leased_table->setColumnClasses(
@ -110,7 +110,7 @@ final class PhabricatorDaemonConsoleController
'n', 'n',
'action', 'action',
)); ));
$leased_table->setNoDataString('No tasks are leased by workers.'); $leased_table->setNoDataString(pht('No tasks are leased by workers.'));
$leased_panel = new AphrontPanelView(); $leased_panel = new AphrontPanelView();
$leased_panel->setHeader('Leased Tasks'); $leased_panel->setHeader('Leased Tasks');
@ -135,18 +135,18 @@ final class PhabricatorDaemonConsoleController
$queued_table = new AphrontTableView($rows); $queued_table = new AphrontTableView($rows);
$queued_table->setHeaders( $queued_table->setHeaders(
array( array(
'Class', pht('Class'),
'Count', pht('Count'),
)); ));
$queued_table->setColumnClasses( $queued_table->setColumnClasses(
array( array(
'wide', 'wide',
'n', 'n',
)); ));
$queued_table->setNoDataString('Task queue is empty.'); $queued_table->setNoDataString(pht('Task queue is empty.'));
$queued_panel = new AphrontPanelView(); $queued_panel = new AphrontPanelView();
$queued_panel->setHeader('Queued Tasks'); $queued_panel->setHeader(pht('Queued Tasks'));
$queued_panel->appendChild($queued_table); $queued_panel->appendChild($queued_table);
$queued_panel->setNoBackground(); $queued_panel->setNoBackground();
@ -163,7 +163,7 @@ final class PhabricatorDaemonConsoleController
return $this->buildApplicationPage( return $this->buildApplicationPage(
$nav, $nav,
array( array(
'title' => 'Console', 'title' => pht('Console'),
)); ));
} }

View file

@ -6,10 +6,10 @@ abstract class PhabricatorDaemonController extends PhabricatorController {
$nav = new AphrontSideNavFilterView(); $nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI())); $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
$nav->addLabel('Daemons'); $nav->addLabel(pht('Daemons'));
$nav->addFilter('/', 'Console'); $nav->addFilter('/', pht('Console'));
$nav->addFilter('log', 'All Daemons'); $nav->addFilter('log', pht('All Daemons'));
$nav->addFilter('log/combined', 'Combined Log'); $nav->addFilter('log/combined', pht('Combined Log'));
return $nav; return $nav;
} }

View file

@ -25,7 +25,7 @@ final class PhabricatorDaemonLogListController
$daemon_table->setDaemonLogs($logs); $daemon_table->setDaemonLogs($logs);
$daemon_panel = new AphrontPanelView(); $daemon_panel = new AphrontPanelView();
$daemon_panel->setHeader('All Daemons'); $daemon_panel->setHeader(pht('All Daemons'));
$daemon_panel->appendChild($daemon_table); $daemon_panel->appendChild($daemon_table);
$daemon_panel->appendChild($pager); $daemon_panel->appendChild($pager);
$daemon_panel->setNoBackground(); $daemon_panel->setNoBackground();
@ -37,7 +37,7 @@ final class PhabricatorDaemonLogListController
return $this->buildApplicationPage( return $this->buildApplicationPage(
$nav, $nav,
array( array(
'title' => 'All Daemons', 'title' => pht('All Daemons'),
)); ));
} }

View file

@ -33,29 +33,29 @@ final class PhabricatorDaemonLogViewController
->setUser($user) ->setUser($user)
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('Daemon') ->setLabel(pht('Daemon'))
->setValue($log->getDaemon())) ->setValue($log->getDaemon()))
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('Host') ->setLabel(pht('Host'))
->setValue($log->getHost())) ->setValue($log->getHost()))
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('PID') ->setLabel(pht('PID'))
->setValue($log->getPID())) ->setValue($log->getPID()))
->appendChild( ->appendChild(
id(new AphrontFormStaticControl()) id(new AphrontFormStaticControl())
->setLabel('Started') ->setLabel(pht('Started'))
->setValue( ->setValue(
phabricator_datetime($log->getDateCreated(), $user))) phabricator_datetime($log->getDateCreated(), $user)))
->appendChild( ->appendChild(
id(new AphrontFormTextAreaControl()) id(new AphrontFormTextAreaControl())
->setLabel('Argv') ->setLabel(pht('Argv'))
->setValue($argv)); ->setValue($argv));
$panel = new AphrontPanelView(); $panel = new AphrontPanelView();
$panel->setHeader('Daemon Details'); $panel->setHeader(pht('Daemon Details'));
$panel->setWidth(AphrontPanelView::WIDTH_FORM); $panel->setNoBackground();
$panel->appendChild($form); $panel->appendChild($form);
$content[] = $panel; $content[] = $panel;
@ -65,7 +65,8 @@ final class PhabricatorDaemonLogViewController
$event_view->setEvents($events); $event_view->setEvents($events);
$log_panel = new AphrontPanelView(); $log_panel = new AphrontPanelView();
$log_panel->setHeader('Daemon Logs'); $log_panel->setHeader(pht('Daemon Logs'));
$log_panel->setNoBackground();
$log_panel->appendChild($event_view); $log_panel->appendChild($event_view);
$content[] = $log_panel; $content[] = $log_panel;
@ -77,7 +78,7 @@ final class PhabricatorDaemonLogViewController
return $this->buildApplicationPage( return $this->buildApplicationPage(
$nav, $nav,
array( array(
'title' => 'Daemon Log', 'title' => pht('Daemon Log'),
)); ));
} }

View file

@ -22,19 +22,21 @@ final class PhabricatorWorkerTaskDetailController
$title = pht('Task Does Not Exist'); $title = pht('Task Does Not Exist');
$error_view = new AphrontErrorView(); $error_view = new AphrontErrorView();
$error_view->setTitle('No Such Task'); $error_view->setTitle(pht('No Such Task'));
$error_view->appendChild(phutil_tag( $error_view->appendChild(phutil_tag(
'p', 'p',
array(), array(),
'This task may have recently been garbage collected.')); pht('This task may have recently been garbage collected.')));
$error_view->setSeverity(AphrontErrorView::SEVERITY_NODATA); $error_view->setSeverity(AphrontErrorView::SEVERITY_NODATA);
$content = $error_view; $content = $error_view;
} else { } else {
$title = 'Task '.$task->getID(); $title = pht('Task %d', $task->getID());
$header = id(new PhabricatorHeaderView()) $header = id(new PhabricatorHeaderView())
->setHeader('Task '.$task->getID().' ('.$task->getTaskClass().')'); ->setHeader(pht('Task %d (%s)',
$task->getID(),
$task->getTaskClass()));
$actions = $this->buildActionListView($task); $actions = $this->buildActionListView($task);
$properties = $this->buildPropertyListView($task); $properties = $this->buildPropertyListView($task);

View file

@ -71,39 +71,39 @@ final class PhabricatorWorkerTaskUpdateController
switch ($this->action) { switch ($this->action) {
case 'retry': case 'retry':
if ($can_retry) { if ($can_retry) {
$dialog->setTitle('Really retry task?'); $dialog->setTitle(pht('Really retry task?'));
$dialog->appendChild(phutil_tag('p', array(), pht( $dialog->appendChild(phutil_tag('p', array(), pht(
'The task will be put back in the queue and executed again.'))); 'The task will be put back in the queue and executed again.')));
$dialog->addSubmitButton('Retry Task'); $dialog->addSubmitButton('Retry Task');
} else { } else {
$dialog->setTitle('Can Not Retry'); $dialog->setTitle(pht('Can Not Retry'));
$dialog->appendChild(phutil_tag('p', array(), pht( $dialog->appendChild(phutil_tag('p', array(), pht(
'Only archived, unsuccessful tasks can be retried.'))); 'Only archived, unsuccessful tasks can be retried.')));
} }
break; break;
case 'cancel': case 'cancel':
if ($can_cancel) { if ($can_cancel) {
$dialog->setTitle('Really cancel task?'); $dialog->setTitle(pht('Really cancel task?'));
$dialog->appendChild(phutil_tag('p', array(), pht( $dialog->appendChild(phutil_tag('p', array(), pht(
'The work this task represents will never be performed if you '. 'The work this task represents will never be performed if you '.
'cancel it. Are you sure you want to cancel it?'))); 'cancel it. Are you sure you want to cancel it?')));
$dialog->addSubmitButton('Cancel Task'); $dialog->addSubmitButton(pht('Cancel Task'));
} else { } else {
$dialog->setTitle('Can Not Cancel'); $dialog->setTitle(pht('Cannot Cancel'));
$dialog->appendChild(phutil_tag('p', array(), pht( $dialog->appendChild(phutil_tag('p', array(), pht(
'Only active tasks can be cancelled.'))); 'Only active tasks can be cancelled.')));
} }
break; break;
case 'release': case 'release':
if ($can_release) { if ($can_release) {
$dialog->setTitle('Really free task lease?'); $dialog->setTitle(pht('Really free task lease?'));
$dialog->appendChild(phutil_tag('p', array(), pht( $dialog->appendChild(phutil_tag('p', array(), pht(
'If the process which owns the task lease is still doing work '. 'If the process which owns the task lease is still doing work '.
'on it, the work may be performed twice. Are you sure you '. 'on it, the work may be performed twice. Are you sure you '.
'want to free the lease?'))); 'want to free the lease?')));
$dialog->addSubmitButton('Free Lease'); $dialog->addSubmitButton(pht('Free Lease'));
} else { } else {
$dialog->setTitle('Can Not Free Lease'); $dialog->setTitle(pht('Cannot Free Lease'));
$dialog->appendChild(phutil_tag('p', array(), pht( $dialog->appendChild(phutil_tag('p', array(), pht(
'Only active, leased tasks may have their leases freed.'))); 'Only active, leased tasks may have their leases freed.')));
} }