phtize all the things

Summary: `pht`ize a whole bunch of strings in rP.

Test Plan: Intense eyeballing.

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: hach-que, Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D12797
This commit is contained in:
Joshua Spence
2015-05-22 17:27:56 +10:00
parent d3268aecc2
commit 36e2d02d6e
928 changed files with 5267 additions and 4239 deletions

View File

@@ -98,7 +98,9 @@ final class DiffusionBrowseDirectoryController
array(
'title' => array(
nonempty(basename($drequest->getPath()), '/'),
$drequest->getRepository()->getCallsign().' Repository',
pht(
'%s Repository',
$drequest->getRepository()->getCallsign()),
),
));
}

View File

@@ -124,13 +124,15 @@ final class DiffusionBrowseFileController extends DiffusionBrowseController {
switch ($follow) {
case 'first':
$notice->appendChild(
pht('Unable to continue tracing the history of this file because '.
'this commit is the first commit in the repository.'));
pht(
'Unable to continue tracing the history of this file because '.
'this commit is the first commit in the repository.'));
break;
case 'created':
$notice->appendChild(
pht('Unable to continue tracing the history of this file because '.
'this commit created the file.'));
pht(
'Unable to continue tracing the history of this file because '.
'this commit created the file.'));
break;
}
$content[] = $notice;
@@ -142,7 +144,8 @@ final class DiffusionBrowseFileController extends DiffusionBrowseController {
$notice->setSeverity(PHUIInfoView::SEVERITY_NOTICE);
$notice->setTitle(pht('File Renamed'));
$notice->appendChild(
pht("File history passes through a rename from '%s' to '%s'.",
pht(
"File history passes through a rename from '%s' to '%s'.",
$drequest->getPath(), $renamed));
$content[] = $notice;
}

View File

@@ -33,7 +33,9 @@ final class DiffusionBrowseSearchController extends DiffusionBrowseController {
array(
'title' => array(
nonempty(basename($drequest->getPath()), '/'),
$drequest->getRepository()->getCallsign().' Repository',
pht(
'%s Repository',
$drequest->getRepository()->getCallsign()),
),
));
}

View File

@@ -39,6 +39,6 @@ final class DiffusionCommitBranchesController extends DiffusionController {
}
return id(new AphrontAjaxResponse())
->setContent($branch_links ? implode(', ', $branch_links) : 'None');
->setContent($branch_links ? implode(', ', $branch_links) : pht('None'));
}
}

View File

