diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldPHIDs.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldPHIDs.php index 216c7ccb63..855cf2b4a0 100644 --- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldPHIDs.php +++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomFieldPHIDs.php @@ -145,6 +145,46 @@ abstract class PhabricatorStandardCustomFieldPHIDs } } + public function getApplicationTransactionTitleForFeed( + PhabricatorApplicationTransaction $xaction) { + $author_phid = $xaction->getAuthorPHID(); + $object_phid = $xaction->getObjectPHID(); + + $old = $this->decodeValue($xaction->getOldValue()); + $new = $this->decodeValue($xaction->getNewValue()); + + $add = array_diff($new, $old); + $rem = array_diff($old, $new); + + if ($add && !$rem) { + return pht( + '%s updated %s for %s, added %d: %s.', + $xaction->renderHandleLink($author_phid), + $this->getFieldName(), + $xaction->renderHandleLink($object_phid), + phutil_count($add), + $xaction->renderHandleList($add)); + } else if ($rem && !$add) { + return pht( + '%s updated %s for %s, removed %s: %s.', + $xaction->renderHandleLink($author_phid), + $this->getFieldName(), + $xaction->renderHandleLink($object_phid), + phutil_count($rem), + $xaction->renderHandleList($rem)); + } else { + return pht( + '%s updated %s for %s, added %s: %s; removed %s: %s.', + $xaction->renderHandleLink($author_phid), + $this->getFieldName(), + $xaction->renderHandleLink($object_phid), + phutil_count($add), + $xaction->renderHandleList($add), + phutil_count($rem), + $xaction->renderHandleList($rem)); + } + } + public function validateApplicationTransactions( PhabricatorApplicationTransactionEditor $editor, $type, diff --git a/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php b/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php index 1648d6608d..3c23491a4f 100644 --- a/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php +++ b/src/infrastructure/internationalization/translation/PhabricatorUSEnglishTranslation.php @@ -1483,6 +1483,24 @@ final class PhabricatorUSEnglishTranslation 'repositories for updates yet.', ), + + '%s updated %s, added %d: %s.' => + '%s updated %s, added: %4$s.', + + '%s updated %s, removed %s: %s.' => + '%s updated %s, removed: %4$s.', + + '%s updated %s, added %s: %s; removed %s: %s.' => + '%s updated %s, added: %4$s; removed: %6$s.', + + '%s updated %s for %s, added %d: %s.' => + '%s updated %s for %s, added: %5$s.', + + '%s updated %s for %s, removed %s: %s.' => + '%s updated %s for %s, removed: %5$s.', + + '%s updated %s for %s, added %s: %s; removed %s: %s.' => + '%s updated %s for %s, added: %5$s; removed; %7$s.', ); }