pht() for Flags

Summary: This also includes the "Flag for Later" action items

Test Plan:
did a run with all caps

badassery

Reviewers: epriestley, btrahan, chad

Reviewed By: chad

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5276
This commit is contained in:
Anh Nhan Nguyen
2013-03-07 08:22:10 -08:00
committed by epriestley
parent 0865ed266d
commit 048fb35b46
7 changed files with 28 additions and 27 deletions

View File

@@ -3,7 +3,7 @@
final class PhabricatorApplicationFlags extends PhabricatorApplication { final class PhabricatorApplicationFlags extends PhabricatorApplication {
public function getShortDescription() { public function getShortDescription() {
return 'Reminders'; return pht('Reminders');
} }
public function getBaseURI() { public function getBaseURI() {

View File

@@ -13,19 +13,19 @@ final class PhabricatorFlagColor extends PhabricatorFlagConstants {
public static function getColorNameMap() { public static function getColorNameMap() {
return array( return array(
self::COLOR_RED => 'Red', self::COLOR_RED => pht('Red'),
self::COLOR_ORANGE => 'Orange', self::COLOR_ORANGE => pht('Orange'),
self::COLOR_YELLOW => 'Yellow', self::COLOR_YELLOW => pht('Yellow'),
self::COLOR_GREEN => 'Green', self::COLOR_GREEN => pht('Green'),
self::COLOR_BLUE => 'Blue', self::COLOR_BLUE => pht('Blue'),
self::COLOR_PINK => 'Pink', self::COLOR_PINK => pht('Pink'),
self::COLOR_PURPLE => 'Purple', self::COLOR_PURPLE => pht('Purple'),
self::COLOR_CHECKERED => 'Checkered', self::COLOR_CHECKERED => pht('Checkered'),
); );
} }
public static function getColorName($color) { public static function getColorName($color) {
return idx(self::getColorNameMap(), $color, 'Unknown'); return idx(self::getColorNameMap(), $color, pht('Unknown'));
} }
public static function getCSSClass($color) { public static function getCSSClass($color) {

View File

@@ -6,7 +6,7 @@ abstract class PhabricatorFlagController extends PhabricatorController {
$page = $this->buildStandardPageView(); $page = $this->buildStandardPageView();
$page->setApplicationName('Flag'); $page->setApplicationName(pht('Flag'));
$page->setBaseURI('/flag/'); $page->setBaseURI('/flag/');
$page->setTitle(idx($data, 'title')); $page->setTitle(idx($data, 'title'));
$page->setGlyph("\xE2\x9A\x90"); // Subtle! $page->setGlyph("\xE2\x9A\x90"); // Subtle!

View File

@@ -42,7 +42,7 @@ final class PhabricatorFlagEditController extends PhabricatorFlagController {
$dialog = new AphrontDialogView(); $dialog = new AphrontDialogView();
$dialog->setUser($user); $dialog->setUser($user);
$dialog->setTitle("Flag {$type_name}"); $dialog->setTitle(pht("Flag %s", $type_name));
require_celerity_resource('phabricator-flag-css'); require_celerity_resource('phabricator-flag-css');
@@ -53,9 +53,10 @@ final class PhabricatorFlagEditController extends PhabricatorFlagController {
if ($is_new) { if ($is_new) {
$form $form
->appendChild(hsprintf( ->appendChild(hsprintf(
"<p>You can flag this %s if you want to remember to look ". "<p>%s</p><br />",
"at it later.</p><br />", pht('You can flag this %s if you want to remember to look ".
$type_name)); "at it later.',
$type_name)));
} }
$radio = new AphrontFormRadioButtonControl(); $radio = new AphrontFormRadioButtonControl();
@@ -68,20 +69,20 @@ final class PhabricatorFlagEditController extends PhabricatorFlagController {
->appendChild( ->appendChild(
$radio $radio
->setName('color') ->setName('color')
->setLabel('Flag Color') ->setLabel(pht('Flag Color'))
->setValue($flag->getColor())) ->setValue($flag->getColor()))
->appendChild( ->appendChild(
id(new AphrontFormTextAreaControl()) id(new AphrontFormTextAreaControl())
->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_SHORT) ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_SHORT)
->setName('note') ->setName('note')
->setLabel('Note') ->setLabel(pht('Note'))
->setValue($flag->getNote())); ->setValue($flag->getNote()));
$dialog->appendChild($form); $dialog->appendChild($form);
$dialog->addCancelButton($handle->getURI()); $dialog->addCancelButton($handle->getURI());
$dialog->addSubmitButton( $dialog->addSubmitButton(
$is_new ? "Flag {$type_name}" : 'Save'); $is_new ? pht("Flag %s") : pht('Save'));
return id(new AphrontDialogResponse())->setDialog($dialog); return id(new AphrontDialogResponse())->setDialog($dialog);
} }

View File

@@ -33,7 +33,7 @@ final class PhabricatorFlagListController extends PhabricatorFlagController {
return $this->buildStandardPageResponse( return $this->buildStandardPageResponse(
$nav, $nav,
array( array(
'title' => 'Flags', 'title' => pht('Flags'),
)); ));
} }

View File

@@ -31,13 +31,13 @@ final class PhabricatorFlagsUIEventListener extends PhutilEventListener {
$flag_action = id(new PhabricatorActionView()) $flag_action = id(new PhabricatorActionView())
->setWorkflow(true) ->setWorkflow(true)
->setHref('/flag/delete/'.$flag->getID().'/') ->setHref('/flag/delete/'.$flag->getID().'/')
->setName('Remove '.$color.' Flag') ->setName(pht('Remove %s Flag', $color))
->setIcon('flag-'.$flag->getColor()); ->setIcon('flag-'.$flag->getColor());
} else { } else {
$flag_action = id(new PhabricatorActionView()) $flag_action = id(new PhabricatorActionView())
->setWorkflow(true) ->setWorkflow(true)
->setHref('/flag/edit/'.$object->getPHID().'/') ->setHref('/flag/edit/'.$object->getPHID().'/')
->setName('Flag For Later') ->setName(pht('Flag For Later'))
->setIcon('flag-ghost'); ->setIcon('flag-ghost');
if (!$user->isLoggedIn()) { if (!$user->isLoggedIn()) {

View File

@@ -41,7 +41,7 @@ final class PhabricatorFlagListView extends AphrontView {
array( array(
'class' => 'small grey', 'class' => 'small grey',
), ),
'Edit Flag')), pht('Edit Flag'))),
phabricator_form( phabricator_form(
$user, $user,
array( array(
@@ -54,7 +54,7 @@ final class PhabricatorFlagListView extends AphrontView {
array( array(
'class' => 'small grey', 'class' => 'small grey',
), ),
'Remove Flag')), pht('Remove Flag'))),
); );
} }
@@ -62,9 +62,9 @@ final class PhabricatorFlagListView extends AphrontView {
$table->setHeaders( $table->setHeaders(
array( array(
'', '',
'Flagged Object', pht('Flagged Object'),
'Note', pht('Note'),
'Flagged On', pht('Flagged On'),
'', '',
'', '',
)); ));
@@ -77,7 +77,7 @@ final class PhabricatorFlagListView extends AphrontView {
'narrow action', 'narrow action',
'narrow action', 'narrow action',
)); ));
$table->setNoDataString('No flags.'); $table->setNoDataString(pht('No flags.'));
return $table->render(); return $table->render();
} }