@@ -83,10 +83,12 @@ final class DiffusionCommitController extends DiffusionController {
$error_panel->setTitle(pht('Commit Not Tracked'));
$error_panel->setSeverity(PHUIInfoView::SEVERITY_WARNING);
$error_panel->appendChild(
pht("This Diffusion repository is configured to track only one ".
"subdirectory of the entire Subversion repository, and this commit ".
"didn't affect the tracked subdirectory ('%s'), so no ".
"information is available.", $subpath));
pht(
"This Diffusion repository is configured to track only one ".
"subdirectory of the entire Subversion repository, and this commit ".
"didn't affect the tracked subdirectory ('%s'), so no ".
"information is available.",
$subpath));
$content[] = $error_panel;
} else {
$engine = PhabricatorMarkupEngine::newDifferentialMarkupEngine();
@@ -238,7 +240,7 @@ final class DiffusionCommitController extends DiffusionController {
$change_panel = new PHUIObjectBoxView();
$header = new PHUIHeaderView();
$header->setHeader('Changes ('.number_format($count).')');
$header->setHeader(pht('Changes (%d', number_format($count)));
$change_panel->setID('toc');
if ($count > self::CHANGES_LIMIT && !$show_all_details) {
@@ -253,7 +255,7 @@ final class DiffusionCommitController extends DiffusionController {
$warning_view = id(new PHUIInfoView())
->setSeverity(PHUIInfoView::SEVERITY_WARNING)
->setTitle('Very Large Commit')
->setTitle(pht('Very Large Commit'))
->appendChild(
pht('This commit is very large. Load each file individually.'));
@@ -280,7 +282,7 @@ final class DiffusionCommitController extends DiffusionController {
$vcs_supports_directory_changes = false;
break;
default:
throw new Exception('Unknown VCS.');
throw new Exception(pht('Unknown VCS.'));
}
$references = array();
@@ -901,8 +903,8 @@ final class DiffusionCommitController extends DiffusionController {
$caption->setSeverity(PHUIInfoView::SEVERITY_NOTICE);
$caption->appendChild(
pht(
'This commit merges a very large number of changes. Only the first '.
'%s are shown.',
'This commit merges a very large number of changes. '.
'Only the first %s are shown.',
new PhutilNumber($limit)));
}

View File

@@ -11,7 +11,7 @@ abstract class DiffusionController extends PhabricatorController {
protected function getDiffusionRequest() {
if (!$this->diffusionRequest) {
throw new Exception('No Diffusion request object!');
throw new Exception(pht('No Diffusion request object!'));
}
return $this->diffusionRequest;
}

View File

@@ -75,9 +75,11 @@ final class DiffusionExternalController extends DiffusionController {
->appendChild(phutil_tag(
'p',
array(),
pht('This external (%s) does not appear in any tracked '.
'repository. It may exist in an untracked repository that '.
'Diffusion does not know about.', $desc)));
pht(
'This external (%s) does not appear in any tracked '.
'repository. It may exist in an untracked repository that '.
'Diffusion does not know about.',
$desc)));
} else if (count($commits) == 1) {
$commit = head($commits);
$repo = $repositories[$commit->getRepositoryID()];

View File

@@ -168,6 +168,4 @@ final class DiffusionHistoryController extends DiffusionController {
return $view;
}
}

View File

@@ -33,7 +33,7 @@ final class DiffusionInlineCommentController
PhabricatorRepository::TABLE_PATH,
$path_id);
if (!$path) {
throw new Exception('Invalid path ID!');
throw new Exception(pht('Invalid path ID!'));
}
return id(new PhabricatorAuditInlineComment())
@@ -55,7 +55,7 @@ final class DiffusionInlineCommentController
$inline = $this->loadComment($id);
if (!$this->canEditInlineComment($user, $inline)) {
throw new Exception('That comment is not editable!');
throw new Exception(pht('That comment is not editable!'));
}
return $inline;
}

View File

@@ -58,7 +58,7 @@ final class DiffusionPathValidateController extends DiffusionController {
if ($branch) {
$message = pht('Not found in %s', $branch);
} else {
$message = pht('Not found at HEAD');
$message = pht('Not found at %s', 'HEAD');
}
} else {
$message = pht('OK');

View File

@@ -60,8 +60,7 @@ final class DiffusionRepositoryController extends DiffusionController {
}
} else {
$empty_title = pht('Empty Repository');
$empty_message = pht(
'This repository does not have any commits yet.');
$empty_message = pht('This repository does not have any commits yet.');
}
}
@@ -391,9 +390,9 @@ final class DiffusionRepositoryController extends DiffusionController {
$button->setTag('a');
$button->setIcon($icon);
$button->setHref($drequest->generateURI(
array(
'action' => 'branches',
)));
array(
'action' => 'branches',
)));
$header->addActionLink($button);
$panel->setHeader($header);

View File

