Skip to content

Commit

Permalink
Various translation improvements
Browse files Browse the repository at this point in the history
Summary: Depends on D14070.

Test Plan: Eyeball it.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, hach-que

Differential Revision: https://secure.phabricator.com/D14073
  • Loading branch information
Joshua Spence committed Nov 2, 2015
1 parent 495cb7a commit c35b564
Show file tree
Hide file tree
Showing 53 changed files with 217 additions and 142 deletions.
2 changes: 1 addition & 1 deletion scripts/symbols/import_repository_symbols.php
Expand Up @@ -102,7 +102,7 @@ function commit_symbols(
$repository->getPHID());
}

echo pht('Loading %s symbols...', new PhutilNumber(count($sql))), "\n";
echo pht('Loading %s symbols...', phutil_count($sql)), "\n";
foreach (array_chunk($sql, 128) as $chunk) {
queryfx(
$conn_w,
Expand Down
Expand Up @@ -109,7 +109,7 @@ public function processRequest() {
'only users with a verified email address at one of these %s '.
'allowed domain(s) will be able to register an account: %s',
$domains_link,
new PhutilNumber(count($domains_value)),
phutil_count($domains_value),
phutil_tag('strong', array(), implode(', ', $domains_value)));
} else {
$issues[] = pht(
Expand Down
Expand Up @@ -78,7 +78,7 @@ public function execute(PhutilArgumentParser $args) {
"%s\n",
pht(
'Found %s account(s) to refresh.',
new PhutilNumber(count($accounts))));
phutil_count($accounts)));
}

$providers = PhabricatorAuthProvider::getAllEnabledProviders();
Expand Down
Expand Up @@ -18,7 +18,7 @@ public function execute(PhutilArgumentParser $args) {
$this->log(
pht(
'Rebuilding %d resource source(s).',
new PhutilNumber(count($resources_map))));
phutil_count($resources_map)));

