1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 00:42:41 +01:00

Fix translations

Summary: Theses are sort of silly anyway since they should all have the actor in them rather than being sentence fragments, but make them work OK for English at least. See D3013.

Test Plan:
Ran:

  echo pht('added %d dependencie(s): %s', 1, 'derp')."\n";
  echo pht('added %d dependencie(s): %s', 2, 'derp, derp')."\n";

Got:

  added dependency: derp
  added dependencies: derp, derp

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Differential Revision: https://secure.phabricator.com/D3015
This commit is contained in:
epriestley 2012-07-19 11:45:08 -07:00
parent 43b94a6f95
commit ba4fb05d91
2 changed files with 35 additions and 30 deletions

View file

@ -661,7 +661,8 @@ final class ManiphestTransactionDetailView extends ManiphestView {
/**
* @task strings
*/
private function getEdgeEmailTitle($type, $count) {
private function getEdgeEmailTitle($type, array $list) {
$count = count($list);
switch ($type) {
case PhabricatorEdgeConfig::TYPE_TASK_DEPENDS_ON_TASK:
return pht('DEPENDS ON %d TASK(S)', $count);
@ -731,16 +732,17 @@ final class ManiphestTransactionDetailView extends ManiphestView {
*/
private function getEdgeAddList($type, array $add) {
$list = $this->renderHandles(array_keys($add));
$count = count($add);
switch ($type) {
case PhabricatorEdgeConfig::TYPE_TASK_DEPENDS_ON_TASK:
return pht('added %d dependencie(s): %s', $add, $list);
return pht('added %d dependencie(s): %s', $count, $list);
case PhabricatorEdgeConfig::TYPE_TASK_DEPENDED_ON_BY_TASK:
return pht('added %d dependent task(s): %s', $add, $list);
return pht('added %d dependent task(s): %s', $count, $list);
case PhabricatorEdgeConfig::TYPE_TASK_HAS_COMMIT:
return pht('added %d commit(s): %s', $add, $list);
return pht('added %d commit(s): %s', $count, $list);
default:
return pht('added %d object(s): %s', $add, $list);
return pht('added %d object(s): %s', $count, $list);
}
}
@ -750,16 +752,17 @@ final class ManiphestTransactionDetailView extends ManiphestView {
*/
private function getEdgeRemList($type, array $rem) {
$list = $this->renderHandles(array_keys($rem));
$count = count($rem);
switch ($type) {
case PhabricatorEdgeConfig::TYPE_TASK_DEPENDS_ON_TASK:
return pht('removed %d dependencie(s): %s', $rem, $list);
return pht('removed %d dependencie(s): %s', $count, $list);
case PhabricatorEdgeConfig::TYPE_TASK_DEPENDED_ON_BY_TASK:
return pht('removed %d dependent task(s): %s', $rem, $list);
return pht('removed %d dependent task(s): %s', $count, $list);
case PhabricatorEdgeConfig::TYPE_TASK_HAS_COMMIT:
return pht('removed %d commit(s): %s', $rem, $list);
return pht('removed %d commit(s): %s', $count, $list);
default:
return pht('removed %d object(s): %s', $rem, $list);
return pht('removed %d object(s): %s', $count, $list);
}
}
@ -770,39 +773,41 @@ final class ManiphestTransactionDetailView extends ManiphestView {
private function getEdgeEditList($type, array $add, array $rem) {
$add_list = $this->renderHandles(array_keys($add));
$rem_list = $this->renderHandles(array_keys($rem));
$add_count = count($add_list);
$rem_count = count($rem_list);
switch ($type) {
case PhabricatorEdgeConfig::TYPE_TASK_DEPENDS_ON_TASK:
return pht(
'changed %d dependencie(s), added %d: %s; removed %d: %s',
count($add) + count($rem),
$add,
$add_count + $rem_count,
$add_count,
$add_list,
$rem,
$rem_count,
$rem_list);
case PhabricatorEdgeConfig::TYPE_TASK_DEPENDED_ON_BY_TASK:
return pht(
'changed %d dependent task(s), added %d: %s; removed %d: %s',
count($add) + count($rem),
$add,
$add_count + $rem_count,
$add_count,
$add_list,
$rem,
$rem_count,
$rem_list);
case PhabricatorEdgeConfig::TYPE_TASK_HAS_COMMIT:
return pht(
'changed %d commit(s), added %d: %s; removed %d: %s',
count($add) + count($rem),
$add,
$add_count + $rem_count,
$add_count,
$add_list,
$rem,
$rem_count,
$rem_list);
default:
return pht(
'changed %d object(s), added %d: %s; removed %d: %s',
count($add) + count($rem),
$add,
$add_count + $rem_count,
$add_count,
$add_list,
$rem,
$rem_count,
$rem_list);
}
}

View file

@ -50,41 +50,41 @@ abstract class PhabricatorBaseEnglishTranslation
'%d line(s)' => array('%d line', '%d lines'),
'added %d commit(s): %s' => array(
'added commits: %2$s',
'added commit: %2$s',
'added commits: %2$s',
),
'removed %d commit(s): %s' => array(
'removed commits: %2$s',
'removed commit: %2$s',
'removed commits: %2$s',
),
'changed %d commit(s), added %d: %s; removed %d: %s' =>
'changed commits, added: %3$s; removed: %5$s',
'ATTACHED %d COMMIT(S)' => array(
'ATTACHED COMMITS',
'ATTACHED COMMIT',
'ATTACHED COMMITS',
),
'added %d dependencie(s): %s' => array(
'added dependencies: %2$s',
'added dependency: %2$s',
'added dependencies: %2$s',
),
'added %d dependent task(s): %s' => array(
'added dependent tasks: %2$s',
'added dependent task: %2$s',
'added dependent tasks: %2$s',
),
'removed %d dependencie(s): %s' => array(
'removed dependencies: %2$s',
'removed dependency: %2$s',
'removed dependencies: %2$s',
),
'removed %d dependent task(s): %s' => array(
'removed dependent tasks: %2$s',
'removed dependent task: %2$s',
'removed dependent tasks: %2$s',
),
'changed %d dependencie(s), added %d: %s; removed %d: %s' =>
@ -94,13 +94,13 @@ abstract class PhabricatorBaseEnglishTranslation
'changed dependent tasks, added: %3$s; removed: %5$s',
'DEPENDENT %d TASK(s)' => array(
'DEPENDENT TASKS',
'DEPENDENT TASK',
'DEPENDENT TASKS',
),
'DEPENDS ON %d TASK(S)' => array(
'DEPENDS ON TASKS',
'DEPENDS ON TASK',
'DEPENDS ON TASKS',
),
);