From 5dc48c2b4ad932b600677f939fd137d829a74722 Mon Sep 17 00:00:00 2001
From: Chad Little
Date: Mon, 28 Jan 2013 10:48:01 -0800
Subject: [PATCH] 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.').'
');
}
$phdlink_href = PhabricatorEnv::getDoclink(
@@ -91,49 +92,49 @@ final class PhabricatorMetaMTASendController
->appendChild($instructions)
->appendChild(
id(new AphrontFormStaticControl())
- ->setLabel('Adapter')
+ ->setLabel(pht('Adapter'))
->setValue($adapter))
->appendChild(
id(new AphrontFormTokenizerControl())
- ->setLabel('To')
+ ->setLabel(pht('To'))
->setName('to')
->setDatasource('/typeahead/common/mailable/'))
->appendChild(
id(new AphrontFormTokenizerControl())
- ->setLabel('CC')
+ ->setLabel(pht('CC'))
->setName('cc')
->setDatasource('/typeahead/common/mailable/'))
->appendChild(
id(new AphrontFormTextControl())
- ->setLabel('Subject')
+ ->setLabel(pht('Subject'))
->setName('subject'))
->appendChild(
id(new AphrontFormTextAreaControl())
- ->setLabel('Body')
+ ->setLabel(pht('Body'))
->setName('body'))
->appendChild(
id(new AphrontFormTextControl())
- ->setLabel('Mail Tags')
+ ->setLabel(pht('Mail Tags'))
->setName('mailtags')
->setCaption(
- 'Example: differential-cc, differential-comment'))
+ pht('Example:').' differential-cc, differential-comment'))
->appendChild(
id(new AphrontFormDragAndDropUploadControl())
- ->setLabel('Attach Files')
+ ->setLabel(pht('Attach Files'))
->setName('files')
->setActivatedClass('aphront-panel-view-drag-and-drop'))
->appendChild(
id(new AphrontFormTextControl())
- ->setLabel('Simulate Failures')
+ ->setLabel(pht('Simulate Failures'))
->setName('failures')
->setCaption($failure_caption))
->appendChild(
id(new AphrontFormCheckboxControl())
- ->setLabel('HTML')
+ ->setLabel(pht('HTML'))
->addCheckbox('html', '1', 'Send as HTML email.'))
->appendChild(
id(new AphrontFormCheckboxControl())
- ->setLabel('Bulk')
+ ->setLabel(pht('Bulk'))
->addCheckbox('bulk', '1', 'Send with bulk email headers.'))
->appendChild(
id(new AphrontFormCheckboxControl())
@@ -141,18 +142,18 @@ final class PhabricatorMetaMTASendController
->addCheckbox(
'immediately',
'1',
- 'Send immediately. (Do not enqueue for daemons.)',
+ pht('Send immediately. (Do not enqueue for daemons.)'),
PhabricatorEnv::getEnvConfig('metamta.send-immediately'))
- ->setCaption('Daemons can be started with '.$phdlink.'.')
+ ->setCaption(pht('Daemons can be started with %s.', $phdlink))
)
->appendChild(
id(new AphrontFormSubmitControl())
- ->setValue('Send Mail'));
+ ->setValue(pht('Send Mail')));
$panel = new AphrontPanelView();
- $panel->setHeader('Send Email');
+ $panel->setHeader(pht('Send Email'));
$panel->appendChild($form);
- $panel->setWidth(AphrontPanelView::WIDTH_FORM);
+ $panel->setNoBackground();
$nav = $this->buildSideNavView();
$nav->selectFilter('send');
@@ -165,7 +166,8 @@ final class PhabricatorMetaMTASendController
return $this->buildApplicationPage(
$nav,
array(
- 'title' => 'Send Test',
+ 'title' => pht('Send Test'),
+ 'device' => true,
));
}
diff --git a/src/applications/metamta/controller/PhabricatorMetaMTASendGridReceiveController.php b/src/applications/metamta/controller/PhabricatorMetaMTASendGridReceiveController.php
index fbd86a2871..ae75b348c2 100644
--- a/src/applications/metamta/controller/PhabricatorMetaMTASendGridReceiveController.php
+++ b/src/applications/metamta/controller/PhabricatorMetaMTASendGridReceiveController.php
@@ -61,7 +61,7 @@ final class PhabricatorMetaMTASendGridReceiveController
$received->processReceivedMail();
$response = new AphrontWebpageResponse();
- $response->setContent("Got it! Thanks, SendGrid!\n");
+ $response->setContent(pht("Got it! Thanks, SendGrid!\n"));
return $response;
}
diff --git a/src/applications/metamta/controller/PhabricatorMetaMTAViewController.php b/src/applications/metamta/controller/PhabricatorMetaMTAViewController.php
index dd15b099e1..537678c381 100644
--- a/src/applications/metamta/controller/PhabricatorMetaMTAViewController.php
+++ b/src/applications/metamta/controller/PhabricatorMetaMTAViewController.php
@@ -26,41 +26,43 @@ final class PhabricatorMetaMTAViewController
$form
->appendChild(
id(new AphrontFormStaticControl())
- ->setLabel('Subject')
+ ->setLabel(pht('Subject'))
->setValue($mail->getSubject()))
->appendChild(
id(new AphrontFormStaticControl())
- ->setLabel('Created')
+ ->setLabel(pht('Created'))
->setValue(phabricator_datetime($mail->getDateCreated(), $user)))
->appendChild(
id(new AphrontFormStaticControl())
- ->setLabel('Status')
+ ->setLabel(pht('Status'))
->setValue($status))
->appendChild(
id(new AphrontFormStaticControl())
- ->setLabel('Retry Count')
+ ->setLabel(pht('Retry Count'))
->setValue($mail->getRetryCount()))
->appendChild(
id(new AphrontFormStaticControl())
- ->setLabel('Message')
+ ->setLabel(pht('Message'))
->setValue($mail->getMessage()))
->appendChild(
id(new AphrontFormStaticControl())
- ->setLabel('Related PHID')
+ ->setLabel(pht('Related PHID'))
->setValue($mail->getRelatedPHID()))
->appendChild(
id(new AphrontFormSubmitControl())
- ->addCancelButton($this->getApplicationURI(), 'Done'));
+ ->addCancelButton($this->getApplicationURI(), pht('Done')));
$panel = new AphrontPanelView();
- $panel->setHeader('View Email');
+ $panel->setHeader(pht('View Email'));
$panel->appendChild($form);
$panel->setWidth(AphrontPanelView::WIDTH_WIDE);
+ $panel->setNoBackground();
return $this->buildApplicationPage(
$panel,
array(
- 'title' => 'View Mail',
+ 'title' => pht('View Mail'),
+ 'device' => true,
));
}