From 2591b4bc77d75d751b9fda092f07d07cd6497fbe Mon Sep 17 00:00:00 2001 From: Chad Little Date: Wed, 13 Feb 2013 11:47:31 -0800 Subject: [PATCH] pht for Paste Summary: Fill in missing pht's for Paste Test Plan: Review Paste in ALLCAPS. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4934 --- .../controller/PhabricatorPasteController.php | 9 ++++---- .../PhabricatorPasteEditController.php | 22 +++++++++---------- .../paste/storage/PhabricatorPaste.php | 2 +- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/applications/paste/controller/PhabricatorPasteController.php b/src/applications/paste/controller/PhabricatorPasteController.php index 6cc57c347e..c9b93906a1 100644 --- a/src/applications/paste/controller/PhabricatorPasteController.php +++ b/src/applications/paste/controller/PhabricatorPasteController.php @@ -9,13 +9,14 @@ abstract class PhabricatorPasteController extends PhabricatorController { $nav->setBaseURI(new PhutilURI($this->getApplicationURI('filter/'))); if ($for_app) { - $nav->addFilter('', 'Create Paste', $this->getApplicationURI('/create/')); + $nav->addFilter('', pht('Create Paste'), + $this->getApplicationURI('/create/')); } - $nav->addLabel('Filters'); - $nav->addFilter('all', 'All Pastes'); + $nav->addLabel(pht('Filters')); + $nav->addFilter('all', pht('All Pastes')); if ($user->isLoggedIn()) { - $nav->addFilter('my', 'My Pastes'); + $nav->addFilter('my', pht('My Pastes')); } $nav->selectFilter($filter, 'all'); diff --git a/src/applications/paste/controller/PhabricatorPasteEditController.php b/src/applications/paste/controller/PhabricatorPasteEditController.php index 29d0272209..0e9d4cf447 100644 --- a/src/applications/paste/controller/PhabricatorPasteEditController.php +++ b/src/applications/paste/controller/PhabricatorPasteEditController.php @@ -64,8 +64,8 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController { if ($is_create) { $text = $request->getStr('text'); if (!strlen($text)) { - $e_text = 'Required'; - $errors[] = 'The paste may not be blank.'; + $e_text = pht('Required'); + $errors[] = pht('The paste may not be blank.'); } else { $e_text = null; } @@ -94,7 +94,7 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController { } } else { if ($is_create && $parent) { - $paste->setTitle('Fork of '.$parent->getFullName()); + $paste->setTitle(pht('Fork of %s', $parent->getFullName())); $paste->setLanguage($parent->getLanguage()); $text = $parent->getRawContent(); } @@ -103,7 +103,7 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController { $error_view = null; if ($errors) { $error_view = id(new AphrontErrorView()) - ->setTitle('A fatal omission!') + ->setTitle(pht('A Fatal Omission!')) ->setErrors($errors); } @@ -111,7 +111,7 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController { $form->setFlexible(true); $langs = array( - '' => '(Detect From Filename in Title)', + '' => pht('(Detect From Filename in Title)'), ) + PhabricatorEnv::getEnvConfig('pygments.dropdown-choices'); $form @@ -119,12 +119,12 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController { ->addHiddenInput('parent', $parent_id) ->appendChild( id(new AphrontFormTextControl()) - ->setLabel('Title') + ->setLabel(pht('Title')) ->setValue($paste->getTitle()) ->setName('title')) ->appendChild( id(new AphrontFormSelectControl()) - ->setLabel('Language') + ->setLabel(pht('Language')) ->setName('language') ->setValue($paste->getLanguage()) ->setOptions($langs)); @@ -146,7 +146,7 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController { $form ->appendChild( id(new AphrontFormTextAreaControl()) - ->setLabel('Text') + ->setLabel(pht('Text')) ->setError($e_text) ->setValue($text) ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL) @@ -158,13 +158,13 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController { array( 'href' => $this->getApplicationURI('?parent='.$paste->getID()) ), - 'Fork' + pht('Fork') ); $form ->appendChild( id(new AphrontFormMarkupControl()) - ->setLabel('Text') - ->setValue(hsprintf( + ->setLabel(pht('Text')) + ->setValue(pht( 'Paste text can not be edited. %s to create a new paste.', $fork_link))); } diff --git a/src/applications/paste/storage/PhabricatorPaste.php b/src/applications/paste/storage/PhabricatorPaste.php index 239b964562..ba87def552 100644 --- a/src/applications/paste/storage/PhabricatorPaste.php +++ b/src/applications/paste/storage/PhabricatorPaste.php @@ -50,7 +50,7 @@ final class PhabricatorPaste extends PhabricatorPasteDAO public function getFullName() { $title = $this->getTitle(); if (!$title) { - $title = '(An Untitled Masterwork)'; + $title = pht('(An Untitled Masterwork)'); } return 'P'.$this->getID().' '.$title; }