foreach ($resources_map as $name => $resources) {
$this->rebuildResources($resources);
Expand Down
Expand Up @@ -115,7 +115,7 @@ protected function executeChecks() {
$list_section = array(
pht(
'The configurations differ in the following %s way(s):',
new PhutilNumber(count($issues))),
phutil_count($issues)),
phutil_tag(
'ul',
array(),
Expand Down
Expand Up @@ -111,7 +111,7 @@ protected function executeChecks() {

$this
->newIssue('config.PATH.'.$digest)
->setName(pht('$PATH Component Unusable'))
->setName(pht('%s Component Unusable', '$PATH'))
->setSummary(
pht(
'A component of the configured PATH can not be used by '.
Expand Down
2 changes: 1 addition & 1 deletion src/applications/config/view/PhabricatorSetupIssueView.php
Expand Up @@ -387,7 +387,7 @@ private function renderPHPConfig(array $configs, $issue) {
array(),
pht(
'PHP also loaded these %s configuration file(s):',
new PhutilNumber(count($more_loc))));
phutil_count($more_loc)));
$info[] = phutil_tag(
'pre',
array(),
Expand Down
Expand Up @@ -29,14 +29,13 @@ protected function defineReturnType() {
protected function defineErrorTypes() {
return array(
'ERR_USAGE_NO_ROOM_ID' => pht(
'You must specify a room id or room phid to query transactions '.
'from.'),
'You must specify a room ID or room PHID to query transactions from.'),
'ERR_USAGE_ROOM_NOT_FOUND' => pht(
'room does not exist or logged in user can not see it.'),
'Room does not exist or logged in user can not see it.'),
'ERR_USAGE_ONLY_SELF_REMOVE' => pht(
'Only a user can remove themselves from a room.'),
'ERR_USAGE_NO_UPDATES' => pht(
'You must specify data that actually updates the conpherence.'),
'You must specify data that actually updates the Conpherence.'),
);
}

Expand Down
Expand Up @@ -325,26 +325,22 @@ private function renderRemovePersonDialogue(
$remove_person = $request->getStr('remove_person');
$participants = $conpherence->getParticipants();

$message = pht(
'Are you sure you want to leave this room?');
$message = pht('Are you sure you want to leave this room?');
$test_conpherence = clone $conpherence;
$test_conpherence->attachParticipants(array());
if (!PhabricatorPolicyFilter::hasCapability(
$user,
$test_conpherence,
PhabricatorPolicyCapability::CAN_VIEW)) {
if (count($participants) == 1) {
$message .= pht(
' The room will be inaccessible forever and ever.');
$message .= ' '.pht('The room will be inaccessible forever and ever.');
} else {
$message .= pht(
' Someone else in the room can add you back later.');
$message .= ' '.pht('Someone else in the room can add you back later.');
}
}
$body = phutil_tag(
'p',
array(
),
array(),
$message);

require_celerity_resource('conpherence-update-css');
Expand Down
Expand Up @@ -77,14 +77,14 @@ public function getTitle() {
count($rem));
} else if ($add) {
$title = pht(
'%s added %d files(s).',
'%s added %s files(s).',
$this->renderHandleLink($author_phid),
count($add));
phutil_count($add));
} else {
$title = pht(
'%s removed %d file(s).',
'%s removed %s file(s).',
$this->renderHandleLink($author_phid),
count($rem));
phutil_count($rem));
}
return $title;
break;
Expand Down
Expand Up @@ -226,7 +226,9 @@ final protected function launchDaemons(
// Retry without sudo
$console->writeOut(
"%s\n",
pht('sudo command failed. Starting daemon as current user.'));
pht(
'%s command failed. Starting daemon as current user.',
'sudo'));
$this->executeDaemonLaunchCommand(
$command,
$daemon_script_dir,
Expand Down Expand Up @@ -265,8 +267,9 @@ private function executeDaemonLaunchCommand(
if (preg_match('/sudo: a password is required/', $stderr)) {
throw new Exception(
pht(
'sudo exited with a zero exit code, but emitted output '.
'consistent with failure under OSX.'));
'%s exited with a zero exit code, but emitted output '.
'consistent with failure under OSX.',
'sudo'));
}
}
}
Expand Down
Expand Up @@ -218,21 +218,21 @@ public function getApplicationTransactionTitle(
return pht(
'%s updated JIRA issue(s): added %d %s; removed %d %s.',
$xaction->renderHandleLink($author_phid),
new PhutilNumber(count($add)),
phutil_count($add),
implode(', ', $add),
new PhutilNumber(count($rem)),
phutil_count($rem),
implode(', ', $rem));
} else if ($add) {
return pht(
'%s added %d JIRA issue(s): %s.',
$xaction->renderHandleLink($author_phid),
new PhutilNumber(count($add)),
phutil_count($add),
implode(', ', $add));
} else if ($rem) {
return pht(
'%s removed %d JIRA issue(s): %s.',
$xaction->renderHandleLink($author_phid),
new PhutilNumber(count($rem)),
phutil_count($rem),
implode(', ', $rem));
}

Expand Down
Expand Up @@ -125,7 +125,7 @@ protected function renderHarbormasterStatus(
)) + $groups;

