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

More Differential PHT

Summary: I think I've gotten like 95% of Differential now. Some outliers that need rethinking.

Test Plan: Bring up a new diff, edit a diff, search and sort diffs.

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4623
This commit is contained in:
Chad Little 2013-01-24 13:18:44 -08:00
parent 4b43a47f01
commit 52104a4b54
15 changed files with 76 additions and 70 deletions

View file

@ -46,7 +46,7 @@ class DifferentialReplyHandler extends PhabricatorMailReplyHandler {
$comment_command_printed = false;
if (in_array(DifferentialAction::ACTION_COMMENT, $supported_commands)) {
$text .= 'Reply to comment';
$text .= pht('Reply to comment');
$comment_command_printed = true;
$supported_commands = array_diff(

View file

@ -285,9 +285,9 @@ abstract class DifferentialChangesetHTMLRenderer
return
'<table class="differential-property-table">'.
'<tr class="property-table-header">'.
'<th>Property Changes</th>'.
'<td class="oval">Old Value</td>'.
'<td class="nval">New Value</td>'.
'<th>'.pht('Property Changes').'</th>'.
'<td class="oval">'.pht('Old Value').'</td>'.
'<td class="nval">'.pht('New Value').'</td>'.
'</tr>'.
implode('', $rows).
'</table>';
@ -330,7 +330,7 @@ abstract class DifferentialChangesetHTMLRenderer
'href' => '#',
'meta' => $meta,
),
'Show File Contents');
pht('Show File Contents'));
}
return $this->wrapChangeInTable(

View file

@ -95,8 +95,8 @@ final class DifferentialChangesetTwoUpRenderer
),
),
$is_first_block
? "Show First 20 Lines"
: "\xE2\x96\xB2 Show 20 Lines");
? pht("Show First 20 Lines")
: pht("\xE2\x96\xB2 Show 20 Lines"));
}
$contents[] = javelin_render_tag(
@ -111,7 +111,7 @@ final class DifferentialChangesetTwoUpRenderer
'range' => "{$top}-{$len}/{$top}-{$len}",
),
),
'Show All '.$len.' Lines');
pht('Show All %d Lines', $len));
$is_last_block = false;
if ($ii + $len >= $rows) {
@ -131,8 +131,8 @@ final class DifferentialChangesetTwoUpRenderer
),
),
$is_last_block
? "Show Last 20 Lines"
: "\xE2\x96\xBC Show 20 Lines");
? pht("Show Last 20 Lines")
: pht("\xE2\x96\xBC Show 20 Lines"));
}
$context = null;

View file