@@ -71,7 +71,7 @@ final class DiffusionRepositoryCreateController
$cancel_uri = $this->getApplicationURI('new/');
break;
default:
throw new Exception('Invalid edit operation!');
throw new Exception(pht('Invalid edit operation!'));
}
$form = id(new PHUIPagedFormView())
@@ -483,7 +483,7 @@ final class DiffusionRepositoryCreateController
$is_mercurial = true;
break;
default:
throw new Exception('Unsupported VCS!');
throw new Exception(pht('Unsupported VCS!'));
}
$has_local = ($is_git || $is_mercurial);
@@ -527,7 +527,7 @@ final class DiffusionRepositoryCreateController
"repository, use the //Import Only// option at the end of this ".
"workflow.)");
} else {
throw new Exception('Unsupported VCS!');
throw new Exception(pht('Unsupported VCS!'));
}
$page->addRemarkupInstructions($instructions, 'remoteURI');
@@ -623,7 +623,7 @@ final class DiffusionRepositoryCreateController
$remote_uri),
'credential');
} else {
throw new Exception('Unknown URI protocol!');
throw new Exception(pht('Unknown URI protocol!'));
}
if ($provides_type) {
@@ -734,8 +734,7 @@ final class DiffusionRepositoryCreateController
->setAdjustFormPageCallback(array($this, 'adjustPolicyPage'))
->setUser($viewer)
->addRemarkupInstructions(
pht(
'Select access policies for this repository.'))
pht('Select access policies for this repository.'))
->addControl($view_policy)
->addControl($edit_policy)
->addControl($push_policy);

View File

@@ -75,8 +75,7 @@ final class DiffusionRepositoryEditActionsController
"new commits. You can disable publishing for this repository by ".
"turning off **Notify/Publish**. This will disable notifications, ".
"feed, and Herald (including audits and build plans) for this ".
"repository.".
"\n\n".
"repository.\n\n".
"When Phabricator discovers a new commit, it can automatically ".
"close associated revisions and tasks. If you don't want ".
"Phabricator to close objects when it discovers new commits in ".

View File

@@ -152,19 +152,25 @@ final class DiffusionRepositoryEditBasicController
private function getReadmeInstructions() {
return pht(<<<EOTEXT
You can also create a `README` file at the repository root (or in any
You can also create a `%s` file at the repository root (or in any
subdirectory) to provide information about the repository. These formats are
supported:
| File Name | Rendered As... |
|-----------------|----------------|
| `README` | Plain Text |
| `README.txt` | Plain Text |
| `README.remarkup` | Remarkup |
| `README.md` | Remarkup |
| `README.rainbow` | \xC2\xA1Fiesta! |
| File Name | Rendered As... |
|-----------|-----------------|
| `%s` | Plain Text |
| `%s` | Plain Text |
| `%s` | Remarkup |
| `%s` | Remarkup |
| `%s` | \xC2\xA1Fiesta! |
EOTEXT
);
,
'README',
'README',
'README.txt',
'README.remarkup',
'README.md',
'README.rainbow');
}
}

View File

@@ -126,20 +126,20 @@ final class DiffusionRepositoryEditBranchesController
'develop',
'release',
),
pht('Select master, develop, and release.'),
pht('Select %s, %s, and %s.', 'master', 'develop', 'release'),
);
$rows[] = array(
array(
'master',
'regexp(/^release-/)',
),
pht('Select master, and all branches which start with "release-".'),
pht('Select master, and all branches which start with "%s".', 'release-'),
);
$rows[] = array(
array(
'regexp(/^(?!temp-)/)',
),
pht('Select all branches which do not start with "temp-".'),
pht('Select all branches which do not start with "%s".', 'temp-'),
);
foreach ($rows as $k => $row) {
@@ -167,8 +167,7 @@ final class DiffusionRepositoryEditBranchesController
$form = id(new AphrontFormView())
->setUser($viewer)
->appendRemarkupInstructions(
pht(
'You can choose a **Default Branch** for viewing this repository.'))
pht('You can choose a **Default Branch** for viewing this repository.'))
->appendChild(
id(new AphrontFormTextControl())
->setName('default')
@@ -196,7 +195,8 @@ final class DiffusionRepositoryEditBranchesController
pht(
'When specifying branches, you should enter one branch name per '.
'line. You can use regular expressions to match branches by '.
'wrapping an expression in `regexp(...)`. For example:'))
'wrapping an expression in `%s`. For example:',
'regexp(...)'))
->appendChild(
id(new AphrontFormMarkupControl())
->setValue($example_table))

View File

