mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-23 07:12:41 +01:00
pht for phriction
Summary: Scan all phriction app files for text to pht Test Plan: Use phriction in ALL CAPS, seems reasonably usable. Reviewers: epriestley, btrahan Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4862
This commit is contained in:
parent
9c19e9b7d8
commit
51dfeb7950
9 changed files with 75 additions and 72 deletions
|
@ -3,7 +3,7 @@
|
|||
final class PhabricatorApplicationPhriction extends PhabricatorApplication {
|
||||
|
||||
public function getShortDescription() {
|
||||
return 'Wiki';
|
||||
return pht('Wiki');
|
||||
}
|
||||
|
||||
public function getBaseURI() {
|
||||
|
|
|
@ -9,7 +9,7 @@ abstract class PhrictionController extends PhabricatorController {
|
|||
|
||||
$page = $this->buildStandardPageView();
|
||||
|
||||
$page->setApplicationName('Phriction');
|
||||
$page->setApplicationName(pht('Phriction'));
|
||||
$page->setBaseURI('/w/');
|
||||
$page->setTitle(idx($data, 'title'));
|
||||
$page->setGlyph("\xE2\x9A\xA1");
|
||||
|
@ -32,7 +32,7 @@ abstract class PhrictionController extends PhabricatorController {
|
|||
$nav->addFilter('', pht('Create Document'), '/phriction/new');
|
||||
}
|
||||
|
||||
$nav->addLabel('Filters');
|
||||
$nav->addLabel(pht('Filters'));
|
||||
$nav->addFilter('active', pht('Active Documents'));
|
||||
$nav->addFilter('all', pht('All Documents'));
|
||||
$nav->addFilter('updates', pht('Recently Updated'));
|
||||
|
|
|
@ -32,11 +32,11 @@ final class PhrictionDeleteController extends PhrictionController {
|
|||
|
||||
$dialog = id(new AphrontDialogView())
|
||||
->setUser($user)
|
||||
->setTitle('Delete document?')
|
||||
->setTitle(pht('Delete document?'))
|
||||
->appendChild(
|
||||
'Really delete this document? You can recover it later by reverting '.
|
||||
'to a previous version.')
|
||||
->addSubmitButton('Delete')
|
||||
pht('Really delete this document? You can recover it later by '.
|
||||
'reverting to a previous version.'))
|
||||
->addSubmitButton(pht('Delete'))
|
||||
->addCancelButton($document_uri);
|
||||
|
||||
return id(new AphrontDialogResponse())->setDialog($dialog);
|
||||
|
|
|
@ -138,9 +138,9 @@ final class PhrictionDiffController
|
|||
array(
|
||||
'href' => $uri->alter('l', $l - 1)->alter('r', $r - 1),
|
||||
),
|
||||
"\xC2\xAB Previous Change");
|
||||
pht("\xC2\xAB Previous Change"));
|
||||
} else {
|
||||
$link_l = 'Original Change';
|
||||
$link_l = pht('Original Change');
|
||||
}
|
||||
|
||||
$link_r = null;
|
||||
|
@ -150,9 +150,9 @@ final class PhrictionDiffController
|
|||
array(
|
||||
'href' => $uri->alter('l', $l + 1)->alter('r', $r + 1),
|
||||
),
|
||||
"Next Change \xC2\xBB");
|
||||
pht("Next Change \xC2\xBB"));
|
||||
} else {
|
||||
$link_r = 'Most Recent Change';
|
||||
$link_r = pht('Most Recent Change');
|
||||
}
|
||||
|
||||
$navigation_table =
|
||||
|
@ -184,7 +184,7 @@ final class PhrictionDiffController
|
|||
$output,
|
||||
),
|
||||
array(
|
||||
'title' => 'Document History',
|
||||
'title' => pht('Document History'),
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -208,7 +208,7 @@ final class PhrictionDiffController
|
|||
'href' => '/phriction/edit/'.$document_id.'/',
|
||||
'class' => 'button',
|
||||
),
|
||||
'Edit Current Version');
|
||||
pht('Edit Current Version'));
|
||||
}
|
||||
|
||||
|
||||
|
@ -218,7 +218,7 @@ final class PhrictionDiffController
|
|||
'href' => '/phriction/edit/'.$document_id.'/?revert='.$version,
|
||||
'class' => 'button',
|
||||
),
|
||||
'Revert to Version '.phutil_escape_html($version).'...');
|
||||
pht('Revert to Version %s...', phutil_escape_html($version)));
|
||||
}
|
||||
|
||||
private function renderComparisonTable(array $content) {
|
||||
|
@ -244,11 +244,11 @@ final class PhrictionDiffController
|
|||
$table = new AphrontTableView($rows);
|
||||
$table->setHeaders(
|
||||
array(
|
||||
'Date',
|
||||
'Time',
|
||||
'Version',
|
||||
'Author',
|
||||
'Description',
|
||||
pht('Date'),
|
||||
pht('Time'),
|
||||
pht('Version'),
|
||||
pht('Author'),
|
||||
pht('Description'),
|
||||
));
|
||||
$table->setColumnClasses(
|
||||
array(
|
||||
|
|
|
@ -60,15 +60,15 @@ final class PhrictionDocumentController
|
|||
'href' => $create_uri,
|
||||
'class' => 'green button',
|
||||
),
|
||||
'Create Page');
|
||||
pht('Create Page'));
|
||||
|
||||
$page_content =
|
||||
'<div class="phriction-content">'.
|
||||
'<em>No content here!</em><br />'.
|
||||
'No document found at <tt>'.phutil_escape_html($slug).'</tt>. '.
|
||||
$create_sentence.
|
||||
'<em>'.pht('No content here!').'</em><br />'.
|
||||
pht('No document found at <tt>%s</tt>.', phutil_escape_html($slug)).
|
||||
' '.$create_sentence.
|
||||
'</div>';
|
||||
$page_title = 'Page Not Found';
|
||||
$page_title = pht('Page Not Found');
|
||||
$buttons = $button;
|
||||
} else {
|
||||
$version = $request->getInt('v');
|
||||
|
@ -82,13 +82,13 @@ final class PhrictionDocumentController
|
|||
}
|
||||
|
||||
if ($content->getID() != $document->getContentID()) {
|
||||
$vdate = phabricator_datetime($content->getDateCreated(), $user);
|
||||
$version_note = new AphrontErrorView();
|
||||
$version_note->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
|
||||
$version_note->setTitle('Older Version');
|
||||
$version_note->appendChild(
|
||||
'You are viewing an older version of this document, as it '.
|
||||
'appeared on '.
|
||||
phabricator_datetime($content->getDateCreated(), $user).'.');
|
||||
pht('You are viewing an older version of this document, as it '.
|
||||
'appeared on %s.', $vdate));
|
||||
}
|
||||
} else {
|
||||
$content = id(new PhrictionContent())->load($document->getContentID());
|
||||
|
@ -154,8 +154,8 @@ final class PhrictionDocumentController
|
|||
$notice->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
|
||||
$notice->setTitle('Document Deleted');
|
||||
$notice->appendChild(
|
||||
'This document has been deleted. You can edit it to put new content '.
|
||||
'here, or use history to revert to an earlier version.');
|
||||
pht('This document has been deleted. You can edit it to put new '.
|
||||
'content here, or use history to revert to an earlier version.'));
|
||||
$core_content = $notice->render();
|
||||
} else {
|
||||
throw new Exception("Unknown document status '{$doc_status}'!");
|
||||
|
@ -338,20 +338,22 @@ final class PhrictionDocumentController
|
|||
}
|
||||
}
|
||||
if ($more_children) {
|
||||
$list[] = '<li>More...</li>';
|
||||
$list[] = '<li>'.pht('More...').'</li>';
|
||||
}
|
||||
$list[] = '</ul>';
|
||||
$list = implode("\n", $list);
|
||||
|
||||
return
|
||||
'<div class="phriction-children">'.
|
||||
'<div class="phriction-children-header">Document Hierarchy</div>'.
|
||||
'<div class="phriction-children-header">'.
|
||||
pht('Document Hierarchy').
|
||||
'</div>'.
|
||||
$list.
|
||||
'</div>';
|
||||
}
|
||||
|
||||
private function renderChildDocumentLink(array $info) {
|
||||
$title = nonempty($info['title'], '(Untitled Document)');
|
||||
$title = nonempty($info['title'], pht('(Untitled Document)'));
|
||||
$item = phutil_render_tag(
|
||||
'a',
|
||||
array(
|
||||
|
|
|
@ -95,8 +95,8 @@ final class PhrictionEditController
|
|||
$notes = $request->getStr('description');
|
||||
|
||||
if (!strlen($title)) {
|
||||
$e_title = 'Required';
|
||||
$errors[] = 'Document title is required.';
|
||||
$e_title = pht('Required');
|
||||
$errors[] = pht('Document title is required.');
|
||||
} else {
|
||||
$e_title = null;
|
||||
}
|
||||
|
@ -107,9 +107,9 @@ final class PhrictionEditController
|
|||
|
||||
$dialog = new AphrontDialogView();
|
||||
$dialog->setUser($user);
|
||||
$dialog->setTitle('No Edits');
|
||||
$dialog->setTitle(pht('No Edits'));
|
||||
$dialog->appendChild(
|
||||
'<p>You did not make any changes to the document.</p>');
|
||||
'<p>'.pht('You did not make any changes to the document.').'</p>');
|
||||
$dialog->addCancelButton($request->getRequestURI());
|
||||
|
||||
return id(new AphrontDialogResponse())->setDialog($dialog);
|
||||
|
@ -121,9 +121,9 @@ final class PhrictionEditController
|
|||
|
||||
$dialog = new AphrontDialogView();
|
||||
$dialog->setUser($user);
|
||||
$dialog->setTitle('Empty Page');
|
||||
$dialog->setTitle(pht('Empty Page'));
|
||||
$dialog->appendChild(
|
||||
'<p>You can not create an empty document.</p>');
|
||||
'<p>'.pht('You can not create an empty document.').'</p>');
|
||||
$dialog->addCancelButton($request->getRequestURI());
|
||||
|
||||
return id(new AphrontDialogResponse())->setDialog($dialog);
|
||||
|
@ -150,16 +150,16 @@ final class PhrictionEditController
|
|||
$error_view = null;
|
||||
if ($errors) {
|
||||
$error_view = id(new AphrontErrorView())
|
||||
->setTitle('Form Errors')
|
||||
->setTitle(pht('Form Errors'))
|
||||
->setErrors($errors);
|
||||
}
|
||||
|
||||
if ($document->getID()) {
|
||||
$panel_header = 'Edit Phriction Document';
|
||||
$submit_button = 'Save Changes';
|
||||
$panel_header = pht('Edit Phriction Document');
|
||||
$submit_button = pht('Save Changes');
|
||||
} else {
|
||||
$panel_header = 'Create New Phriction Document';
|
||||
$submit_button = 'Create Document';
|
||||
$panel_header = pht('Create New Phriction Document');
|
||||
$submit_button = pht('Create Document');
|
||||
}
|
||||
|
||||
$uri = $document->getSlug();
|
||||
|
@ -178,13 +178,14 @@ final class PhrictionEditController
|
|||
array(
|
||||
'href' => $request->getRequestURI()->alter('nodraft', true),
|
||||
),
|
||||
'discard this draft');
|
||||
pht('discard this draft'));
|
||||
|
||||
$draft_note = new AphrontErrorView();
|
||||
$draft_note->setSeverity(AphrontErrorView::SEVERITY_NOTICE);
|
||||
$draft_note->setTitle('Recovered Draft');
|
||||
$draft_note->appendChild(
|
||||
'<p>Showing a saved draft of your edits, you can '.$discard.'.</p>');
|
||||
'<p>'.pht('Showing a saved draft of your edits, you can %s.',
|
||||
$discard).'</p>');
|
||||
} else {
|
||||
$content_text = $content->getContent();
|
||||
$draft_note = null;
|
||||
|
@ -198,17 +199,17 @@ final class PhrictionEditController
|
|||
->addHiddenInput('nodraft', $request->getBool('nodraft'))
|
||||
->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
->setLabel('Title')
|
||||
->setLabel(pht('Title'))
|
||||
->setValue($content->getTitle())
|
||||
->setError($e_title)
|
||||
->setName('title'))
|
||||
->appendChild(
|
||||
id(new AphrontFormStaticControl())
|
||||
->setLabel('URI')
|
||||
->setLabel(pht('URI'))
|
||||
->setValue($uri))
|
||||
->appendChild(
|
||||
id(new PhabricatorRemarkupControl())
|
||||
->setLabel('Content')
|
||||
->setLabel(pht('Content'))
|
||||
->setValue($content_text)
|
||||
->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL)
|
||||
->setName('content')
|
||||
|
@ -216,7 +217,7 @@ final class PhrictionEditController
|
|||
->setUser($user))
|
||||
->appendChild(
|
||||
id(new AphrontFormTextControl())
|
||||
->setLabel('Edit Notes')
|
||||
->setLabel(pht('Edit Notes'))
|
||||
->setValue($notes)
|
||||
->setError(null)
|
||||
->setName('description'))
|
||||
|
@ -233,11 +234,11 @@ final class PhrictionEditController
|
|||
$preview_panel =
|
||||
'<div class="aphront-panel-preview aphront-panel-preview-wide">
|
||||
<div class="phriction-document-preview-header">
|
||||
Document Preview
|
||||
'.pht('Document Preview').'
|
||||
</div>
|
||||
<div id="document-preview">
|
||||
<div class="aphront-panel-preview-loading-text">
|
||||
Loading preview...
|
||||
'.pht('Loading preview...').'
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
|
@ -258,7 +259,7 @@ final class PhrictionEditController
|
|||
$preview_panel,
|
||||
),
|
||||
array(
|
||||
'title' => 'Edit Document',
|
||||
'title' => pht('Edit Document'),
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ final class PhrictionHistoryController
|
|||
|
||||
$diff_uri = new PhutilURI('/phriction/diff/'.$document->getID().'/');
|
||||
|
||||
$vs_previous = '<em>Created</em>';
|
||||
$vs_previous = '<em>'.pht('Created').'</em>';
|
||||
if ($content->getVersion() != 1) {
|
||||
$uri = $diff_uri
|
||||
->alter('l', $content->getVersion() - 1)
|
||||
|
@ -59,10 +59,10 @@ final class PhrictionHistoryController
|
|||
array(
|
||||
'href' => $uri,
|
||||
),
|
||||
'Show Change');
|
||||
pht('Show Change'));
|
||||
}
|
||||
|
||||
$vs_head = '<em>Current</em>';
|
||||
$vs_head = '<em>'.pht('Current').'</em>';
|
||||
if ($content->getID() != $document->getContentID()) {
|
||||
$uri = $diff_uri
|
||||
->alter('l', $content->getVersion())
|
||||
|
@ -73,7 +73,7 @@ final class PhrictionHistoryController
|
|||
array(
|
||||
'href' => $uri,
|
||||
),
|
||||
'Show Later Changes');
|
||||
pht('Show Later Changes'));
|
||||
}
|
||||
|
||||
$change_type = PhrictionChangeType::getChangeTypeLabel(
|
||||
|
@ -87,7 +87,7 @@ final class PhrictionHistoryController
|
|||
array(
|
||||
'href' => $slug_uri.'?v='.$version,
|
||||
),
|
||||
'Version '.$version),
|
||||
pht('Version %s', $version)),
|
||||
$handles[$content->getAuthorPHID()]->renderLink(),
|
||||
$change_type,
|
||||
phutil_escape_html($content->getDescription()),
|
||||
|
@ -99,14 +99,14 @@ final class PhrictionHistoryController
|
|||
$table = new AphrontTableView($rows);
|
||||
$table->setHeaders(
|
||||
array(
|
||||
'Date',
|
||||
'Time',
|
||||
'Version',
|
||||
'Author',
|
||||
'Type',
|
||||
'Description',
|
||||
'Against Previous',
|
||||
'Against Current',
|
||||
pht('Date'),
|
||||
pht('Time'),
|
||||
pht('Version'),
|
||||
pht('Author'),
|
||||
pht('Type'),
|
||||
pht('Description'),
|
||||
pht('Against Previous'),
|
||||
pht('Against Current'),
|
||||
));
|
||||
$table->setColumnClasses(
|
||||
array(
|
||||
|
@ -132,7 +132,7 @@ final class PhrictionHistoryController
|
|||
PhrictionDocument::getSlugURI($document->getSlug(), 'history')));
|
||||
|
||||
$panel = new AphrontPanelView();
|
||||
$panel->setHeader('Document History');
|
||||
$panel->setHeader(pht('Document History'));
|
||||
$panel->setNoBackground();
|
||||
$panel->appendChild($table);
|
||||
$panel->appendChild($pager);
|
||||
|
@ -143,7 +143,7 @@ final class PhrictionHistoryController
|
|||
$panel,
|
||||
),
|
||||
array(
|
||||
'title' => 'Document History',
|
||||
'title' => pht('Document History'),
|
||||
'device' => true,
|
||||
));
|
||||
|
||||
|
|
|
@ -67,10 +67,10 @@ final class PhrictionListController
|
|||
$document_table = new AphrontTableView($rows);
|
||||
$document_table->setHeaders(
|
||||
array(
|
||||
'Last Editor',
|
||||
'Title',
|
||||
'Last Update',
|
||||
'Time',
|
||||
pht('Last Editor'),
|
||||
pht('Title'),
|
||||
pht('Last Update'),
|
||||
pht('Time'),
|
||||
));
|
||||
|
||||
$document_table->setColumnClasses(
|
||||
|
|
|
@ -78,7 +78,7 @@ final class PhrictionContent extends PhrictionDAO
|
|||
$toc =
|
||||
'<div class="phabricator-remarkup-toc">'.
|
||||
'<div class="phabricator-remarkup-toc-header">'.
|
||||
'Table of Contents'.
|
||||
pht('Table of Contents').
|
||||
'</div>'.
|
||||
$toc.
|
||||
'</div>';
|
||||
|
|
Loading…
Reference in a new issue