mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-02 11:42:42 +01:00
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
This commit is contained in:
parent
b4d69800f9
commit
2591b4bc77
3 changed files with 17 additions and 16 deletions
|
@ -9,13 +9,14 @@ abstract class PhabricatorPasteController extends PhabricatorController {
|
||||||
$nav->setBaseURI(new PhutilURI($this->getApplicationURI('filter/')));
|
$nav->setBaseURI(new PhutilURI($this->getApplicationURI('filter/')));
|
||||||
|
|
||||||
if ($for_app) {
|
if ($for_app) {
|
||||||
$nav->addFilter('', 'Create Paste', $this->getApplicationURI('/create/'));
|
$nav->addFilter('', pht('Create Paste'),
|
||||||
|
$this->getApplicationURI('/create/'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$nav->addLabel('Filters');
|
$nav->addLabel(pht('Filters'));
|
||||||
$nav->addFilter('all', 'All Pastes');
|
$nav->addFilter('all', pht('All Pastes'));
|
||||||
if ($user->isLoggedIn()) {
|
if ($user->isLoggedIn()) {
|
||||||
$nav->addFilter('my', 'My Pastes');
|
$nav->addFilter('my', pht('My Pastes'));
|
||||||
}
|
}
|
||||||
|
|
||||||
$nav->selectFilter($filter, 'all');
|
$nav->selectFilter($filter, 'all');
|
||||||
|
|
|
@ -64,8 +64,8 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController {
|
||||||
if ($is_create) {
|
if ($is_create) {
|
||||||
$text = $request->getStr('text');
|
$text = $request->getStr('text');
|
||||||
if (!strlen($text)) {
|
if (!strlen($text)) {
|
||||||
$e_text = 'Required';
|
$e_text = pht('Required');
|
||||||
$errors[] = 'The paste may not be blank.';
|
$errors[] = pht('The paste may not be blank.');
|
||||||
} else {
|
} else {
|
||||||
$e_text = null;
|
$e_text = null;
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($is_create && $parent) {
|
if ($is_create && $parent) {
|
||||||
$paste->setTitle('Fork of '.$parent->getFullName());
|
$paste->setTitle(pht('Fork of %s', $parent->getFullName()));
|
||||||
$paste->setLanguage($parent->getLanguage());
|
$paste->setLanguage($parent->getLanguage());
|
||||||
$text = $parent->getRawContent();
|
$text = $parent->getRawContent();
|
||||||
}
|
}
|
||||||
|
@ -103,7 +103,7 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController {
|
||||||
$error_view = null;
|
$error_view = null;
|
||||||
if ($errors) {
|
if ($errors) {
|
||||||
$error_view = id(new AphrontErrorView())
|
$error_view = id(new AphrontErrorView())
|
||||||
->setTitle('A fatal omission!')
|
->setTitle(pht('A Fatal Omission!'))
|
||||||
->setErrors($errors);
|
->setErrors($errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController {
|
||||||
$form->setFlexible(true);
|
$form->setFlexible(true);
|
||||||
|
|
||||||
$langs = array(
|
$langs = array(
|
||||||
'' => '(Detect From Filename in Title)',
|
'' => pht('(Detect From Filename in Title)'),
|
||||||
) + PhabricatorEnv::getEnvConfig('pygments.dropdown-choices');
|
) + PhabricatorEnv::getEnvConfig('pygments.dropdown-choices');
|
||||||
|
|
||||||
$form
|
$form
|
||||||
|
@ -119,12 +119,12 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController {
|
||||||
->addHiddenInput('parent', $parent_id)
|
->addHiddenInput('parent', $parent_id)
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTextControl())
|
id(new AphrontFormTextControl())
|
||||||
->setLabel('Title')
|
->setLabel(pht('Title'))
|
||||||
->setValue($paste->getTitle())
|
->setValue($paste->getTitle())
|
||||||
->setName('title'))
|
->setName('title'))
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormSelectControl())
|
id(new AphrontFormSelectControl())
|
||||||
->setLabel('Language')
|
->setLabel(pht('Language'))
|
||||||
->setName('language')
|
->setName('language')
|
||||||
->setValue($paste->getLanguage())
|
->setValue($paste->getLanguage())
|
||||||
->setOptions($langs));
|
->setOptions($langs));
|
||||||
|
@ -146,7 +146,7 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController {
|
||||||
$form
|
$form
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormTextAreaControl())
|
id(new AphrontFormTextAreaControl())
|
||||||
->setLabel('Text')
|
->setLabel(pht('Text'))
|
||||||
->setError($e_text)
|
->setError($e_text)
|
||||||
->setValue($text)
|
->setValue($text)
|
||||||
->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL)
|
->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL)
|
||||||
|
@ -158,13 +158,13 @@ final class PhabricatorPasteEditController extends PhabricatorPasteController {
|
||||||
array(
|
array(
|
||||||
'href' => $this->getApplicationURI('?parent='.$paste->getID())
|
'href' => $this->getApplicationURI('?parent='.$paste->getID())
|
||||||
),
|
),
|
||||||
'Fork'
|
pht('Fork')
|
||||||
);
|
);
|
||||||
$form
|
$form
|
||||||
->appendChild(
|
->appendChild(
|
||||||
id(new AphrontFormMarkupControl())
|
id(new AphrontFormMarkupControl())
|
||||||
->setLabel('Text')
|
->setLabel(pht('Text'))
|
||||||
->setValue(hsprintf(
|
->setValue(pht(
|
||||||
'Paste text can not be edited. %s to create a new paste.',
|
'Paste text can not be edited. %s to create a new paste.',
|
||||||
$fork_link)));
|
$fork_link)));
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ final class PhabricatorPaste extends PhabricatorPasteDAO
|
||||||
public function getFullName() {
|
public function getFullName() {
|
||||||
$title = $this->getTitle();
|
$title = $this->getTitle();
|
||||||
if (!$title) {
|
if (!$title) {
|
||||||
$title = '(An Untitled Masterwork)';
|
$title = pht('(An Untitled Masterwork)');
|
||||||
}
|
}
|
||||||
return 'P'.$this->getID().' '.$title;
|
return 'P'.$this->getID().' '.$title;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue