1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-21 04:50:55 +01:00

Fix Phriction email language

Summary: This adds pht's and such english to Phriction email body.

Test Plan: Edited a Document, Moved a Document. Got new emails. Such Wow.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D7477
This commit is contained in:
Chad Little 2013-11-02 08:43:53 -07:00
parent cd674931fc
commit 7498aec194

View file

@ -286,6 +286,22 @@ final class PhrictionDocumentEditor extends PhabricatorEditor {
return $this; return $this;
} }
private function getChangeTypeDescription($const, $title) {
$map = array(
PhrictionChangeType::CHANGE_EDIT =>
pht("Phriction Document %s was edited.", $title),
PhrictionChangeType::CHANGE_DELETE =>
pht("Phriction Document %s was deleted.", $title),
PhrictionChangeType::CHANGE_MOVE_HERE =>
pht("Phriction Document %s was moved here.", $title),
PhrictionChangeType::CHANGE_MOVE_AWAY =>
pht("Phriction Document %s was moved away.", $title),
PhrictionChangeType::CHANGE_STUB =>
pht("Phriction Document %s was created through child.", $title),
);
return idx($map, $const, pht('Something magical occurred.'));
}
private function sendMailToSubscribers(array $subscribers, $old_content) { private function sendMailToSubscribers(array $subscribers, $old_content) {
if (!$subscribers) { if (!$subscribers) {
return; return;
@ -304,14 +320,9 @@ final class PhrictionDocumentEditor extends PhabricatorEditor {
$old_title = $old_content->getTitle(); $old_title = $old_content->getTitle();
$title = $content->getTitle(); $title = $content->getTitle();
$name = $this->getChangeTypeDescription($content->getChangeType(), $title);
// TODO: Currently, this produces something like
// Phriction Document Xyz was Edit
// I'm too lazy to build my own action string everywhere
// Plus, it does not have pht() anyway
$action = PhrictionChangeType::getChangeTypeLabel( $action = PhrictionChangeType::getChangeTypeLabel(
$content->getChangeType()); $content->getChangeType());
$name = pht("Phriction Document %s was %s", $title, $action);
$body = array($name); $body = array($name);
// Content may have changed, you never know // Content may have changed, you never know