@@ -30,8 +30,9 @@ final class DiffusionRepositoryEditDeleteController
$command = csprintf(
'phabricator/ $ ./bin/remove destroy %R',
$repository->getMonogram());
$text_2 = pht('Repositories touch many objects and as such deletes are '.
'prohibitively expensive to run from the web UI.');
$text_2 = pht(
'Repositories touch many objects and as such deletes are '.
'prohibitively expensive to run from the web UI.');
$body = phutil_tag(
'div',
array(

View File

@@ -104,8 +104,7 @@ See [[%s | UTF-8 and Character Encoding]] for more information on how
Phabricator handles text encodings.
EOT
,
PhabricatorEnv::getDoclink(
'User Guide: UTF-8 and Character Encoding'));
PhabricatorEnv::getDoclink('User Guide: UTF-8 and Character Encoding'));
}
}

View File

@@ -819,8 +819,9 @@ final class DiffusionRepositoryEditMainController
->setTarget(
pht('Missing Binary %s', phutil_tag('tt', array(), $binary)))
->setNote(pht(
'Unable to find this binary in `environment.append-paths`. '.
'Unable to find this binary in `%s`. '.
'You need to configure %s and include %s.',
'environment.append-paths',
$this->getEnvConfigLink(),
$path)));
}

View File

@@ -57,10 +57,11 @@ final class DiffusionRepositoryEditStorageController
->appendRemarkupInstructions(
pht(
"You can not adjust the local path for this repository from the ".
"web interface. To edit it, run this command:\n\n".
" phabricator/ $ ./bin/repository edit %s --as %s --local-path ...",
$repository->getCallsign(),
$user->getUsername()))
"web interface. To edit it, run this command:\n\n %s",
sprintf(
'phabricator/ $ ./bin/repository edit %s --as %s --local-path ...',
$repository->getCallsign(),
$user->getUsername())))
->appendChild(
id(new AphrontFormSubmitControl())
->addCancelButton($edit_uri, pht('Done')));

View File

@@ -84,11 +84,11 @@ final class DiffusionRepositoryEditSubversionController
pht(
"You can set the **Repository UUID**, which will help Phabriactor ".
"provide better context in some cases. You can find the UUID of a ".
"repository by running `svn info`.".
"\n\n".
"repository by running `%s`.\n\n".
"If you want to import only part of a repository, like `trunk/`, ".
"you can set a path in **Import Only**. Phabricator will ignore ".
"commits which do not affect this path."))
"commits which do not affect this path.",
'svn info'))
->appendChild(
id(new AphrontFormTextControl())
->setName('uuid')

View File

@@ -53,11 +53,11 @@ final class DiffusionRepositoryNewController extends DiffusionController {
'import',
pht('Import an Existing External Repository'),
pht(
'Import a repository hosted somewhere else, like GitHub, '.
'Bitbucket, or your organization\'s existing servers. '.
'Phabricator will read changes from the repository but will '.
'not host or manage it. The authoritative master version of '.
'the repository will stay where it is now.')))
"Import a repository hosted somewhere else, like GitHub, ".
"Bitbucket, or your organization's existing servers. ".
"Phabricator will read changes from the repository but will ".
"not host or manage it. The authoritative master version of ".
"the repository will stay where it is now.")))
->appendChild(
id(new AphrontFormSubmitControl())
->setValue(pht('Continue'))

View File

@@ -342,7 +342,11 @@ final class DiffusionServeController extends DiffusionController {
// resolve the binary first.
$bin = Filesystem::resolveBinary('git-http-backend');
if (!$bin) {
throw new Exception('Unable to find `git-http-backend` in PATH!');
throw new Exception(
pht(
'Unable to find `%s` in %s!',
'git-http-backend',
'$PATH'));
}
$env = array(
@@ -485,7 +489,11 @@ final class DiffusionServeController extends DiffusionController {
$bin = Filesystem::resolveBinary('hg');
if (!$bin) {
throw new Exception('Unable to find `hg` in PATH!');
throw new Exception(
pht(
'Unable to find `%s` in %s!',
'hg',
'$PATH'));
}
$env = $this->getCommonEnvironment($viewer);