@ -86,14 +86,14 @@ final class DifferentialAddCommentView extends AphrontView {
->addHiddenInput('revision_id', $revision->getID())
->appendChild(
id(new AphrontFormSelectControl())
->setLabel('Action')
->setLabel(pht('Action'))
->setName('action')
->setValue($action)
->setID('comment-action')
->setOptions($this->actions))
->appendChild(
id(new AphrontFormTokenizerControl())
->setLabel('Add Reviewers')
->setLabel(pht('Add Reviewers'))
->setName('reviewers')
->setControlID('add-reviewers')
->setControlStyle($enable_reviewers ? null : 'display: none')
@ -101,7 +101,7 @@ final class DifferentialAddCommentView extends AphrontView {
->setDisableBehavior(true))
->appendChild(
id(new AphrontFormTokenizerControl())
->setLabel('Add CCs')
->setLabel(pht('Add CCs'))
->setName('ccs')
->setControlID('add-ccs')
->setControlStyle($enable_ccs ? null : 'display: none')
@ -111,12 +111,12 @@ final class DifferentialAddCommentView extends AphrontView {
id(new PhabricatorRemarkupControl())
->setName('comment')
->setID('comment-content')
->setLabel('Comment')
->setLabel(pht('Comment'))
->setValue($this->draft ? $this->draft->getDraft() : null)
->setUser($this->user))
->appendChild(
id(new AphrontFormSubmitControl())
->setValue($is_serious ? 'Submit' : 'Clowncopterize'));
->setValue($is_serious ? pht('Submit') : pht('Clowncopterize')));
Javelin::initBehavior(
'differential-add-reviewers-and-ccs',
@ -128,7 +128,7 @@ final class DifferentialAddCommentView extends AphrontView {
'value' => $this->reviewers,
'row' => 'add-reviewers',
'ondemand' => PhabricatorEnv::getEnvConfig('tokenizer.ondemand'),
'placeholder' => 'Type a user name...',
'placeholder' => pht('Type a user name...'),
),
'add-ccs-tokenizer' => array(
'actions' => array('add_ccs' => 1),
@ -136,7 +136,7 @@ final class DifferentialAddCommentView extends AphrontView {
'value' => $this->ccs,
'row' => 'add-ccs',
'ondemand' => PhabricatorEnv::getEnvConfig('tokenizer.ondemand'),
'placeholder' => 'Type a user or mailing list...',
'placeholder' => pht('Type a user or mailing list...'),
),
),
'select' => 'comment-action',
@ -179,7 +179,7 @@ final class DifferentialAddCommentView extends AphrontView {
$warning_container .= '</div>';
$header = id(new PhabricatorHeaderView())
->setHeader($is_serious ? 'Add Comment' : 'Leap Into Action');
->setHeader($is_serious ? pht('Add Comment') : pht('Leap Into Action'));
return
id(new PhabricatorAnchorView())
@ -193,7 +193,7 @@ final class DifferentialAddCommentView extends AphrontView {
'<div class="aphront-panel-preview aphront-panel-flush">'.
'<div id="comment-preview">'.
'<span class="aphront-panel-preview-loading-text">'.
'Loading comment preview...'.
pht('Loading comment preview...').
'</span>'.
'</div>'.
'<div id="inline-comment-preview">'.

View file

@ -120,7 +120,7 @@ final class DifferentialChangesetFileTreeSideNavBuilder {
'<div class="phabricator-filetree">'.
implode("\n", $filetree).
'</div>';
$nav->addLabel('Changed Files');
$nav->addLabel(pht('Changed Files'));
$nav->addCustomBlock($filetree);
$nav->setActive(true);
$nav->selectFilter(null);

View file

@ -89,9 +89,9 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
if (count($away) > 1) {
$meta = array();
if ($type == DifferentialChangeType::TYPE_MULTICOPY) {
$meta[] = 'Deleted after being copied to multiple locations:';
$meta[] = pht('Deleted after being copied to multiple locations:');
} else {
$meta[] = 'Copied to multiple locations:';
$meta[] = pht('Copied to multiple locations:');
}
foreach ($away as $path) {
$meta[] = phutil_escape_html($path);
@ -99,15 +99,17 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
$meta = implode('<br />', $meta);
} else {
if ($type == DifferentialChangeType::TYPE_MOVE_AWAY) {
$meta = 'Moved to '.phutil_escape_html(reset($away));
$meta = pht('Moved to %s', phutil_escape_html(reset($away)));
} else {
$meta = 'Copied to '.phutil_escape_html(reset($away));
$meta = pht('Copied to %s', phutil_escape_html(reset($away)));
}
}
} else if ($type == DifferentialChangeType::TYPE_MOVE_HERE) {
$meta = 'Moved from '.phutil_escape_html($changeset->getOldFile());
$meta = pht('Moved from %s',
phutil_escape_html($changeset->getOldFile()));
} else if ($type == DifferentialChangeType::TYPE_COPY_HERE) {
$meta = 'Copied from '.phutil_escape_html($changeset->getOldFile());
$meta = pht('Copied from %s',
phutil_escape_html($changeset->getOldFile()));
} else {
$meta = null;
}
@ -128,7 +130,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
$pchar =
($changeset->getOldProperties() === $changeset->getNewProperties())
? null
: '<span title="Properties Changed">M</span>';
: '<span title="'.pht('Properties Changed').'">M</span>';
$fname = $changeset->getFilename();
$cov = $this->renderCoverage($coverage, $fname);
@ -186,7 +188,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
'href' => $editor_link,
'class' => 'button differential-toc-edit-all',
),
'Open All in Editor');
pht('Open All in Editor'));
}
}
@ -198,7 +200,7 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
'mustcapture' => true,
'class' => 'button differential-toc-reveal-all',
),
'Show All Context'
pht('Show All Context')
);
$buttons =
@ -221,8 +223,12 @@ final class DifferentialDiffTableOfContentsView extends AphrontView {
'<th></th>'.
'<th></th>'.
'<th>Path</th>'.
'<th class="differential-toc-cov">Coverage (All)</th>'.
'<th class="differential-toc-mcov">Coverage (Touched)</th>'.
'<th class="differential-toc-cov">'.
pht('Coverage (All)').
'</th>'.
'<th class="differential-toc-mcov">'.
pht('Coverage (Touched)').
'</th>'.
'</tr>'.
implode("\n", $rows).
$buttons.

View file

@ -101,7 +101,7 @@ final class DifferentialInlineCommentEditView extends AphrontView {
'sigil' => 'inline-edit-cancel',
'class' => 'grey',
),
'Cancel');
pht('Cancel'));
$buttons = implode('', $buttons);
@ -113,7 +113,7 @@ final class DifferentialInlineCommentEditView extends AphrontView {
'tabindex' => '-1',
'target' => '_blank',
),
'Formatting Reference');
pht('Formatting Reference'));
return javelin_render_tag(
'div',

View file

@ -90,7 +90,7 @@ final class DifferentialInlineCommentView extends AphrontView {
$is_draft = false;
if ($inline->isDraft() && !$is_synthetic) {
$links[] = 'Not Submitted Yet';
$links[] = pht('Not Submitted Yet');
$is_draft = true;
}
@ -102,7 +102,7 @@ final class DifferentialInlineCommentView extends AphrontView {
'mustcapture' => true,
'sigil' => 'differential-inline-prev',
),
'Previous');
pht('Previous'));
$links[] = javelin_render_tag(
'a',
@ -111,7 +111,7 @@ final class DifferentialInlineCommentView extends AphrontView {
'mustcapture' => true,
'sigil' => 'differential-inline-next',
),
'Next');
pht('Next'));
if ($this->allowReply) {
@ -129,7 +129,7 @@ final class DifferentialInlineCommentView extends AphrontView {
'mustcapture' => true,
'sigil' => 'differential-inline-reply',
),
'Reply');
pht('Reply'));
}
}
@ -145,7 +145,7 @@ final class DifferentialInlineCommentView extends AphrontView {
'mustcapture' => true,
'sigil' => 'differential-inline-edit',
),
'Edit');
pht('Edit'));
$links[] = javelin_render_tag(
'a',
array(
@ -153,7 +153,7 @@ final class DifferentialInlineCommentView extends AphrontView {
'mustcapture' => true,
'sigil' => 'differential-inline-delete',
),
'Delete');
pht('Delete'));
} else if ($this->preview) {
$links[] = javelin_render_tag(
'a',
@ -163,7 +163,7 @@ final class DifferentialInlineCommentView extends AphrontView {
),
'sigil' => 'differential-inline-preview-jump',
),
'Not Visible');
pht('Not Visible'));
$links[] = javelin_render_tag(
'a',
array(
@ -171,7 +171,7 @@ final class DifferentialInlineCommentView extends AphrontView {
'mustcapture' => true,
'sigil' => 'differential-inline-delete',
),
'Delete');
pht('Delete'));
}
if ($links) {

View file

@ -114,17 +114,17 @@ final class DifferentialLocalCommitsView extends AphrontView {
$headers = array();
$headers[] = '<th>Commit</th>';
$headers[] = '<th>'.pht('Commit').'</th>';
if ($has_tree) {
$headers[] = '<th>Tree</th>';
$headers[] = '<th>'.pht('Tree').'</th>';
}
if ($has_local) {
$headers[] = '<th>Local</th>';
$headers[] = '<th>'.pht('Local').'</th>';
}
$headers[] = '<th>Parents</th>';
$headers[] = '<th>Author</th>';
$headers[] = '<th>Summary</th>';
$headers[] = '<th>Date</th>';
$headers[] = '<th>'.pht('Parents').'</th>';
$headers[] = '<th>'.pht('Author').'</th>';
$headers[] = '<th>'.pht('Summary').'</th>';
$headers[] = '<th>'.pht('Date').'</th>';
$headers = '<tr>'.implode('', $headers).'</tr>';

View file

@ -165,7 +165,7 @@ final class DifferentialRevisionCommentListView extends AphrontView {
'sigil' => "differential-all-comments-container",
),
'<div class="differential-older-comments-are-hidden">'.
number_format(count($hidden)).' older comments are hidden. '.
pht('%d older comments are hidden. ', number_format(count($hidden))).
javelin_render_tag(
'a',
array(
@ -173,7 +173,7 @@ final class DifferentialRevisionCommentListView extends AphrontView {
'mustcapture' => true,
'sigil' => 'differential-show-all-comments',
),
'Show all comments.').
pht('Show all comments.')).
'</div>');
} else {
$hidden = null;

View file

@ -119,6 +119,7 @@ final class DifferentialRevisionCommentView extends AphrontView {
$verb = phutil_escape_html($verb);
$actions = array();
// TODO: i18n
switch ($comment->getAction()) {
case DifferentialAction::ACTION_ADDCCS:
$actions[] = "{$author_link} added CCs: ".

View file

@ -74,7 +74,7 @@ final class DifferentialRevisionDetailView extends AphrontView {
}
}
if ($next_step) {
$properties->addProperty('Next Step', $next_step);
$properties->addProperty(pht('Next Step'), $next_step);
}
foreach ($this->auxiliaryFields as $field) {

View file

@ -11,7 +11,6 @@ final class DifferentialRevisionListView extends AphrontView {
private $handles;
private $fields;
private $highlightAge;
const NO_DATA_STRING = 'No revisions found.';
public function setFields(array $fields) {
assert_instances_of($fields, 'DifferentialFieldSpecification');
@ -138,7 +137,7 @@ final class DifferentialRevisionListView extends AphrontView {
'width' => 16,
'height' => 16,
'alt' => 'Draft',
'title' => 'Draft Comment',
'title' => pht('Draft Comment'),
)).
'</a>';
}
@ -178,7 +177,7 @@ final class DifferentialRevisionListView extends AphrontView {
$table->setColumnClasses($classes);
$table->setCellClasses($cell_classes);
$table->setNoDataString(DifferentialRevisionListView::NO_DATA_STRING);
$table->setNoDataString(pht('No revisions found.'));
require_celerity_resource('differential-revision-history-css');

View file

@ -124,15 +124,15 @@ final class DifferentialRevisionStatsView extends AphrontView {
$old_count = $counts[$age];
$row_array[$age] = array(
'Revisions per week' => number_format($counts[$age] / $weeks, 2),
'Lines per week' => number_format($lines[$age] / $weeks, 1),
'Active days per week' =>
pht('Revisions per week') => number_format($counts[$age] / $weeks, 2),
pht('Lines per week') => number_format($lines[$age] / $weeks, 1),
pht('Active days per week') =>
number_format($count_active[$age] / $weeks, 1),
'Revisions' => number_format($counts[$age]),
'Lines' => number_format($lines[$age]),
'Lines per diff' => number_format($lines[$age] /
pht('Revisions') => number_format($counts[$age]),
pht('Lines') => number_format($lines[$age]),
pht('Lines per diff') => number_format($lines[$age] /
($counts[$age] + 0.0001)),
'Active days' => number_format($count_active[$age]),
pht('Active days') => number_format($count_active[$age]),
);
switch ($this->filter) {

View file

@ -199,19 +199,19 @@ final class DifferentialRevisionUpdateHistoryView extends AphrontView {
'<form action="#toc">'.
'<table class="differential-revision-history-table">'.
'<tr>'.
'<th>Diff</th>'.
'<th>ID</th>'.
'<th>Base</th>'.
'<th>Description</th>'.
'<th>Created</th>'.
'<th>Lint</th>'.
'<th>Unit</th>'.
'<th>'.pht('Diff').'</th>'.
'<th>'.pht('ID').'</th>'.
'<th>'.pht('Base').'</th>'.
'<th>'.pht('Description').'</th>'.
'<th>'.pht('Created').'</th>'.
'<th>'.pht('Lint').'</th>'.
'<th>'.pht('Unit').'</th>'.
'</tr>'.
implode("\n", $rows).
'<tr>'.
'<td colspan="9" class="diff-differ-submit">'.
'<label>Whitespace Changes: '.$select.'</label>'.
'<button>Show Diff</button>'.
'<label>'.pht('Whitespace Changes: %s', $select).'</label>'.
'<button>'.pht('Show Diff').'</button>'.
'</td>'.
'</tr>'.
'</table>'.