foreach ($groups as $result => $group) {
$count = new PhutilNumber(count($group));
$count = phutil_count($group);
switch ($result) {
case ArcanistUnitTestResult::RESULT_PASS:
$note[] = pht('%s Passed Test(s)', $count);
Expand Down
Expand Up @@ -135,12 +135,12 @@ protected function renderActionEffectDescription($type, $data) {
case self::DO_ADD_REVIEWERS:
return pht(
'Added %s reviewer(s): %s.',
new PhutilNumber(count($data)),
phutil_count($data),
$this->renderHandleList($data));
case self::DO_ADD_BLOCKING_REVIEWERS:
return pht(
'Added %s blocking reviewer(s): %s.',
new PhutilNumber(count($data)),
phutil_count($data),
$this->renderHandleList($data));
}
}
Expand Down
Expand Up @@ -81,14 +81,14 @@ protected function processReceivedMail(
} else {
$subject = pht(
'Diff creation failed; see body for %s error(s).',
new PhutilNumber(count($errors)));
phutil_count($errors));
}
$body = new PhabricatorMetaMTAMailBody();
$body->addRawSection($subject);
if (count($diffs)) {
$text_body = '';
$html_body = array();
$body_label = pht('%s DIFF LINK(S)', new PhutilNumber(count($diffs)));
$body_label = pht('%s DIFF LINK(S)', phutil_count($diffs));
foreach ($diffs as $filename => $diff_uri) {
$text_body .= $filename.': '.$diff_uri."\n";
$html_body[] = phutil_tag(
Expand All @@ -105,7 +105,7 @@ protected function processReceivedMail(

if (count($errors)) {
$body_section = new PhabricatorMetaMTAMailSection();
$body_label = pht('%s ERROR(S)', new PhutilNumber(count($errors)));
$body_label = pht('%s ERROR(S)', phutil_count($errors));
foreach ($errors as $error) {
$body_section->addFragment($error);
}
Expand Down
Expand Up @@ -68,7 +68,7 @@ protected function renderActionEffectDescription($type, $data) {
case self::DO_ADD_AUDITORS:
return pht(
'Added %s auditor(s): %s.',
new PhutilNumber(count($data)),
phutil_count($data),
$this->renderHandleList($data));
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/applications/diviner/atomizer/DivinerPHPAtomizer.php
Expand Up @@ -152,8 +152,8 @@ private function parseParams(DivinerAtom $atom, AASTNode $func) {
$atom->addWarning(
pht(
'This call takes %s parameter(s), but only %s are documented.',
new PhutilNumber(count($params)),
new PhutilNumber(count($docs))));
phutil_count($params),
phutil_count($docs)));
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/applications/diviner/publisher/DivinerPublisher.php
Expand Up @@ -140,14 +140,14 @@ final public function publishAtoms(array $hashes) {
"%s\n",
pht(
'Deleting %s document(s).',
new PhutilNumber(count($deleted))));
phutil_count($deleted)));
$this->deleteDocumentsByHash($deleted);

$console->writeOut(
"%s\n",
pht(
'Creating %s document(s).',
new PhutilNumber(count($created))));
phutil_count($created)));
$this->createDocumentsByHash($created);
}

Expand Down
16 changes: 8 additions & 8 deletions src/applications/diviner/workflow/DivinerGenerateWorkflow.php
Expand Up @@ -69,7 +69,7 @@ public function execute(PhutilArgumentParser $args) {
'.book',
'--book <book>'));
} else {
$this->log(pht('Found %s book(s).', new PhutilNumber(count($books))));
$this->log(pht('Found %s book(s).', phutil_count($books)));
}
}

Expand Down Expand Up @@ -224,26 +224,26 @@ private function buildAtomCache() {
$this->log(
pht(
'Found %s file(s) in project.',
new PhutilNumber(count($file_hashes))));
phutil_count($file_hashes)));

$this->deleteDeadAtoms($file_hashes);
$atomize = $this->getFilesToAtomize($file_hashes);
$this->log(
pht(
'Found %s unatomized, uncached file(s).',
new PhutilNumber(count($atomize))));
phutil_count($atomize)));

$file_atomizers = $this->getAtomizersForFiles($atomize);
$this->log(
pht(
'Found %s file(s) to atomize.',
new PhutilNumber(count($file_atomizers))));
phutil_count($file_atomizers)));

$futures = $this->buildAtomizerFutures($file_atomizers);
$this->log(
pht(
'Atomizing %s file(s).',
new PhutilNumber(count($file_atomizers))));
phutil_count($file_atomizers)));

