Date: Mon, 28 Jan 2013 10:48:01 -0800
Subject: [PATCH 03/17] pht, panels and mobile for metamta
Summary: Added phts, tested forms on mobile.
Test Plan: Review each page in Chrome and iOS.
Reviewers: epriestley, btrahan
Reviewed By: epriestley
CC: aran, Korvin
Differential Revision: https://secure.phabricator.com/D4702
---
...rentialBlameRevisionFieldSpecification.php | 7 +--
.../PhabricatorApplicationMetaMTA.php | 2 +-
.../PhabricatorMetaMTAController.php | 12 ++---
.../PhabricatorMetaMTAListController.php | 20 +++----
.../PhabricatorMetaMTAReceiveController.php | 22 ++++----
...abricatorMetaMTAReceivedListController.php | 18 ++++---
.../PhabricatorMetaMTASendController.php | 52 ++++++++++---------
...icatorMetaMTASendGridReceiveController.php | 2 +-
.../PhabricatorMetaMTAViewController.php | 20 +++----
9 files changed, 83 insertions(+), 72 deletions(-)
diff --git a/src/applications/differential/field/specification/DifferentialBlameRevisionFieldSpecification.php b/src/applications/differential/field/specification/DifferentialBlameRevisionFieldSpecification.php
index 27573da141..a246aa1a31 100644
--- a/src/applications/differential/field/specification/DifferentialBlameRevisionFieldSpecification.php
+++ b/src/applications/differential/field/specification/DifferentialBlameRevisionFieldSpecification.php
@@ -29,8 +29,9 @@ final class DifferentialBlameRevisionFieldSpecification
public function renderEditControl() {
return id(new AphrontFormTextControl())
- ->setLabel('Blame Revision')
- ->setCaption('Revision which broke the stuff which this change fixes.')
+ ->setLabel(pht('Blame Revision'))
+ ->setCaption(
+ pht('Revision which broke the stuff which this change fixes.'))
->setName($this->getStorageKey())
->setValue($this->value);
}
@@ -40,7 +41,7 @@ final class DifferentialBlameRevisionFieldSpecification
}
public function renderLabelForRevisionView() {
- return 'Blame Revision:';
+ return pht('Blame Revision:');
}
public function renderValueForRevisionView() {
diff --git a/src/applications/metamta/application/PhabricatorApplicationMetaMTA.php b/src/applications/metamta/application/PhabricatorApplicationMetaMTA.php
index 9c8acf9863..6aed7502c8 100644
--- a/src/applications/metamta/application/PhabricatorApplicationMetaMTA.php
+++ b/src/applications/metamta/application/PhabricatorApplicationMetaMTA.php
@@ -7,7 +7,7 @@ final class PhabricatorApplicationMetaMTA extends PhabricatorApplication {
}
public function getShortDescription() {
- return 'View Mail Logs';
+ return pht('View Mail Logs');
}
public function getIconName() {
diff --git a/src/applications/metamta/controller/PhabricatorMetaMTAController.php b/src/applications/metamta/controller/PhabricatorMetaMTAController.php
index 1978cdaa1a..48acdf86ce 100644
--- a/src/applications/metamta/controller/PhabricatorMetaMTAController.php
+++ b/src/applications/metamta/controller/PhabricatorMetaMTAController.php
@@ -10,14 +10,14 @@ abstract class PhabricatorMetaMTAController extends PhabricatorController {
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
- $nav->addLabel('Mail Logs');
- $nav->addFilter('sent', 'Sent Mail', $this->getApplicationURI());
- $nav->addFilter('received', 'Received Mail');
+ $nav->addLabel(pht('Mail Logs'));
+ $nav->addFilter('sent', pht('Sent Mail'), $this->getApplicationURI());
+ $nav->addFilter('received', pht('Received Mail'));
if ($this->getRequest()->getUser()->getIsAdmin()) {
- $nav->addLabel('Diagnostics');
- $nav->addFilter('send', 'Send Test');
- $nav->addFilter('receive', 'Receive Test');
+ $nav->addLabel(pht('Diagnostics'));
+ $nav->addFilter('send', pht('Send Test'));
+ $nav->addFilter('receive', pht('Receive Test'));
}
return $nav;
diff --git a/src/applications/metamta/controller/PhabricatorMetaMTAListController.php b/src/applications/metamta/controller/PhabricatorMetaMTAListController.php
index bcd6897ea0..4f840f03c1 100644
--- a/src/applications/metamta/controller/PhabricatorMetaMTAListController.php
+++ b/src/applications/metamta/controller/PhabricatorMetaMTAListController.php
@@ -74,19 +74,19 @@ final class PhabricatorMetaMTAListController
'class' => 'button small grey',
'href' => $this->getApplicationURI('/view/'.$mail->getID().'/'),
),
- 'View'),
+ pht('View')),
);
}
$table = new AphrontTableView($rows);
$table->setHeaders(
array(
- 'Status',
- 'Retry',
- 'Next',
- 'Created',
- 'Updated',
- 'Subject',
+ pht('Status'),
+ pht('Retry'),
+ pht('Next'),
+ pht('Created'),
+ pht('Updated'),
+ pht('Subject'),
'',
));
$table->setColumnClasses(
@@ -103,8 +103,9 @@ final class PhabricatorMetaMTAListController
// Render the whole page.
$panel = new AphrontPanelView();
$panel->appendChild($table);
- $panel->setHeader('MetaMTA Messages');
+ $panel->setHeader(pht('MetaMTA Messages'));
$panel->appendChild($pager);
+ $panel->setNoBackground();
$nav = $this->buildSideNavView();
$nav->selectFilter('sent');
@@ -113,7 +114,8 @@ final class PhabricatorMetaMTAListController
return $this->buildApplicationPage(
$nav,
array(
- 'title' => 'Sent Mail',
+ 'title' => pht('Sent Mail'),
+ 'device' => true,
));
}
}
diff --git a/src/applications/metamta/controller/PhabricatorMetaMTAReceiveController.php b/src/applications/metamta/controller/PhabricatorMetaMTAReceiveController.php
index 2ae211e2ad..2d4591408c 100644
--- a/src/applications/metamta/controller/PhabricatorMetaMTAReceiveController.php
+++ b/src/applications/metamta/controller/PhabricatorMetaMTAReceiveController.php
@@ -12,7 +12,7 @@ final class PhabricatorMetaMTAReceiveController
$receiver = PhabricatorMetaMTAReceivedMail::loadReceiverObject(
$request->getStr('obj'));
if (!$receiver) {
- throw new Exception("No such task or revision!");
+ throw new Exception(pht("No such task or revision!"));
}
$hash = PhabricatorMetaMTAReceivedMail::computeMailHash(
@@ -50,25 +50,26 @@ final class PhabricatorMetaMTAReceiveController
$form->setAction($this->getApplicationURI('/receive/'));
$form
->appendChild(
- 'This form will simulate '.
- 'sending mail to an object.
')
+ ''.
+ pht('This form will simulate sending mail to an object.').
+ '
')
->appendChild(
id(new AphrontFormTextControl())
- ->setLabel('To')
+ ->setLabel(pht('To'))
->setName('obj')
- ->setCaption('e.g. D1234 or T1234'))
+ ->setCaption(pht('e.g. D1234 or T1234')))
->appendChild(
id(new AphrontFormTextAreaControl())
- ->setLabel('Body')
+ ->setLabel(pht('Body'))
->setName('body'))
->appendChild(
id(new AphrontFormSubmitControl())
- ->setValue('Receive Mail'));
+ ->setValue(pht('Receive Mail')));
$panel = new AphrontPanelView();
- $panel->setHeader('Receive Email');
+ $panel->setHeader(pht('Receive Email'));
$panel->appendChild($form);
- $panel->setWidth(AphrontPanelView::WIDTH_FORM);
+ $panel->setNoBackground();
$nav = $this->buildSideNavView();
$nav->selectFilter('receive');
@@ -77,7 +78,8 @@ final class PhabricatorMetaMTAReceiveController
return $this->buildApplicationPage(
$nav,
array(
- 'title' => 'Receive Test',
+ 'title' => pht('Receive Test'),
+ 'device' => true,
));
}
diff --git a/src/applications/metamta/controller/PhabricatorMetaMTAReceivedListController.php b/src/applications/metamta/controller/PhabricatorMetaMTAReceivedListController.php
index 926bfb0be4..d55f4b7174 100644
--- a/src/applications/metamta/controller/PhabricatorMetaMTAReceivedListController.php
+++ b/src/applications/metamta/controller/PhabricatorMetaMTAReceivedListController.php
@@ -45,12 +45,12 @@ final class PhabricatorMetaMTAReceivedListController
$table = new AphrontTableView($rows);
$table->setHeaders(
array(
- 'ID',
- 'Date',
- 'Time',
- 'Author',
- 'Object',
- 'Message',
+ pht('ID'),
+ pht('Date'),
+ pht('Time'),
+ pht('Author'),
+ pht('Object'),
+ pht('Message'),
));
$table->setColumnClasses(
array(
@@ -63,9 +63,10 @@ final class PhabricatorMetaMTAReceivedListController
));
$panel = new AphrontPanelView();
- $panel->setHeader('Received Mail');
+ $panel->setHeader(pht('Received Mail'));
$panel->appendChild($table);
$panel->appendChild($pager);
+ $panel->setNoBackground();
$nav = $this->buildSideNavView();
$nav->selectFilter('received');
@@ -74,7 +75,8 @@ final class PhabricatorMetaMTAReceivedListController
return $this->buildApplicationPage(
$nav,
array(
- 'title' => 'Received Mail',
+ 'title' => pht('Received Mail'),
+ 'device' => true,
));
}
}
diff --git a/src/applications/metamta/controller/PhabricatorMetaMTASendController.php b/src/applications/metamta/controller/PhabricatorMetaMTASendController.php
index ae3b1afc68..d79685df3b 100644
--- a/src/applications/metamta/controller/PhabricatorMetaMTASendController.php
+++ b/src/applications/metamta/controller/PhabricatorMetaMTASendController.php
@@ -42,8 +42,8 @@ final class PhabricatorMetaMTASendController
}
$failure_caption =
- "Enter a number to simulate that many consecutive send failures before ".
- "really attempting to deliver via the underlying MTA.";
+ pht("Enter a number to simulate that many consecutive send failures ".
+ "brefore really attempting to deliver via the underlying MTA.");
$doclink_href = PhabricatorEnv::getDoclink(
'article/Configuring_Outbound_Email.html');
@@ -54,11 +54,12 @@ final class PhabricatorMetaMTASendController
'href' => $doclink_href,
'target' => '_blank',
),
- 'Configuring Outbound Email');
+ pht('Configuring Outbound Email'));
$instructions =
- 'This form will send a normal '.
- 'email using the settings you have configured for Phabricator. For more '.
- 'information, see '.$doclink.'.
';
+ ''.
+ pht('This form will send a normal email using the settings you have '.
+ 'configured for Phabricator. For more information, see %s.', $doclink).
+ '
';
$adapter = PhabricatorEnv::getEnvConfig('metamta.mail-adapter');
$warning = null;
@@ -67,11 +68,11 @@ final class PhabricatorMetaMTASendController
$warning->setTitle('Email is Disabled');
$warning->setSeverity(AphrontErrorView::SEVERITY_WARNING);
$warning->appendChild(
- 'This installation of Phabricator is currently set to use '.
+ '
'.pht('This installation of Phabricator is currently set to use '.
'PhabricatorMailImplementationTestAdapter to deliver '.
'outbound email. This completely disables outbound email! All '.
'outbound email will be thrown in a deep, dark hole until you '.
- 'configure a real adapter.
');
+ 'configure a real adapter.').'