1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-01 09:28:22 +01:00

pht() AphrontNoteView

Summary: Add `pht()` calls throughout `AphrontNoteView` to allow translation of this example.

Test Plan: /uiexample/view/PhabricatorNoteExample/

Reviewers: chad

Reviewed By: chad

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D5325
This commit is contained in:
Edward Speyer 2013-03-12 13:10:06 +00:00
parent a1b98c5cb7
commit 9804dab799

View file

@ -7,49 +7,41 @@ final class PhabricatorNoteExample extends PhabricatorUIExample {
} }
public function getDescription() { public function getDescription() {
return 'Show little scrollable boxes of text.'; return pht('Bounded boxes of text.');
} }
public function renderExample() { public function renderExample() {
$short_note = id(new AphrontNoteView()) $short_note = id(new AphrontNoteView())
->setTitle('Short note') ->setTitle(pht('Short note'))
->appendChild('This is a short note'); ->appendChild('xxxx xx x xxxxx xxxx');
$longer_note = id(new AphrontNoteView()) $longer_note = id(new AphrontNoteView())
->setTitle('Longer note') ->setTitle(pht('Longer note'))
->appendChild($this->buildParagraphs(2)); ->appendChild($this->buildParagraphs(2));
$wide_url = 'protocol://www.'.str_repeat('x', 100).'.com/'; $wide_url = 'protocol://www.'.str_repeat('x', 100).'.com/';
$oversize_note = id(new AphrontNoteView()) $oversize_note = id(new AphrontNoteView())
->setTitle('Oversize note') ->setTitle(pht('Oversize note'))
->appendChild( ->appendChild(
$this->buildParagraphs(2). $this->buildParagraphs(2).
$wide_url."\n\n". $wide_url."\n\n".
$this->buildParagraphs(5)); $this->buildParagraphs(15));
$out = array(); $out = array();
$out[] = id(new AphrontPanelView()) $out[] = id(new AphrontPanelView())
->setHeader('Unbounded Oversize Note') ->setHeader(pht('Unbounded Oversize Note'))
->setCaption(
'The rest of these examples are contrained by a table, but this one '.
'is left free (it still constrains its max height though).')
->appendChild($oversize_note); ->appendChild($oversize_note);
$out[] = id(new AphrontPanelView()) $out[] = id(new AphrontPanelView())
->setHeader("Short notes") ->setHeader(pht('Short notes'))
->setCaption(
'Two notes of equal size, spacing out an 80% wide table.')
->appendChild( ->appendChild(
$this->renderTable( $this->renderTable(
array(array($short_note, $short_note)))); array(array($short_note, $short_note))));
$out[] = id(new AphrontPanelView()) $out[] = id(new AphrontPanelView())
->setHeader("Mixed notes") ->setHeader(pht('Mixed notes'))
->setCaption(
'Two rows of notes with unequal height, spacing out their '.
'rows vertically.')
->appendChild( ->appendChild(
$this->renderTable( $this->renderTable(
array( array(
@ -58,10 +50,7 @@ final class PhabricatorNoteExample extends PhabricatorUIExample {
))); )));
$out[] = id(new AphrontPanelView()) $out[] = id(new AphrontPanelView())
->setHeader("Oversize notes") ->setHeader(pht('Oversize notes'))
->setCaption(
'Two rows each with a very large note, '.
'showing scrolling behavior.')
->appendChild( ->appendChild(
$this->renderTable( $this->renderTable(
array( array(