diff --git a/src/applications/phriction/application/PhabricatorApplicationPhriction.php b/src/applications/phriction/application/PhabricatorApplicationPhriction.php index f6119bff57..212b984ca5 100644 --- a/src/applications/phriction/application/PhabricatorApplicationPhriction.php +++ b/src/applications/phriction/application/PhabricatorApplicationPhriction.php @@ -3,7 +3,7 @@ final class PhabricatorApplicationPhriction extends PhabricatorApplication { public function getShortDescription() { - return 'Wiki'; + return pht('Wiki'); } public function getBaseURI() { diff --git a/src/applications/phriction/controller/PhrictionController.php b/src/applications/phriction/controller/PhrictionController.php index 0b7fa32ede..c242c4f64f 100644 --- a/src/applications/phriction/controller/PhrictionController.php +++ b/src/applications/phriction/controller/PhrictionController.php @@ -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')); diff --git a/src/applications/phriction/controller/PhrictionDeleteController.php b/src/applications/phriction/controller/PhrictionDeleteController.php index 13d43d25b8..16cb4a9edc 100644 --- a/src/applications/phriction/controller/PhrictionDeleteController.php +++ b/src/applications/phriction/controller/PhrictionDeleteController.php @@ -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); diff --git a/src/applications/phriction/controller/PhrictionDiffController.php b/src/applications/phriction/controller/PhrictionDiffController.php index ee03806fac..3701b7810f 100644 --- a/src/applications/phriction/controller/PhrictionDiffController.php +++ b/src/applications/phriction/controller/PhrictionDiffController.php @@ -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( diff --git a/src/applications/phriction/controller/PhrictionDocumentController.php b/src/applications/phriction/controller/PhrictionDocumentController.php index 97b328bd67..64f51f9845 100644 --- a/src/applications/phriction/controller/PhrictionDocumentController.php +++ b/src/applications/phriction/controller/PhrictionDocumentController.php @@ -60,15 +60,15 @@ final class PhrictionDocumentController 'href' => $create_uri, 'class' => 'green button', ), - 'Create Page'); + pht('Create Page')); $page_content = '
'. - 'No content here!
'. - 'No document found at '.phutil_escape_html($slug).'. '. - $create_sentence. + ''.pht('No content here!').'
'. + pht('No document found at %s.', phutil_escape_html($slug)). + ' '.$create_sentence. '
'; - $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[] = '
  • More...
  • '; + $list[] = '
  • '.pht('More...').'
  • '; } $list[] = ''; $list = implode("\n", $list); return '
    '. - '
    Document Hierarchy
    '. + '
    '. + pht('Document Hierarchy'). + '
    '. $list. '
    '; } private function renderChildDocumentLink(array $info) { - $title = nonempty($info['title'], '(Untitled Document)'); + $title = nonempty($info['title'], pht('(Untitled Document)')); $item = phutil_render_tag( 'a', array( diff --git a/src/applications/phriction/controller/PhrictionEditController.php b/src/applications/phriction/controller/PhrictionEditController.php index f701839262..08243f4f7a 100644 --- a/src/applications/phriction/controller/PhrictionEditController.php +++ b/src/applications/phriction/controller/PhrictionEditController.php @@ -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( - '

    You did not make any changes to the document.

    '); + '

    '.pht('You did not make any changes to the document.').'

    '); $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( - '

    You can not create an empty document.

    '); + '

    '.pht('You can not create an empty document.').'

    '); $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( - '

    Showing a saved draft of your edits, you can '.$discard.'.

    '); + '

    '.pht('Showing a saved draft of your edits, you can %s.', + $discard).'

    '); } 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 = '
    - Document Preview + '.pht('Document Preview').'
    - Loading preview... + '.pht('Loading preview...').'
    '; @@ -258,7 +259,7 @@ final class PhrictionEditController $preview_panel, ), array( - 'title' => 'Edit Document', + 'title' => pht('Edit Document'), )); } diff --git a/src/applications/phriction/controller/PhrictionHistoryController.php b/src/applications/phriction/controller/PhrictionHistoryController.php index e6bb0a9aa1..c822c5e120 100644 --- a/src/applications/phriction/controller/PhrictionHistoryController.php +++ b/src/applications/phriction/controller/PhrictionHistoryController.php @@ -49,7 +49,7 @@ final class PhrictionHistoryController $diff_uri = new PhutilURI('/phriction/diff/'.$document->getID().'/'); - $vs_previous = 'Created'; + $vs_previous = ''.pht('Created').''; 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 = 'Current'; + $vs_head = ''.pht('Current').''; 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, )); diff --git a/src/applications/phriction/controller/PhrictionListController.php b/src/applications/phriction/controller/PhrictionListController.php index 269a70288c..c4b8968609 100644 --- a/src/applications/phriction/controller/PhrictionListController.php +++ b/src/applications/phriction/controller/PhrictionListController.php @@ -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( diff --git a/src/applications/phriction/storage/PhrictionContent.php b/src/applications/phriction/storage/PhrictionContent.php index 0307455b7f..6c13c55fb7 100644 --- a/src/applications/phriction/storage/PhrictionContent.php +++ b/src/applications/phriction/storage/PhrictionContent.php @@ -78,7 +78,7 @@ final class PhrictionContent extends PhrictionDAO $toc = '
    '. '
    '. - 'Table of Contents'. + pht('Table of Contents'). '
    '. $toc. '
    ';