if ($futures) {
$this->resolveAtomizerFutures($futures, $file_hashes);
Expand Down Expand Up @@ -452,7 +452,7 @@ private function buildGraphCache() {
$this->log(
pht(
'Found %s obsolete atom(s) in graph.',
new PhutilNumber(count($del_atoms))));
phutil_count($del_atoms)));

foreach ($del_atoms as $nhash => $shash) {
$atom_cache->deleteSymbol($nhash);
Expand All @@ -466,7 +466,7 @@ private function buildGraphCache() {
$this->log(
pht(
'Found %s new atom(s) in graph.',
new PhutilNumber(count($new_atoms))));
phutil_count($new_atoms)));

foreach ($new_atoms as $nhash => $ignored) {
$shash = $this->computeSymbolHash($nhash);
Expand Down Expand Up @@ -505,7 +505,7 @@ private function buildGraphCache() {
$this->log(
pht(
'Found %s affected atoms.',
new PhutilNumber(count($dirty_nhashes))));
phutil_count($dirty_nhashes)));

foreach ($dirty_nhashes as $nhash => $ignored) {
$atom_cache->addGraph($nhash, $this->computeGraphHash($nhash));
Expand Down
Expand Up @@ -96,8 +96,11 @@ public function renderContextualDescription(
}

$out = array();
$out[] = pht('| Workspace ID | Workspace Name |');
$out[] = '| ------------ | -------------- |';
$out[] = sprintf(
'| %s | %s |',
pht('Workspace ID'),
pht('Workspace Name'));
$out[] = '| ------------ | -------------- |';
foreach ($workspaces as $workspace) {
$out[] = sprintf('| `%s` | `%s` |', $workspace['id'], $workspace['name']);
}
Expand Down
2 changes: 1 addition & 1 deletion src/applications/files/storage/PhabricatorFile.php
Expand Up @@ -557,7 +557,7 @@ public static function newFromFileDownload($uri, array $params = array()) {
'Failed to fetch remote URI "%s" after following %s redirect(s) '.
'(%s): %s',
$uri,
new PhutilNumber(count($redirects)),
phutil_count($redirects),
implode(' > ', array_keys($redirects)),
$ex->getMessage()),
$ex);
Expand Down
Expand Up @@ -37,7 +37,7 @@ public function getMethodDescription() {
$unit_spec = HarbormasterBuildUnitMessage::getParameterSpec();
foreach ($unit_spec as $key => $parameter) {
$type = idx($parameter, 'type');
$type = str_replace('|', pht(' or '), $type);
$type = str_replace('|', ' '.pht('or').' ', $type);
$description = idx($parameter, 'description');
$rows[] = "| `{$key}` | //{$type}// | {$description} |";
}
Expand All @@ -61,7 +61,7 @@ public function getMethodDescription() {
$lint_spec = HarbormasterBuildLintMessage::getParameterSpec();
foreach ($lint_spec as $key => $parameter) {
$type = idx($parameter, 'type');
$type = str_replace('|', pht(' or '), $type);
$type = str_replace('|', ' '.pht('or').' ', $type);
$description = idx($parameter, 'description');
$rows[] = "| `{$key}` | //{$type}// | {$description} |";
}
Expand Down
Expand Up @@ -377,7 +377,7 @@ private function buildLog(
array(
pht(
'%s empty logs are hidden.',
new PhutilNumber(count($empty_logs))),
phutil_count($empty_logs)),
' ',
javelin_tag(
'a',
Expand Down
Expand Up @@ -231,7 +231,10 @@ private function renderBuildVariablesTable() {
'The following variables can be used in most fields. '.
'To reference a variable, use `%s` in a field.',
'${name}');
$rows[] = pht('| Variable | Description |');
$rows[] = sprintf(
'| %s | %s |',
pht('Variable'),
pht('Description'));
$rows[] = '|---|---|';
foreach ($variables as $name => $description) {
$rows[] = '| `'.$name.'` | '.$description.' |';
Expand Down

0 comments on commit c35b564

Please sign in to comment.