Page MenuHomePhabricator

D12797.id30762.diff
No OneTemporary

D12797.id30762.diff

This file is larger than 256 KB, so syntax highlighting was skipped.
diff --git a/resources/sql/patches/liskcounters.php b/resources/sql/patches/liskcounters.php
--- a/resources/sql/patches/liskcounters.php
+++ b/resources/sql/patches/liskcounters.php
@@ -1,6 +1,6 @@
<?php
-// Switch PhabricatorWorkerActiveTask from autoincrement IDs to counter IDs.
+// Switch PhabricatorWorkerActiveTask from auto-increment IDs to counter IDs.
// Set the initial counter ID to be larger than any known task ID.
$active_table = new PhabricatorWorkerActiveTask();
diff --git a/scripts/__init_script__.php b/scripts/__init_script__.php
--- a/scripts/__init_script__.php
+++ b/scripts/__init_script__.php
@@ -11,7 +11,7 @@
@include_once 'libphutil/scripts/__init_script__.php';
if (!@constant('__LIBPHUTIL__')) {
echo "ERROR: Unable to load libphutil. Update your PHP 'include_path' to ".
- "include the parent directory of libphutil/.\n";
+ "include the parent directory of libphutil/.\n";
exit(1);
}
diff --git a/scripts/aphront/aphrontpath.php b/scripts/aphront/aphrontpath.php
--- a/scripts/aphront/aphrontpath.php
+++ b/scripts/aphront/aphrontpath.php
@@ -5,8 +5,10 @@
require_once $root.'/scripts/__init_script__.php';
if ($argc !== 2 || $argv[1] === '--help') {
- echo "Usage: aphrontpath.php <url>\n";
- echo "Purpose: Print controller which will process passed <url>.\n";
+ echo pht('Usage: %s', 'aphrontpath.php <url>')."\n";
+ echo pht(
+ "Purpose: Print controller which will process passed %s.\n",
+ '<url>');
exit(1);
}
diff --git a/scripts/celerity/generate_sprites.php b/scripts/celerity/generate_sprites.php
--- a/scripts/celerity/generate_sprites.php
+++ b/scripts/celerity/generate_sprites.php
@@ -16,7 +16,7 @@
array(
array(
'name' => 'force',
- 'help' => 'Force regeneration even if sources have not changed.',
+ 'help' => pht('Force regeneration even if sources have not changed.'),
),
));
@@ -39,8 +39,10 @@
if ($err) {
$have_optipng = false;
echo phutil_console_format(
- "<bg:red> WARNING </bg> `optipng` not found in PATH.\n".
- "Sprites will not be optimized! Install `optipng`!\n");
+ "<bg:red> %s </bg> %s\n%s\n",
+ pht('WARNING'),
+ pht('`%s` not found in PATH.', 'optipng'),
+ pht('Sprites will not be optimized! Install `%s`!', 'optipng'));
} else {
$have_optipng = true;
}
@@ -75,10 +77,10 @@
$sheet->generateImage($full_path, $scale);
if ($have_optipng) {
- echo "Optimizing...\n";
+ echo pht('Optimizing...')."\n";
phutil_passthru('optipng -o7 -clobber %s', $full_path);
}
}
}
-echo "Done.\n";
+echo pht('Done.')."\n";
diff --git a/scripts/mail/mail_handler.php b/scripts/mail/mail_handler.php
--- a/scripts/mail/mail_handler.php
+++ b/scripts/mail/mail_handler.php
@@ -88,7 +88,7 @@
$received->processReceivedMail();
} catch (Exception $e) {
$received
- ->setMessage('EXCEPTION: '.$e->getMessage())
+ ->setMessage(pht('EXCEPTION: %s', $e->getMessage()))
->save();
throw $e;
diff --git a/scripts/repository/commit_hook.php b/scripts/repository/commit_hook.php
--- a/scripts/repository/commit_hook.php
+++ b/scripts/repository/commit_hook.php
@@ -61,7 +61,9 @@
$username = getenv(DiffusionCommitHookEngine::ENV_USER);
if (!strlen($username)) {
throw new Exception(
- pht('usage: %s should be defined!', DiffusionCommitHookEngine::ENV_USER));
+ pht(
+ 'Usage: %s should be defined!',
+ DiffusionCommitHookEngine::ENV_USER));
}
if ($repository->isHg()) {
diff --git a/scripts/repository/rebuild_summaries.php b/scripts/repository/rebuild_summaries.php
--- a/scripts/repository/rebuild_summaries.php
+++ b/scripts/repository/rebuild_summaries.php
@@ -50,4 +50,4 @@
idx($maxes, $repository_id, 0));
echo '.';
}
-echo "\ndone.\n";
+echo "\n".pht('Done.')."\n";
diff --git a/scripts/repository/save_lint.php b/scripts/repository/save_lint.php
--- a/scripts/repository/save_lint.php
+++ b/scripts/repository/save_lint.php
@@ -17,35 +17,38 @@
->parse(array(
array(
'name' => 'all',
- 'help' =>
+ 'help' => pht(
'Discover problems in the whole repository instead of just changes '.
- 'since the last run.',
+ 'since the last run.'),
),
array(
'name' => 'arc',
'param' => 'path',
'default' => 'arc',
- 'help' => 'Path to Arcanist executable.',
+ 'help' => pht('Path to Arcanist executable.'),
),
array(
'name' => 'severity',
'param' => 'string',
'default' => ArcanistLintSeverity::SEVERITY_ADVICE,
- 'help' => 'Minimum severity, one of ArcanistLintSeverity constants.',
+ 'help' => pht(
+ 'Minimum severity, one of %s constants.',
+ 'ArcanistLintSeverity'),
),
array(
'name' => 'chunk-size',
'param' => 'number',
'default' => 256,
- 'help' => 'Number of paths passed to `arc` at once.',
+ 'help' => pht('Number of paths passed to `%s` at once.', 'arc'),
),
array(
'name' => 'blame',
- 'help' => 'Assign lint errors to authors who last modified the line.',
+ 'help' => pht(
+ 'Assign lint errors to authors who last modified the line.'),
),
));
-echo "Saving lint errors to database...\n";
+echo pht('Saving lint errors to database...')."\n";
$count = id(new DiffusionLintSaveRunner())
->setAll($args->getArg('all', false))
@@ -55,4 +58,4 @@
->setNeedsBlame($args->getArg('blame'))
->run('.');
-echo "\nProcessed {$count} files.\n";
+echo "\n".pht('Processed %d files.', $count)."\n";
diff --git a/scripts/sql/manage_storage.php b/scripts/sql/manage_storage.php
--- a/scripts/sql/manage_storage.php
+++ b/scripts/sql/manage_storage.php
@@ -34,35 +34,38 @@
array(
'name' => 'force',
'short' => 'f',
- 'help' => 'Do not prompt before performing dangerous operations.',
+ 'help' => pht(
+ 'Do not prompt before performing dangerous operations.'),
),
array(
'name' => 'user',
'short' => 'u',
'param' => 'username',
'default' => $default_user,
- 'help' => "Connect with __username__ instead of the configured ".
- "default ('{$default_user}').",
+ 'help' => pht(
+ "Connect with __username__ instead of the configured default ('%s').",
+ $default_user),
),
array(
'name' => 'password',
'short' => 'p',
'param' => 'password',
- 'help' => 'Use __password__ instead of the configured default.',
+ 'help' => pht('Use __password__ instead of the configured default.'),
),
array(
'name' => 'namespace',
'param' => 'name',
'default' => $default_namespace,
- 'help' => "Use namespace __namespace__ instead of the configured ".
- "default ('{$default_namespace}'). This is an advanced ".
- "feature used by unit tests; you should not normally ".
- "use this flag.",
+ 'help' => pht(
+ "Use namespace __namespace__ instead of the configured ".
+ "default ('%s'). This is an advanced feature used by unit tests; ".
+ "you should not normally use this flag.",
+ $default_namespace),
),
array(
'name' => 'dryrun',
- 'help' => 'Do not actually change anything, just show what would be '.
- 'changed.',
+ 'help' => pht(
+ 'Do not actually change anything, just show what would be changed.'),
),
array(
'name' => 'disable-utf8mb4',
@@ -93,23 +96,22 @@
'SELECT 1');
} catch (AphrontQueryException $ex) {
$message = phutil_console_format(
+ "**%s**\n\n%s\n\n%s\n\n%s\n\n**%s**: %s\n",
+ pht('MySQL Credentials Not Configured'),
pht(
- "**MySQL Credentials Not Configured**\n\n".
"Unable to connect to MySQL using the configured credentials. ".
"You must configure standard credentials before you can upgrade ".
- "storage. Run these commands to set up credentials:\n".
- "\n".
- " phabricator/ $ ./bin/config set mysql.host __host__\n".
- " phabricator/ $ ./bin/config set mysql.user __username__\n".
- " phabricator/ $ ./bin/config set mysql.pass __password__\n".
- "\n".
+ 'storage. Run these commands to set up credentials:'),
+ " phabricator/ $ ./bin/config set mysql.host __host__\n".
+ " phabricator/ $ ./bin/config set mysql.user __username__\n".
+ " phabricator/ $ ./bin/config set mysql.pass __password__",
+ pht(
"These standard credentials are separate from any administrative ".
"credentials provided to this command with __--user__ or ".
"__--password__, and must be configured correctly before you can ".
- "proceed.\n".
- "\n".
- "**Raw MySQL Error**: %s\n",
- $ex->getMessage()));
+ 'proceed.'),
+ pht('Raw MySQL Error'),
+ $ex->getMessage());
echo phutil_console_wrap($message);
@@ -141,14 +143,14 @@
'SELECT 1');
} catch (AphrontQueryException $ex) {
$message = phutil_console_format(
+ "**%s**\n\n%s\n\n**%s**: %s\n",
+ pht('Bad Administrative Credentials'),
pht(
- "**Bad Administrative Credentials**\n\n".
- "Unable to connnect to MySQL using the administrative credentials ".
+ 'Unable to connect to MySQL using the administrative credentials '.
"provided with the __--user__ and __--password__ flags. Check that ".
- "you have entered them correctly.\n".
- "\n".
- "**Raw MySQL Error**: %s\n",
- $ex->getMessage()));
+ 'you have entered them correctly.'),
+ pht('Raw MySQL Error'),
+ $ex->getMessage());
echo phutil_console_wrap($message);
diff --git a/scripts/ssh/ssh-exec.php b/scripts/ssh/ssh-exec.php
--- a/scripts/ssh/ssh-exec.php
+++ b/scripts/ssh/ssh-exec.php
@@ -50,7 +50,8 @@
'help' => pht(
'Provide a command to execute. This makes testing this script '.
'easier. When running normally, the command is read from the '.
- 'environment (SSH_ORIGINAL_COMMAND), which is populated by sshd.'),
+ 'environment (%s), which is populated by sshd.',
+ 'SSH_ORIGINAL_COMMAND'),
),
));
@@ -84,9 +85,11 @@
if ($user_name && $device_name) {
throw new Exception(
pht(
- 'The --phabricator-ssh-user and --phabricator-ssh-device flags are '.
- 'mutually exclusive. You can not authenticate as both a user ("%s") '.
- 'and a device ("%s"). Specify one or the other, but not both.',
+ 'The %s and %s flags are mutually exclusive. You can not '.
+ 'authenticate as both a user ("%s") and a device ("%s"). '.
+ 'Specify one or the other, but not both.',
+ '--phabricator-ssh-user',
+ '--phabricator-ssh-device',
$user_name,
$device_name));
} else if (strlen($user_name)) {
@@ -104,9 +107,10 @@
if (!$remote_address) {
throw new Exception(
pht(
- 'Unable to identify remote address from the SSH_CLIENT environment '.
+ 'Unable to identify remote address from the %s environment '.
'variable. Device authentication is accepted only from trusted '.
- 'sources.'));
+ 'sources.',
+ 'SSH_CLIENT'));
}
if (!PhabricatorEnv::isClusterAddress($remote_address)) {
@@ -134,8 +138,9 @@
} else {
throw new Exception(
pht(
- 'This script must be invoked with either the --phabricator-ssh-user '.
- 'or --phabricator-ssh-device flag.'));
+ 'This script must be invoked with either the %s or %s flag.',
+ '--phabricator-ssh-user',
+ '--phabricator-ssh-device'));
}
if ($args->getArg('ssh-command')) {
@@ -199,10 +204,12 @@
"You haven't specified a command to run. This means you're requesting ".
"an interactive shell, but Phabricator does not provide an ".
"interactive shell over SSH.\n\n".
- "Usually, you should run a command like `git clone` or `hg push` ".
+ "Usually, you should run a command like `%s` or `%s` ".
"rather than connecting directly with SSH.\n\n".
"Supported commands are: %s.",
$user->getUsername(),
+ 'git clone',
+ 'hg push',
implode(', ', $workflow_names)));
}
@@ -235,17 +242,17 @@
$sock_stdin = fopen('php://stdin', 'r');
if (!$sock_stdin) {
- throw new Exception('Unable to open stdin.');
+ throw new Exception(pht('Unable to open stdin.'));
}
$sock_stdout = fopen('php://stdout', 'w');
if (!$sock_stdout) {
- throw new Exception('Unable to open stdout.');
+ throw new Exception(pht('Unable to open stdout.'));
}
$sock_stderr = fopen('php://stderr', 'w');
if (!$sock_stderr) {
- throw new Exception('Unable to open stderr.');
+ throw new Exception(pht('Unable to open stderr.'));
}
$socket_channel = new PhutilSocketChannel(
diff --git a/scripts/symbols/import_repository_symbols.php b/scripts/symbols/import_repository_symbols.php
--- a/scripts/symbols/import_repository_symbols.php
+++ b/scripts/symbols/import_repository_symbols.php
@@ -226,4 +226,4 @@
commit_symbols($symbols, $repository, $no_purge);
}
-echo pht('Done.'), "\n";
+echo pht('Done.')."\n";
diff --git a/scripts/user/account_admin.php b/scripts/user/account_admin.php
--- a/scripts/user/account_admin.php
+++ b/scripts/user/account_admin.php
@@ -12,32 +12,36 @@
$is_first_user = (!$any_user);
if ($is_first_user) {
- echo pht(
- "WARNING\n\n".
- "You're about to create the first account on this install. Normally, you ".
- "should use the web interface to create the first account, not this ".
- "script.\n\n".
- "If you use the web interface, it will drop you into a nice UI workflow ".
- "which gives you more help setting up your install. If you create an ".
- "account with this script instead, you will skip the setup help and you ".
- "will not be able to access it later.");
+ echo
+ pht('WARNING')."\n\n".
+ pht(
+ "You're about to create the first account on this install. Normally, ".
+ "you should use the web interface to create the first account, not ".
+ "this script.").
+ "\n\n".
+ pht(
+ 'If you use the web interface, it will drop you into a nice UI workflow '.
+ 'which gives you more help setting up your install. If you create an '.
+ 'account with this script instead, you will skip the setup help and you '.
+ 'will not be able to access it later.');
if (!phutil_console_confirm(pht('Skip easy setup and create account?'))) {
echo pht('Cancelled.')."\n";
exit(1);
}
}
-echo 'Enter a username to create a new account or edit an existing account.';
+echo pht(
+ 'Enter a username to create a new account or edit an existing account.');
-$username = phutil_console_prompt('Enter a username:');
+$username = phutil_console_prompt(pht('Enter a username:'));
if (!strlen($username)) {
- echo "Cancelled.\n";
+ echo pht('Cancelled.')."\n";
exit(1);
}
if (!PhabricatorUser::validateUsername($username)) {
$valid = PhabricatorUser::describeValidUsername();
- echo "The username '{$username}' is invalid. {$valid}\n";
+ echo pht("The username '%s' is invalid. %s", $username, $valid)."\n";
exit(1);
}
@@ -49,12 +53,12 @@
if (!$user) {
$original = new PhabricatorUser();
- echo "There is no existing user account '{$username}'.\n";
+ echo pht("There is no existing user account '%s'.", $username)."\n";
$ok = phutil_console_confirm(
- "Do you want to create a new '{$username}' account?",
+ pht("Do you want to create a new '%s' account?", $username),
$default_no = false);
if (!$ok) {
- echo "Cancelled.\n";
+ echo pht('Cancelled.')."\n";
exit(1);
}
$user = new PhabricatorUser();
@@ -64,12 +68,12 @@
} else {
$original = clone $user;
- echo "There is an existing user account '{$username}'.\n";
+ echo pht("There is an existing user account '%s'.", $username)."\n";
$ok = phutil_console_confirm(
- "Do you want to edit the existing '{$username}' account?",
+ pht("Do you want to edit the existing '%s' account?", $username),
$default_no = false);
if (!$ok) {
- echo "Cancelled.\n";
+ echo pht('Cancelled.')."\n";
exit(1);
}
@@ -78,12 +82,12 @@
$user_realname = $user->getRealName();
if (strlen($user_realname)) {
- $realname_prompt = ' ['.$user_realname.']';
+ $realname_prompt = ' ['.$user_realname.']:';
} else {
- $realname_prompt = '';
+ $realname_prompt = ':';
}
$realname = nonempty(
- phutil_console_prompt("Enter user real name{$realname_prompt}:"),
+ phutil_console_prompt(pht('Enter user real name').$realname_prompt),
$user_realname);
$user->setRealName($realname);
@@ -95,13 +99,14 @@
$create_email = null;
if ($is_new) {
do {
- $email = phutil_console_prompt('Enter user email address:');
+ $email = phutil_console_prompt(pht('Enter user email address:'));
$duplicate = id(new PhabricatorUserEmail())->loadOneWhere(
'address = %s',
$email);
if ($duplicate) {
- echo "ERROR: There is already a user with that email address. ".
- "Each user must have a unique email address.\n";
+ echo pht(
+ "ERROR: There is already a user with that email address. ".
+ "Each user must have a unique email address.\n");
} else {
break;
}
@@ -115,7 +120,7 @@
// it.
phutil_passthru('stty -echo');
$password = phutil_console_prompt(
- 'Enter a password for this user [blank to leave unchanged]:');
+ pht('Enter a password for this user [blank to leave unchanged]:'));
phutil_passthru('stty echo');
if (strlen($password)) {
$changed_pass = $password;
@@ -123,7 +128,7 @@
$is_system_agent = $user->getIsSystemAgent();
$set_system_agent = phutil_console_confirm(
- 'Is this user a bot/script?',
+ pht('Is this user a bot/script?'),
$default_no = !$is_system_agent);
$verify_email = null;
@@ -135,31 +140,31 @@
$verify_email = $user->loadPrimaryEmail();
if (!$verify_email->getIsVerified()) {
$set_verified = phutil_console_confirm(
- 'Should the primary email address be verified?',
+ pht('Should the primary email address be verified?'),
$default_no = true);
} else {
- // already verified so let's not make a fuss
+ // Already verified so let's not make a fuss.
$verify_email = null;
}
}
$is_admin = $user->getIsAdmin();
$set_admin = phutil_console_confirm(
- 'Should this user be an administrator?',
+ pht('Should this user be an administrator?'),
$default_no = !$is_admin);
-echo "\n\nACCOUNT SUMMARY\n\n";
+echo "\n\n".pht('ACCOUNT SUMMARY')."\n\n";
$tpl = "%12s %-30s %-30s\n";
-printf($tpl, null, 'OLD VALUE', 'NEW VALUE');
-printf($tpl, 'Username', $original->getUsername(), $user->getUsername());
-printf($tpl, 'Real Name', $original->getRealName(), $user->getRealName());
+printf($tpl, null, pht('OLD VALUE'), pht('NEW VALUE'));
+printf($tpl, pht('Username'), $original->getUsername(), $user->getUsername());
+printf($tpl, pht('Real Name'), $original->getRealName(), $user->getRealName());
if ($is_new) {
- printf($tpl, 'Email', '', $create_email);
+ printf($tpl, pht('Email'), '', $create_email);
}
-printf($tpl, 'Password', null,
+printf($tpl, pht('Password'), null,
($changed_pass !== false)
- ? 'Updated'
- : 'Unchanged');
+ ? pht('Updated')
+ : pht('Unchanged'));
printf(
$tpl,
@@ -183,8 +188,8 @@
echo "\n";
-if (!phutil_console_confirm('Save these changes?', $default_no = false)) {
- echo "Cancelled.\n";
+if (!phutil_console_confirm(pht('Save these changes?'), $default_no = false)) {
+ echo pht('Cancelled.')."\n";
exit(1);
}
@@ -223,4 +228,4 @@
$user->saveTransaction();
-echo "Saved changes.\n";
+echo pht('Saved changes.')."\n";
diff --git a/scripts/user/add_user.php b/scripts/user/add_user.php
--- a/scripts/user/add_user.php
+++ b/scripts/user/add_user.php
@@ -5,7 +5,9 @@
require_once $root.'/scripts/__init_script__.php';
if ($argc !== 5) {
- echo "usage: add_user.php <username> <email> <realname> <admin_user>\n";
+ echo pht(
+ "Usage: %s\n",
+ 'add_user.php <username> <email> <realname> <admin_user>');
exit(1);
}
@@ -19,8 +21,9 @@
$argv[4]);
if (!$admin) {
throw new Exception(
- 'Admin user must be the username of a valid Phabricator account, used '.
- 'to send the new user a welcome email.');
+ pht(
+ 'Admin user must be the username of a valid Phabricator account, used '.
+ 'to send the new user a welcome email.'));
}
$existing_user = id(new PhabricatorUser())->loadOneWhere(
@@ -28,7 +31,9 @@
$username);
if ($existing_user) {
throw new Exception(
- "There is already a user with the username '{$username}'!");
+ pht(
+ "There is already a user with the username '%s'!",
+ $username));
}
$existing_email = id(new PhabricatorUserEmail())->loadOneWhere(
@@ -36,7 +41,9 @@
$email);
if ($existing_email) {
throw new Exception(
- "There is already a user with the email '{$email}'!");
+ pht(
+ "There is already a user with the email '%s'!",
+ $email));
}
$user = new PhabricatorUser();
@@ -54,4 +61,8 @@
$user->sendWelcomeEmail($admin);
-echo "Created user '{$username}' (realname='{$realname}', email='{$email}').\n";
+echo pht(
+ "Created user '%s' (realname='%s', email='%s').\n",
+ $username,
+ $realname,
+ $email);
diff --git a/scripts/util/add_macro.php b/scripts/util/add_macro.php
--- a/scripts/util/add_macro.php
+++ b/scripts/util/add_macro.php
@@ -19,8 +19,8 @@
array(
'name' => 'as',
'param' => 'name',
- 'help' => 'Use a specific name instead of the first part of the image '.
- 'name.',
+ 'help' => pht(
+ 'Use a specific name instead of the first part of the image name.'),
),
array(
'name' => 'more',
@@ -45,7 +45,7 @@
'name = %s',
$name);
if ($existing) {
- throw new Exception("A macro already exists with the name '{$name}'!");
+ throw new Exception(pht("A macro already exists with the name '%s'!", $name));
}
$file = PhabricatorFile::newFromFileData(
@@ -62,4 +62,4 @@
$id = $file->getID();
-echo "Added macro '{$name}' (F{$id}).\n";
+echo pht("Added macro '%s' (%s).", $name, "F{$id}")."\n";
diff --git a/scripts/util/emit_test_event.php b/scripts/util/emit_test_event.php
--- a/scripts/util/emit_test_event.php
+++ b/scripts/util/emit_test_event.php
@@ -23,12 +23,12 @@
$console = PhutilConsole::getConsole();
foreach ($args->getArg('listen') as $listener) {
- $console->writeOut("Installing '%s'...\n", $listener);
+ $console->writeOut("%s\n", pht("Installing '%s'...", $listener));
newv($listener, array())->register();
}
-$console->writeOut("Emitting event...\n");
+$console->writeOut("%s\n", pht('Emitting event...'));
PhutilEventEngine::dispatchEvent(
new PhabricatorEvent(
@@ -37,5 +37,5 @@
'time' => time(),
)));
-$console->writeOut("Done.\n");
+$console->writeOut("%s\n", pht('Done.'));
exit(0);
diff --git a/src/__tests__/PhabricatorCelerityTestCase.php b/src/__tests__/PhabricatorCelerityTestCase.php
--- a/src/__tests__/PhabricatorCelerityTestCase.php
+++ b/src/__tests__/PhabricatorCelerityTestCase.php
@@ -28,7 +28,8 @@
$maps_are_identical,
pht(
'When this test fails, it means the Celerity resource map is out '.
- 'of date. Run `bin/celerity map` to rebuild it.'));
+ 'of date. Run `%s` to rebuild it.',
+ 'bin/celerity map'));
}
}
diff --git a/src/__tests__/PhabricatorInfrastructureTestCase.php b/src/__tests__/PhabricatorInfrastructureTestCase.php
--- a/src/__tests__/PhabricatorInfrastructureTestCase.php
+++ b/src/__tests__/PhabricatorInfrastructureTestCase.php
@@ -15,7 +15,7 @@
$this->assertEqual(
count($all),
count($installed),
- 'In test cases, all applications should default to installed.');
+ pht('In test cases, all applications should default to installed.'));
}
public function testRejectMySQLNonUTF8Queries() {
diff --git a/src/aphront/configuration/AphrontApplicationConfiguration.php b/src/aphront/configuration/AphrontApplicationConfiguration.php
--- a/src/aphront/configuration/AphrontApplicationConfiguration.php
+++ b/src/aphront/configuration/AphrontApplicationConfiguration.php
@@ -320,13 +320,14 @@
// test) so it's fine that we don't have SERVER_ADDR defined.
} else {
throw new AphrontUsageException(
- pht('No SERVER_ADDR'),
+ pht('No %s', 'SERVER_ADDR'),
pht(
'Phabricator is configured to operate in cluster mode, but '.
- 'SERVER_ADDR is not defined in the request context. Your '.
- 'webserver configuration needs to forward SERVER_ADDR to '.
- 'PHP so Phabricator can reject requests received on '.
- 'external interfaces.'));
+ '%s is not defined in the request context. Your webserver '.
+ 'configuration needs to forward %s to PHP so Phabricator can '.
+ 'reject requests received on external interfaces.',
+ 'SERVER_ADDR',
+ 'SERVER_ADDR'));
}
} else {
if (!PhabricatorEnv::isClusterAddress($server_addr)) {
@@ -405,8 +406,9 @@
->executeOne();
} catch (PhabricatorPolicyException $ex) {
throw new Exception(
- 'This blog is not visible to logged out users, so it can not be '.
- 'visited from a custom domain.');
+ pht(
+ 'This blog is not visible to logged out users, so it can not be '.
+ 'visited from a custom domain.'));
}
if (!$blog) {
@@ -416,9 +418,11 @@
$prod_str = '';
}
throw new Exception(
- 'Specified domain '.$host.' is not configured for Phabricator '.
- 'requests. Please use '.$base_uri.$prod_str.' to visit this instance.'
- );
+ pht(
+ 'Specified domain %s is not configured for Phabricator '.
+ 'requests. Please use %s to visit this instance.',
+ $host,
+ $base_uri.$prod_str));
}
// TODO: Make this more flexible and modular so any application can
diff --git a/src/aphront/response/AphrontProxyResponse.php b/src/aphront/response/AphrontProxyResponse.php
--- a/src/aphront/response/AphrontProxyResponse.php
+++ b/src/aphront/response/AphrontProxyResponse.php
@@ -65,7 +65,10 @@
final public function buildResponseString() {
throw new Exception(
- 'AphrontProxyResponse must implement reduceProxyResponse().');
+ pht(
+ '%s must implement %s.',
+ __CLASS__,
+ 'reduceProxyResponse()'));
}
}
diff --git a/src/aphront/sink/AphrontHTTPSink.php b/src/aphront/sink/AphrontHTTPSink.php
--- a/src/aphront/sink/AphrontHTTPSink.php
+++ b/src/aphront/sink/AphrontHTTPSink.php
@@ -25,7 +25,7 @@
*/
final public function writeHTTPStatus($code, $message = '') {
if (!preg_match('/^\d{3}$/', $code)) {
- throw new Exception("Malformed HTTP status code '{$code}'!");
+ throw new Exception(pht("Malformed HTTP status code '%s'!", $code));
}
$code = (int)$code;
@@ -42,14 +42,15 @@
final public function writeHeaders(array $headers) {
foreach ($headers as $header) {
if (!is_array($header) || count($header) !== 2) {
- throw new Exception('Malformed header.');
+ throw new Exception(pht('Malformed header.'));
}
list($name, $value) = $header;
if (strpos($name, ':') !== false) {
throw new Exception(
- 'Declining to emit response with malformed HTTP header name: '.
- $name);
+ pht(
+ 'Declining to emit response with malformed HTTP header name: %s',
+ $name));
}
// Attackers may perform an "HTTP response splitting" attack by making
@@ -64,8 +65,9 @@
if (preg_match('/[\r\n\0]/', $name.$value)) {
throw new Exception(
- "Declining to emit response with unsafe HTTP header: ".
- "<'".$name."', '".$value."'>.");
+ pht(
+ 'Declining to emit response with unsafe HTTP header: %s',
+ "<'".$name."', '".$value."'>."));
}
}
diff --git a/src/applications/almanac/controller/AlmanacConsoleController.php b/src/applications/almanac/controller/AlmanacConsoleController.php
--- a/src/applications/almanac/controller/AlmanacConsoleController.php
+++ b/src/applications/almanac/controller/AlmanacConsoleController.php
@@ -18,27 +18,21 @@
->setHeader(pht('Services'))
->setHref($this->getApplicationURI('service/'))
->setFontIcon('fa-plug')
- ->addAttribute(
- pht(
- 'Manage Almanac services.')));
+ ->addAttribute(pht('Manage Almanac services.')));
$menu->addItem(
id(new PHUIObjectItemView())
->setHeader(pht('Devices'))
->setHref($this->getApplicationURI('device/'))
->setFontIcon('fa-server')
- ->addAttribute(
- pht(
- 'Manage Almanac devices.')));
+ ->addAttribute(pht('Manage Almanac devices.')));
$menu->addItem(
id(new PHUIObjectItemView())
->setHeader(pht('Networks'))
->setHref($this->getApplicationURI('network/'))
->setFontIcon('fa-globe')
- ->addAttribute(
- pht(
- 'Manage Almanac networks.')));
+ ->addAttribute(pht('Manage Almanac networks.')));
$crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb(pht('Console'));
diff --git a/src/applications/almanac/controller/AlmanacServiceEditController.php b/src/applications/almanac/controller/AlmanacServiceEditController.php
--- a/src/applications/almanac/controller/AlmanacServiceEditController.php
+++ b/src/applications/almanac/controller/AlmanacServiceEditController.php
@@ -250,8 +250,4 @@
));
}
-
-
-
-
}
diff --git a/src/applications/aphlict/management/PhabricatorAphlictManagementStatusWorkflow.php b/src/applications/aphlict/management/PhabricatorAphlictManagementStatusWorkflow.php
--- a/src/applications/aphlict/management/PhabricatorAphlictManagementStatusWorkflow.php
+++ b/src/applications/aphlict/management/PhabricatorAphlictManagementStatusWorkflow.php
@@ -15,11 +15,11 @@
$pid = $this->getPID();
if (!$pid) {
- $console->writeErr(pht("Aphlict is not running.\n"));
+ $console->writeErr("%s\n", pht('Aphlict is not running.'));
return 1;
}
- $console->writeOut(pht("Aphlict (%s) is running.\n", $pid));
+ $console->writeOut("%s\n", pht('Aphlict (%s) is running.', $pid));
return 0;
}
diff --git a/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php b/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php
--- a/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php
+++ b/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php
@@ -97,8 +97,10 @@
private static function mustHaveExtension($ext) {
if (!extension_loaded($ext)) {
- echo "ERROR: The PHP extension '{$ext}' is not installed. You must ".
- "install it to run aphlict on this machine.\n";
+ echo pht(
+ "ERROR: The PHP extension '%s' is not installed. You must ".
+ "install it to run Aphlict on this machine.",
+ $ext)."\n";
exit(1);
}
@@ -106,8 +108,10 @@
foreach ($extension->getFunctions() as $function) {
$function = $function->name;
if (!function_exists($function)) {
- echo "ERROR: The PHP function {$function}() is disabled. You must ".
- "enable it to run aphlict on this machine.\n";
+ echo pht(
+ 'ERROR: The PHP function %s is disabled. You must '.
+ 'enable it to run Aphlict on this machine.',
+ $function.'()')."\n";
exit(1);
}
}
@@ -121,7 +125,8 @@
throw new PhutilArgumentUsageException(
pht(
'Unable to start notifications server because it is already '.
- 'running. Use `aphlict restart` to restart it.'));
+ 'running. Use `%s` to restart it.',
+ 'aphlict restart'));
}
if (posix_getuid() == 0) {
@@ -195,7 +200,9 @@
$console = PhutilConsole::getConsole();
if ($this->debug) {
- $console->writeOut(pht("Starting Aphlict server in foreground...\n"));
+ $console->writeOut(
+ "%s\n",
+ pht('Starting Aphlict server in foreground...'));
} else {
Filesystem::writeFile($this->getPIDPath(), getmypid());
}
@@ -214,10 +221,13 @@
register_shutdown_function(array($this, 'cleanup'));
if ($this->debug) {
- $console->writeOut("Launching server:\n\n $ ".$command."\n\n");
+ $console->writeOut(
+ "%s\n\n $ %s\n\n",
+ pht('Launching server:'),
+ $command);
$err = phutil_passthru('%C', $command);
- $console->writeOut(">>> Server exited!\n");
+ $console->writeOut(">>> %s\n", pht('Server exited!'));
exit($err);
} else {
while (true) {
@@ -242,9 +252,12 @@
$pid = pcntl_fork();
if ($pid < 0) {
- throw new Exception('Failed to fork()!');
+ throw new Exception(
+ pht(
+ 'Failed to %s!',
+ 'fork()'));
} else if ($pid) {
- $console->writeErr(pht("Aphlict Server started.\n"));
+ $console->writeErr("%s\n", pht('Aphlict Server started.'));
exit(0);
}
@@ -267,11 +280,11 @@
$pid = $this->getPID();
if (!$pid) {
- $console->writeErr(pht("Aphlict is not running.\n"));
+ $console->writeErr("%s\n", pht('Aphlict is not running.'));
return 0;
}
- $console->writeErr(pht("Stopping Aphlict Server (%s)...\n", $pid));
+ $console->writeErr("%s\n", pht('Stopping Aphlict Server (%s)...', $pid));
posix_kill($pid, SIGINT);
$start = time();
@@ -287,7 +300,7 @@
} while (time() < $start + 5);
if ($pid) {
- $console->writeErr(pht('Sending %s a SIGKILL.', $pid)."\n");
+ $console->writeErr("%s\n", pht('Sending %s a SIGKILL.', $pid));
posix_kill($pid, SIGKILL);
unset($pid);
}
@@ -307,8 +320,11 @@
throw new PhutilArgumentUsageException(
pht(
- 'No `nodejs` or `node` binary was found in $PATH. You must install '.
- 'Node.js to start the Aphlict server.'));
+ 'No `%s` or `%s` binary was found in %s. You must install '.
+ 'Node.js to start the Aphlict server.',
+ 'nodejs',
+ 'node',
+ '$PATH'));
}
}
diff --git a/src/applications/aphlict/query/AphlictDropdownDataQuery.php b/src/applications/aphlict/query/AphlictDropdownDataQuery.php
--- a/src/applications/aphlict/query/AphlictDropdownDataQuery.php
+++ b/src/applications/aphlict/query/AphlictDropdownDataQuery.php
@@ -22,7 +22,7 @@
public function getNotificationData() {
if ($this->notificationData === null) {
- throw new Exception('You must execute() first!');
+ throw new Exception(pht('You must %s first!', 'execute()'));
}
return $this->notificationData;
}
@@ -34,7 +34,7 @@
public function getConpherenceData() {
if ($this->conpherenceData === null) {
- throw new Exception('You must execute() first!');
+ throw new Exception(pht('You must %s first!', 'execute()'));
}
return $this->conpherenceData;
}
diff --git a/src/applications/audit/constants/PhabricatorAuditActionConstants.php b/src/applications/audit/constants/PhabricatorAuditActionConstants.php
--- a/src/applications/audit/constants/PhabricatorAuditActionConstants.php
+++ b/src/applications/audit/constants/PhabricatorAuditActionConstants.php
@@ -14,12 +14,12 @@
public static function getActionNameMap() {
$map = array(
- self::COMMENT => pht('Comment'),
- self::CONCERN => pht("Raise Concern \xE2\x9C\x98"),
- self::ACCEPT => pht("Accept Commit \xE2\x9C\x94"),
- self::RESIGN => pht('Resign from Audit'),
- self::CLOSE => pht('Close Audit'),
- self::ADD_CCS => pht('Add CCs'),
+ self::COMMENT => pht('Comment'),
+ self::CONCERN => pht('Raise Concern')." \xE2\x9C\x98",
+ self::ACCEPT => pht('Accept Commit')." \xE2\x9C\x94",
+ self::RESIGN => pht('Resign from Audit'),
+ self::CLOSE => pht('Close Audit'),
+ self::ADD_CCS => pht('Add CCs'),
self::ADD_AUDITORS => pht('Add Auditors'),
);
@@ -28,20 +28,20 @@
public static function getActionName($constant) {
$map = self::getActionNameMap();
- return idx($map, $constant, 'Unknown');
+ return idx($map, $constant, pht('Unknown'));
}
public static function getActionPastTenseVerb($action) {
- static $map = array(
- self::COMMENT => 'commented on',
- self::CONCERN => 'raised a concern with',
- self::ACCEPT => 'accepted',
- self::RESIGN => 'resigned from',
- self::CLOSE => 'closed',
- self::ADD_CCS => 'added CCs to',
- self::ADD_AUDITORS => 'added auditors to',
+ $map = array(
+ self::COMMENT => pht('commented on'),
+ self::CONCERN => pht('raised a concern with'),
+ self::ACCEPT => pht('accepted'),
+ self::RESIGN => pht('resigned from'),
+ self::CLOSE => pht('closed'),
+ self::ADD_CCS => pht('added CCs to'),
+ self::ADD_AUDITORS => pht('added auditors to'),
);
- return idx($map, $action, 'updated');
+ return idx($map, $action, pht('updated'));
}
}
diff --git a/src/applications/audit/constants/PhabricatorAuditCommitStatusConstants.php b/src/applications/audit/constants/PhabricatorAuditCommitStatusConstants.php
--- a/src/applications/audit/constants/PhabricatorAuditCommitStatusConstants.php
+++ b/src/applications/audit/constants/PhabricatorAuditCommitStatusConstants.php
@@ -21,7 +21,7 @@
}
public static function getStatusName($code) {
- return idx(self::getStatusNameMap(), $code, 'Unknown');
+ return idx(self::getStatusNameMap(), $code, pht('Unknown'));
}
public static function getOpenStatusConstants() {
diff --git a/src/applications/audit/editor/PhabricatorAuditEditor.php b/src/applications/audit/editor/PhabricatorAuditEditor.php
--- a/src/applications/audit/editor/PhabricatorAuditEditor.php
+++ b/src/applications/audit/editor/PhabricatorAuditEditor.php
@@ -28,7 +28,7 @@
} else {
$name = $this->getActor()->getUsername();
}
- return array('Added by '.$name.'.');
+ return array(pht('Added by %s.', $name));
}
public function setRawPatch($patch) {
@@ -438,7 +438,7 @@
}
foreach ($phids as $phid) {
- $this->addAuditReason($phid, 'Requested by Author');
+ $this->addAuditReason($phid, pht('Requested by Author'));
}
return id(new PhabricatorAuditTransaction())
->setTransactionType(PhabricatorAuditActionConstants::ADD_AUDITORS)
@@ -611,7 +611,7 @@
$name = $repository->formatCommitName($identifier);
$subject = "{$name}: {$summary}";
- $thread_topic = "Commit {$monogram}{$identifier}";
+ $thread_topic = pht('Commit %s', $monogram.$identifier);
$template = id(new PhabricatorMetaMTAMail())
->setSubject($subject)
diff --git a/src/applications/audit/mail/PhabricatorAuditMailReceiver.php b/src/applications/audit/mail/PhabricatorAuditMailReceiver.php
--- a/src/applications/audit/mail/PhabricatorAuditMailReceiver.php
+++ b/src/applications/audit/mail/PhabricatorAuditMailReceiver.php
@@ -3,8 +3,8 @@
final class PhabricatorAuditMailReceiver extends PhabricatorObjectMailReceiver {
public function isEnabled() {
- $app_class = 'PhabricatorAuditApplication';
- return PhabricatorApplication::isClassInstalled($app_class);
+ return PhabricatorApplication::isClassInstalled(
+ 'PhabricatorAuditApplication');
}
protected function getObjectPattern() {
diff --git a/src/applications/audit/mail/PhabricatorAuditReplyHandler.php b/src/applications/audit/mail/PhabricatorAuditReplyHandler.php
--- a/src/applications/audit/mail/PhabricatorAuditReplyHandler.php
+++ b/src/applications/audit/mail/PhabricatorAuditReplyHandler.php
@@ -5,7 +5,10 @@
public function validateMailReceiver($mail_receiver) {
if (!($mail_receiver instanceof PhabricatorRepositoryCommit)) {
- throw new Exception('Mail receiver is not a commit!');
+ throw new Exception(
+ pht(
+ 'Mail receiver is not a %s!',
+ 'PhabricatorRepositoryCommit'));
}
}
diff --git a/src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php b/src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php
--- a/src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php
+++ b/src/applications/audit/management/PhabricatorAuditManagementDeleteWorkflow.php
@@ -7,51 +7,54 @@
$this
->setName('delete')
->setExamples('**delete** [--dry-run] ...')
- ->setSynopsis('Delete audit requests matching parameters.')
+ ->setSynopsis(pht('Delete audit requests matching parameters.'))
->setArguments(
array(
array(
'name' => 'dry-run',
- 'help' => 'Show what would be deleted, but do not actually delete '.
- 'anything.',
+ 'help' => pht(
+ 'Show what would be deleted, but do not actually delete '.
+ 'anything.'),
),
array(
'name' => 'users',
'param' => 'names',
- 'help' => 'Select only audits by a given list of users.',
+ 'help' => pht('Select only audits by a given list of users.'),
),
array(
'name' => 'repositories',
'param' => 'repos',
- 'help' => 'Select only audits in a given list of repositories.',
+ 'help' => pht(
+ 'Select only audits in a given list of repositories.'),
),
array(
'name' => 'commits',
'param' => 'commits',
- 'help' => 'Select only audits for the given commits.',
+ 'help' => pht('Select only audits for the given commits.'),
),
array(
'name' => 'min-commit-date',
'param' => 'date',
- 'help' => 'Select only audits for commits on or after the given '.
- 'date.',
+ 'help' => pht(
+ 'Select only audits for commits on or after the given date.'),
),
array(
'name' => 'max-commit-date',
'param' => 'date',
- 'help' => 'Select only audits for commits on or before the given '.
- 'date.',
+ 'help' => pht(
+ 'Select only audits for commits on or before the given date.'),
),
array(
'name' => 'status',
'param' => 'status',
- 'help' => 'Select only audits in the given status. By default, '.
- 'only open audits are selected.',
+ 'help' => pht(
+ 'Select only audits in the given status. By default, '.
+ 'only open audits are selected.'),
),
array(
'name' => 'ids',
'param' => 'ids',
- 'help' => 'Select only audits with the given IDs.',
+ 'help' => pht('Select only audits with the given IDs.'),
),
));
}
@@ -72,7 +75,7 @@
$max_date = $this->loadDate($args->getArg('max-commit-date'));
if ($min_date && $max_date && ($min_date > $max_date)) {
throw new PhutilArgumentUsageException(
- 'Specified max date must come after specified min date.');
+ pht('Specified maximum date must come after specified minimum date.'));
}
$is_dry_run = $args->getArg('dry-run');
@@ -250,8 +253,9 @@
if (!$epoch || $epoch < 1) {
throw new PhutilArgumentUsageException(
pht(
- 'Unable to parse date "%s". Use a format like "2000-01-01".',
- $date));
+ 'Unable to parse date "%s". Use a format like "%s".',
+ $date,
+ '2000-01-01'));
}
return $epoch;
diff --git a/src/applications/audit/view/PhabricatorAuditListView.php b/src/applications/audit/view/PhabricatorAuditListView.php
--- a/src/applications/audit/view/PhabricatorAuditListView.php
+++ b/src/applications/audit/view/PhabricatorAuditListView.php
@@ -59,7 +59,7 @@
private function getHandle($phid) {
$handle = idx($this->handles, $phid);
if (!$handle) {
- throw new Exception("No handle for '{$phid}'!");
+ throw new Exception(pht("No handle for '%s'!", $phid));
}
return $handle;
}
@@ -98,7 +98,11 @@
public function buildList() {
$user = $this->getUser();
if (!$user) {
- throw new Exception('you must setUser() before buildList()!');
+ throw new Exception(
+ pht(
+ 'You must %s before %s!',
+ 'setUser()',
+ __FUNCTION__.'()'));
}
$rowc = array();
diff --git a/src/applications/audit/view/PhabricatorAuditTransactionView.php b/src/applications/audit/view/PhabricatorAuditTransactionView.php
--- a/src/applications/audit/view/PhabricatorAuditTransactionView.php
+++ b/src/applications/audit/view/PhabricatorAuditTransactionView.php
@@ -72,7 +72,7 @@
$inlines[] = $xaction;
break;
default:
- throw new Exception('Unknown grouped transaction type!');
+ throw new Exception(pht('Unknown grouped transaction type!'));
}
}
diff --git a/src/applications/auth/conduit/PhabricatorAuthConduitAPIMethod.php b/src/applications/auth/conduit/PhabricatorAuthConduitAPIMethod.php
--- a/src/applications/auth/conduit/PhabricatorAuthConduitAPIMethod.php
+++ b/src/applications/auth/conduit/PhabricatorAuthConduitAPIMethod.php
@@ -3,8 +3,7 @@
abstract class PhabricatorAuthConduitAPIMethod extends ConduitAPIMethod {
final public function getApplication() {
- return PhabricatorApplication::getByClass(
- 'PhabricatorAuthApplication');
+ return PhabricatorApplication::getByClass('PhabricatorAuthApplication');
}
public function getMethodStatus() {
@@ -12,8 +11,7 @@
}
public function getMethodStatusDescription() {
- return pht(
- 'These methods are recently introduced and subject to change.');
+ return pht('These methods are recently introduced and subject to change.');
}
}
diff --git a/src/applications/auth/controller/PhabricatorAuthLoginController.php b/src/applications/auth/controller/PhabricatorAuthLoginController.php
--- a/src/applications/auth/controller/PhabricatorAuthLoginController.php
+++ b/src/applications/auth/controller/PhabricatorAuthLoginController.php
@@ -68,7 +68,9 @@
if (!$account) {
throw new Exception(
- 'Auth provider failed to load an account from processLoginRequest()!');
+ pht(
+ 'Auth provider failed to load an account from %s!',
+ 'processLoginRequest'.'()'));
}
if ($account->getUserPHID()) {
@@ -164,7 +166,7 @@
$next_uri) {
if ($account->getUserPHID()) {
- throw new Exception('Account is already registered or linked.');
+ throw new Exception(pht('Account is already registered or linked.'));
}
// Regenerate the registration secret key, set it on the external account,
diff --git a/src/applications/auth/controller/PhabricatorAuthNeedsMultiFactorController.php b/src/applications/auth/controller/PhabricatorAuthNeedsMultiFactorController.php
--- a/src/applications/auth/controller/PhabricatorAuthNeedsMultiFactorController.php
+++ b/src/applications/auth/controller/PhabricatorAuthNeedsMultiFactorController.php
@@ -40,7 +40,7 @@
pht(
'Multi-factor authentication helps secure your account by '.
'making it more difficult for attackers to gain access or '.
- 'take senstive actions.'),
+ 'take sensitive actions.'),
pht(
'To learn more about multi-factor authentication, click the '.
'%s button below.',
diff --git a/src/applications/auth/controller/PhabricatorAuthRegisterController.php b/src/applications/auth/controller/PhabricatorAuthRegisterController.php
--- a/src/applications/auth/controller/PhabricatorAuthRegisterController.php
+++ b/src/applications/auth/controller/PhabricatorAuthRegisterController.php
@@ -560,8 +560,7 @@
return array($account, $provider, $response);
} else if (count($providers) > 1) {
$response = $this->renderError(
- pht(
- 'There are too many configured default registration providers.'));
+ pht('There are too many configured default registration providers.'));
return array($account, $provider, $response);
}
diff --git a/src/applications/auth/controller/PhabricatorAuthSSHKeyGenerateController.php b/src/applications/auth/controller/PhabricatorAuthSSHKeyGenerateController.php
--- a/src/applications/auth/controller/PhabricatorAuthSSHKeyGenerateController.php
+++ b/src/applications/auth/controller/PhabricatorAuthSSHKeyGenerateController.php
@@ -55,9 +55,9 @@
->setSubmitURI($file->getDownloadURI())
->appendParagraph(
pht(
- 'A keypair has been generated, and the public key has been '.
- 'added as a recognized key. Use the button below to download '.
- 'the private key.'))
+ 'A keypair has been generated, and the public key has been '.
+ 'added as a recognized key. Use the button below to download '.
+ 'the private key.'))
->appendParagraph(
pht(
'After you download the private key, it will be destroyed. '.
@@ -77,8 +77,7 @@
'This workflow will generate a new SSH keypair, add the public '.
'key, and let you download the private key.'))
->appendParagraph(
- pht(
- 'Phabricator will not retain a copy of the private key.'))
+ pht('Phabricator will not retain a copy of the private key.'))
->addSubmitButton(pht('Generate New Keypair'))
->addCancelButton($cancel_uri);
} catch (Exception $ex) {
diff --git a/src/applications/auth/controller/PhabricatorAuthStartController.php b/src/applications/auth/controller/PhabricatorAuthStartController.php
--- a/src/applications/auth/controller/PhabricatorAuthStartController.php
+++ b/src/applications/auth/controller/PhabricatorAuthStartController.php
@@ -71,8 +71,8 @@
'This Phabricator install is not configured with any enabled '.
'authentication providers which can be used to log in. If you '.
'have accidentally locked yourself out by disabling all providers, '.
- 'you can use `phabricator/bin/auth recover <username>` to '.
- 'recover access to an administrative account.'));
+ 'you can use `%s` to recover access to an administrative account.'.
+ 'phabricator/bin/auth recover <username>'));
}
$next_uri = $request->getStr('next');
diff --git a/src/applications/auth/controller/PhabricatorEmailLoginController.php b/src/applications/auth/controller/PhabricatorEmailLoginController.php
--- a/src/applications/auth/controller/PhabricatorEmailLoginController.php
+++ b/src/applications/auth/controller/PhabricatorEmailLoginController.php
@@ -72,7 +72,7 @@
$target_email->getUserPHID());
if ($verified_addresses) {
$errors[] = pht(
- 'That email addess is not verified. You can only send '.
+ 'That email address is not verified. You can only send '.
'password reset links to a verified address.');
$e_email = pht('Unverified');
}
@@ -86,26 +86,23 @@
PhabricatorAuthSessionEngine::ONETIME_RESET);
if ($is_serious) {
- $body = <<<EOBODY
-You can use this link to reset your Phabricator password:
-
- {$uri}
-
-EOBODY;
+ $body = sprintf(
+ "%s\n\n %s\n",
+ pht('You can use this link to reset your Phabricator password:'),
+ $uri);
} else {
- $body = <<<EOBODY
-Condolences on forgetting your password. You can use this link to reset it:
-
- {$uri}
-
-After you set a new password, consider writing it down on a sticky note and
-attaching it to your monitor so you don't forget again! Choosing a very short,
-easy-to-remember password like "cat" or "1234" might also help.
-
-Best Wishes,
-Phabricator
-
-EOBODY;
+ $body = sprintf(
+ "%s\n\n %s\n\n%s\n\n%s\n",
+ pht(
+ 'Condolences on forgetting your password. '.
+ 'You can use this link to reset it:'),
+ $uri,
+ pht(
+ "After you set a new password, consider writing it down on a ".
+ "sticky note and attaching it to your monitor so you don't ".
+ "forget again! Choosing a very short, easy-to-remember ".
+ "password like \"cat\" or \"1234\" might also help."),
+ pht("Best Wishes,\nPhabricator"));
}
$mail = id(new PhabricatorMetaMTAMail())
@@ -123,7 +120,6 @@
->addCancelButton('/', pht('Done'));
}
}
-
}
$error_view = null;
@@ -153,8 +149,7 @@
$dialog = new AphrontDialogView();
$dialog->setUser($request->getUser());
- $dialog->setTitle(pht(
- 'Forgot Password / Email Login'));
+ $dialog->setTitle(pht('Forgot Password / Email Login'));
$dialog->appendChild($email_auth);
$dialog->addSubmitButton(pht('Send Email'));
$dialog->setSubmitURI('/login/email/');
diff --git a/src/applications/auth/factor/__tests__/PhabricatorTOTPAuthFactorTestCase.php b/src/applications/auth/factor/__tests__/PhabricatorTOTPAuthFactorTestCase.php
--- a/src/applications/auth/factor/__tests__/PhabricatorTOTPAuthFactorTestCase.php
+++ b/src/applications/auth/factor/__tests__/PhabricatorTOTPAuthFactorTestCase.php
@@ -39,6 +39,4 @@
}
-
-
}
diff --git a/src/applications/auth/management/PhabricatorAuthManagementCachePKCS8Workflow.php b/src/applications/auth/management/PhabricatorAuthManagementCachePKCS8Workflow.php
--- a/src/applications/auth/management/PhabricatorAuthManagementCachePKCS8Workflow.php
+++ b/src/applications/auth/management/PhabricatorAuthManagementCachePKCS8Workflow.php
@@ -11,8 +11,8 @@
pht(
'Cache the PKCS8 format of a public key. When developing on OSX, '.
'this can be used to work around issues with ssh-keygen. Use '.
- '`ssh-keygen -e -m PKCS8 -f key.pub` to generate a PKCS8 key to '.
- 'feed to this command.'))
+ '`%s` to generate a PKCS8 key to feed to this command.',
+ 'ssh-keygen -e -m PKCS8 -f key.pub'))
->setArguments(
array(
array(
@@ -35,7 +35,8 @@
if (!strlen($public_keyfile)) {
throw new PhutilArgumentUsageException(
pht(
- 'You must specify the path to a public keyfile with --public.'));
+ 'You must specify the path to a public keyfile with %s.',
+ '--public'));
}
if (!Filesystem::pathExists($public_keyfile)) {
@@ -51,7 +52,8 @@
if (!strlen($pkcs8_keyfile)) {
throw new PhutilArgumentUsageException(
pht(
- 'You must specify the path to a pkcs8 keyfile with --pkc8s.'));
+ 'You must specify the path to a pkcs8 keyfile with %s.',
+ '--pkc8s'));
}
if (!Filesystem::pathExists($pkcs8_keyfile)) {
diff --git a/src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php b/src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php
--- a/src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php
+++ b/src/applications/auth/management/PhabricatorAuthManagementLDAPWorkflow.php
@@ -21,7 +21,7 @@
if (!$provider) {
$console->writeOut(
"%s\n",
- 'The LDAP authentication provider is not enabled.');
+ pht('The LDAP authentication provider is not enabled.'));
exit(1);
}
@@ -35,14 +35,14 @@
$adapter = $provider->getAdapter();
$console->writeOut("%s\n", pht('Enter LDAP Credentials'));
- $username = phutil_console_prompt('LDAP Username: ');
+ $username = phutil_console_prompt(pht('LDAP Username: '));
if (!strlen($username)) {
throw new PhutilArgumentUsageException(
pht('You must enter an LDAP username.'));
}
phutil_passthru('stty -echo');
- $password = phutil_console_prompt('LDAP Password: ');
+ $password = phutil_console_prompt(pht('LDAP Password: '));
phutil_passthru('stty echo');
if (!strlen($password)) {
diff --git a/src/applications/auth/management/PhabricatorAuthManagementRecoverWorkflow.php b/src/applications/auth/management/PhabricatorAuthManagementRecoverWorkflow.php
--- a/src/applications/auth/management/PhabricatorAuthManagementRecoverWorkflow.php
+++ b/src/applications/auth/management/PhabricatorAuthManagementRecoverWorkflow.php
@@ -8,8 +8,9 @@
->setName('recover')
->setExamples('**recover** __username__')
->setSynopsis(
- 'Recover access to an administrative account if you have locked '.
- 'yourself out of Phabricator.')
+ pht(
+ 'Recover access to an administrative account if you have locked '.
+ 'yourself out of Phabricator.'))
->setArguments(
array(
'username' => array(
@@ -29,8 +30,9 @@
throw new PhutilArgumentUsageException(
pht(
'This Phabricator installation has no recoverable administrator '.
- 'accounts. You can use `bin/accountadmin` to create a new '.
- 'administrator account or make an existing user an administrator.'));
+ 'accounts. You can use `%s` to create a new administrator '.
+ 'account or make an existing user an administrator.',
+ 'bin/accountadmin'));
}
$can_recover = mpull($can_recover, 'getUsername');
sort($can_recover);
@@ -85,10 +87,11 @@
$console->writeOut(' %s', $onetime_uri);
$console->writeOut("\n\n");
$console->writeOut(
+ "%s\n",
pht(
'After logging in, you can use the "Auth" application to add or '.
'restore authentication providers and allow normal logins to '.
- 'succeed.')."\n");
+ 'succeed.'));
return 0;
}
diff --git a/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php b/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php
--- a/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php
+++ b/src/applications/auth/management/PhabricatorAuthManagementRefreshWorkflow.php
@@ -16,17 +16,17 @@
array(
'name' => 'user',
'param' => 'user',
- 'help' => 'Refresh tokens for a given user.',
+ 'help' => pht('Refresh tokens for a given user.'),
),
array(
'name' => 'type',
'param' => 'provider',
- 'help' => 'Refresh tokens for a given provider type.',
+ 'help' => pht('Refresh tokens for a given provider type.'),
),
array(
'name' => 'domain',
'param' => 'domain',
- 'help' => 'Refresh tokens for a given domain.',
+ 'help' => pht('Refresh tokens for a given domain.'),
),
));
}
diff --git a/src/applications/auth/management/PhabricatorAuthManagementStripWorkflow.php b/src/applications/auth/management/PhabricatorAuthManagementStripWorkflow.php
--- a/src/applications/auth/management/PhabricatorAuthManagementStripWorkflow.php
+++ b/src/applications/auth/management/PhabricatorAuthManagementStripWorkflow.php
@@ -7,9 +7,7 @@
$this
->setName('strip')
->setExamples('**strip** [--user username] [--type type]')
- ->setSynopsis(
- pht(
- 'Remove multi-factor authentication from an account.'))
+ ->setSynopsis(pht('Remove multi-factor authentication from an account.'))
->setArguments(
array(
array(
@@ -50,13 +48,17 @@
if ($usernames && $all_users) {
throw new PhutilArgumentUsageException(
pht(
- 'Specify either specific users with --user, or all users with '.
- '--all-users, but not both.'));
+ 'Specify either specific users with %s, or all users with '.
+ '%s, but not both.',
+ '--user',
+ '--all-users'));
} else if (!$usernames && !$all_users) {
throw new PhutilArgumentUsageException(
pht(
- 'Use --user to specify which user to strip factors from, or '.
- '--all-users to strip factors from all users.'));
+ 'Use %s to specify which user to strip factors from, or '.
+ '%s to strip factors from all users.',
+ '--user',
+ '--all-users'));
} else if ($usernames) {
$users = id(new PhabricatorPeopleQuery())
->setViewer($this->getViewer())
diff --git a/src/applications/auth/management/PhabricatorAuthManagementTrustOAuthClientWorkflow.php b/src/applications/auth/management/PhabricatorAuthManagementTrustOAuthClientWorkflow.php
--- a/src/applications/auth/management/PhabricatorAuthManagementTrustOAuthClientWorkflow.php
+++ b/src/applications/auth/management/PhabricatorAuthManagementTrustOAuthClientWorkflow.php
@@ -28,7 +28,8 @@
if (!$id) {
throw new PhutilArgumentUsageException(
pht(
- 'Specify an OAuth client id with --id.'));
+ 'Specify an OAuth client id with %s.',
+ '--id'));
}
$client = id(new PhabricatorOAuthServerClientQuery())
diff --git a/src/applications/auth/management/PhabricatorAuthManagementUntrustOAuthClientWorkflow.php b/src/applications/auth/management/PhabricatorAuthManagementUntrustOAuthClientWorkflow.php
--- a/src/applications/auth/management/PhabricatorAuthManagementUntrustOAuthClientWorkflow.php
+++ b/src/applications/auth/management/PhabricatorAuthManagementUntrustOAuthClientWorkflow.php
@@ -28,7 +28,8 @@
if (!$id) {
throw new PhutilArgumentUsageException(
pht(
- 'Specify an OAuth client id with --id.'));
+ 'Specify an OAuth client ID with %s.',
+ '--id'));
}
$client = id(new PhabricatorOAuthServerClientQuery())
@@ -39,7 +40,7 @@
if (!$client) {
throw new PhutilArgumentUsageException(
pht(
- 'Failed to find an OAuth client with id %s.', $id));
+ 'Failed to find an OAuth client with ID %s.', $id));
}
if (!$client->getIsTrusted()) {
diff --git a/src/applications/auth/provider/PhabricatorAuthProvider.php b/src/applications/auth/provider/PhabricatorAuthProvider.php
--- a/src/applications/auth/provider/PhabricatorAuthProvider.php
+++ b/src/applications/auth/provider/PhabricatorAuthProvider.php
@@ -16,7 +16,10 @@
public function getProviderConfig() {
if ($this->providerConfig === null) {
throw new Exception(
- 'Call attachProviderConfig() before getProviderConfig()!');
+ pht(
+ 'Call %s before %s!',
+ 'attachProviderConfig()',
+ __FUNCTION__.'()'));
}
return $this->providerConfig;
}
@@ -196,7 +199,7 @@
protected function loadOrCreateAccount($account_id) {
if (!strlen($account_id)) {
- throw new Exception('loadOrCreateAccount(...): empty account ID!');
+ throw new Exception(pht('Empty account ID!'));
}
$adapter = $this->getAdapter();
@@ -204,14 +207,18 @@
if (!strlen($adapter->getAdapterType())) {
throw new Exception(
- "AuthAdapter (of class '{$adapter_class}') has an invalid ".
- "implementation: no adapter type.");
+ pht(
+ "AuthAdapter (of class '%s') has an invalid implementation: ".
+ "no adapter type.",
+ $adapter_class));
}
if (!strlen($adapter->getAdapterDomain())) {
throw new Exception(
- "AuthAdapter (of class '{$adapter_class}') has an invalid ".
- "implementation: no adapter domain.");
+ pht(
+ "AuthAdapter (of class '%s') has an invalid implementation: ".
+ "no adapter domain.",
+ $adapter_class));
}
$account = id(new PhabricatorExternalAccount())->loadOneWhere(
diff --git a/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php b/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php
--- a/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php
+++ b/src/applications/auth/provider/PhabricatorLDAPAuthProvider.php
@@ -166,7 +166,7 @@
$account_id = $adapter->getAccountID();
DarkConsoleErrorLogPluginAPI::disableDiscardMode();
} else {
- throw new Exception('Username and password are required!');
+ throw new Exception(pht('Username and password are required!'));
}
} catch (PhutilAuthCredentialException $ex) {
$response = $controller->buildProviderPageResponse(
@@ -258,8 +258,9 @@
'Before you can set up or use LDAP, you need to install the PHP '.
'LDAP extension. It is not currently installed, so PHP can not '.
'talk to LDAP. Usually you can install it with '.
- '`yum install php-ldap`, `apt-get install php5-ldap`, or a '.
- 'similar package manager command.'));
+ '`%s`, `%s`, or a similar package manager command.',
+ 'yum install php-ldap',
+ 'apt-get install php5-ldap'));
}
}
diff --git a/src/applications/auth/provider/PhabricatorOAuth1AuthProvider.php b/src/applications/auth/provider/PhabricatorOAuth1AuthProvider.php
--- a/src/applications/auth/provider/PhabricatorOAuth1AuthProvider.php
+++ b/src/applications/auth/provider/PhabricatorOAuth1AuthProvider.php
@@ -84,11 +84,11 @@
$verifier = $request->getStr('oauth_verifier');
if (!$token) {
- throw new Exception("Expected 'oauth_token' in request!");
+ throw new Exception(pht("Expected '%s' in request!", 'oauth_token'));
}
if (!$verifier) {
- throw new Exception("Expected 'oauth_verifier' in request!");
+ throw new Exception(pht("Expected '%s' in request!", 'oauth_verifier'));
}
$adapter->setToken($token);
diff --git a/src/applications/auth/provider/PhabricatorOAuth2AuthProvider.php b/src/applications/auth/provider/PhabricatorOAuth2AuthProvider.php
--- a/src/applications/auth/provider/PhabricatorOAuth2AuthProvider.php
+++ b/src/applications/auth/provider/PhabricatorOAuth2AuthProvider.php
@@ -262,8 +262,7 @@
phabricator_datetime($oauth_expires, $viewer)));
} else {
$item->addAttribute(
- pht(
- 'Active OAuth Token'));
+ pht('Active OAuth Token'));
}
} else if ($is_invalid) {
$item->addAttribute(pht('Invalid OAuth Access Token'));
diff --git a/src/applications/auth/provider/PhabricatorOAuthAuthProvider.php b/src/applications/auth/provider/PhabricatorOAuthAuthProvider.php
--- a/src/applications/auth/provider/PhabricatorOAuthAuthProvider.php
+++ b/src/applications/auth/provider/PhabricatorOAuthAuthProvider.php
@@ -82,8 +82,9 @@
$help = $this->getProviderConfigurationHelp();
return $help."\n\n".
- pht('Use the **OAuth App Notes** field to record details about which '.
- 'account the external application is registered under.');
+ pht(
+ 'Use the **OAuth App Notes** field to record details about which '.
+ 'account the external application is registered under.');
}
abstract protected function getProviderConfigurationHelp();
diff --git a/src/applications/auth/provider/PhabricatorPasswordAuthProvider.php b/src/applications/auth/provider/PhabricatorPasswordAuthProvider.php
--- a/src/applications/auth/provider/PhabricatorPasswordAuthProvider.php
+++ b/src/applications/auth/provider/PhabricatorPasswordAuthProvider.php
@@ -13,7 +13,8 @@
"(WARNING) Examine the table below for information on how password ".
"hashes will be stored in the database.\n\n".
"(NOTE) You can select a minimum password length by setting ".
- "`account.minimum-password-length` in configuration.");
+ "`%s` in configuration.",
+ 'account.minimum-password-length');
}
public function renderConfigurationFooter() {
@@ -160,7 +161,7 @@
public function buildLinkForm(
PhabricatorAuthLinkController $controller) {
- throw new Exception("Password providers can't be linked.");
+ throw new Exception(pht("Password providers can't be linked."));
}
private function renderPasswordLoginForm(
@@ -205,8 +206,9 @@
$errors[] = pht('CAPTCHA was not entered correctly.');
} else {
$e_captcha = pht('Required');
- $errors[] = pht('Too many login failures recently. You must '.
- 'submit a CAPTCHA with your login request.');
+ $errors[] = pht(
+ 'Too many login failures recently. You must '.
+ 'submit a CAPTCHA with your login request.');
}
} else if ($request->isHTTPPost()) {
// NOTE: This is intentionally vague so as not to disclose whether a
@@ -225,13 +227,13 @@
->appendChild($errors)
->appendChild(
id(new AphrontFormTextControl())
- ->setLabel('Username or Email')
+ ->setLabel(pht('Username or Email'))
->setName('username')
->setValue($v_user)
->setError($e_user))
->appendChild(
id(new AphrontFormPasswordControl())
- ->setLabel('Password')
+ ->setLabel(pht('Password'))
->setName('password')
->setError($e_pass));
diff --git a/src/applications/auth/provider/PhabricatorPersonaAuthProvider.php b/src/applications/auth/provider/PhabricatorPersonaAuthProvider.php
--- a/src/applications/auth/provider/PhabricatorPersonaAuthProvider.php
+++ b/src/applications/auth/provider/PhabricatorPersonaAuthProvider.php
@@ -9,8 +9,7 @@
}
public function getDescriptionForCreate() {
- return pht(
- 'Allow users to login or register using Mozilla Persona.');
+ return pht('Allow users to login or register using Mozilla Persona.');
}
public function getAdapter() {
@@ -54,12 +53,12 @@
$response = null;
if (!$request->isAjax()) {
- throw new Exception('Expected this request to come via Ajax.');
+ throw new Exception(pht('Expected this request to come via Ajax.'));
}
$assertion = $request->getStr('assertion');
if (!$assertion) {
- throw new Exception('Expected identity assertion.');
+ throw new Exception(pht('Expected identity assertion.'));
}
$adapter->setAssertion($assertion);
diff --git a/src/applications/auth/provider/PhabricatorPhabricatorAuthProvider.php b/src/applications/auth/provider/PhabricatorPhabricatorAuthProvider.php
--- a/src/applications/auth/provider/PhabricatorPhabricatorAuthProvider.php
+++ b/src/applications/auth/provider/PhabricatorPhabricatorAuthProvider.php
@@ -122,7 +122,8 @@
$uri = new PhutilURI($values[$key_uri]);
if (!$uri->getProtocol()) {
$errors[] = pht(
- 'Phabricator base URI should include protocol (like "https://").');
+ 'Phabricator base URI should include protocol (like "%s").',
+ 'https://');
$issues[$key_uri] = pht('Invalid');
}
}
diff --git a/src/applications/auth/query/PhabricatorAuthProviderConfigQuery.php b/src/applications/auth/query/PhabricatorAuthProviderConfigQuery.php
--- a/src/applications/auth/query/PhabricatorAuthProviderConfigQuery.php
+++ b/src/applications/auth/query/PhabricatorAuthProviderConfigQuery.php
@@ -88,7 +88,7 @@
'isEnabled = 1');
break;
default:
- throw new Exception("Unknown status '{$status}'!");
+ throw new Exception(pht("Unknown status '%s'!", $status));
}
$where[] = $this->buildPagingClause($conn_r);
diff --git a/src/applications/auth/sshkey/PhabricatorAuthSSHPublicKey.php b/src/applications/auth/sshkey/PhabricatorAuthSSHPublicKey.php
--- a/src/applications/auth/sshkey/PhabricatorAuthSSHPublicKey.php
+++ b/src/applications/auth/sshkey/PhabricatorAuthSSHPublicKey.php
@@ -129,8 +129,9 @@
throw new PhutilProxyException(
pht(
'Failed to convert public key into PKCS8 format. If you are '.
- 'developing on OSX, you may be able to use `bin/auth cache-pkcs8` '.
+ 'developing on OSX, you may be able to use `%s` '.
'to work around this issue. %s',
+ 'bin/auth cache-pkcs8',
$ex->getMessage()),
$ex);
}
diff --git a/src/applications/base/PhabricatorApplication.php b/src/applications/base/PhabricatorApplication.php
--- a/src/applications/base/PhabricatorApplication.php
+++ b/src/applications/base/PhabricatorApplication.php
@@ -32,7 +32,7 @@
public abstract function getName();
public function getShortDescription() {
- return $this->getName().' Application';
+ return pht('%s Application', $this->getName());
}
public function isInstalled() {
@@ -254,7 +254,7 @@
}
public function getAppEmailBlurb() {
- throw new Exception('Not Implemented.');
+ throw new PhutilMethodNotImplementedException();
}
@@ -371,7 +371,7 @@
}
if (!$selected) {
- throw new Exception("No application '{$class_name}'!");
+ throw new Exception(pht("No application '%s'!", $class_name));
}
return $selected;
@@ -531,7 +531,7 @@
private function getCustomCapabilitySpecification($capability) {
$custom = $this->getCustomCapabilities();
if (!isset($custom[$capability])) {
- throw new Exception("Unknown capability '{$capability}'!");
+ throw new Exception(pht("Unknown capability '%s'!", $capability));
}
return $custom[$capability];
}
diff --git a/src/applications/base/controller/PhabricatorController.php b/src/applications/base/controller/PhabricatorController.php
--- a/src/applications/base/controller/PhabricatorController.php
+++ b/src/applications/base/controller/PhabricatorController.php
@@ -388,8 +388,8 @@
if (isset($seen[$hash])) {
$seen[] = get_class($response);
throw new Exception(
- 'Cycle while reducing proxy responses: '.
- implode(' -> ', $seen));
+ pht('Cycle while reducing proxy responses: %s',
+ implode(' -> ', $seen)));
}
$seen[$hash] = get_class($response);
diff --git a/src/applications/base/controller/__tests__/PhabricatorAccessControlTestCase.php b/src/applications/base/controller/__tests__/PhabricatorAccessControlTestCase.php
--- a/src/applications/base/controller/__tests__/PhabricatorAccessControlTestCase.php
+++ b/src/applications/base/controller/__tests__/PhabricatorAccessControlTestCase.php
@@ -63,7 +63,7 @@
// Test standard defaults.
$this->checkAccess(
- 'Default',
+ pht('Default'),
id(clone $controller),
$request,
array(
@@ -82,7 +82,7 @@
$env->overrideEnvConfig('auth.require-email-verification', true);
$this->checkAccess(
- 'Email Verification Required',
+ pht('Email Verification Required'),
id(clone $controller),
$request,
array(
@@ -97,7 +97,7 @@
));
$this->checkAccess(
- 'Email Verification Required, With Exception',
+ pht('Email Verification Required, With Exception'),
id(clone $controller)->setConfig('email', false),
$request,
array(
@@ -116,7 +116,7 @@
// Test admin access.
$this->checkAccess(
- 'Admin Required',
+ pht('Admin Required'),
id(clone $controller)->setConfig('admin', true),
$request,
array(
@@ -134,7 +134,7 @@
// Test disabled access.
$this->checkAccess(
- 'Allow Disabled',
+ pht('Allow Disabled'),
id(clone $controller)->setConfig('enabled', false),
$request,
array(
@@ -152,7 +152,7 @@
// Test no login required.
$this->checkAccess(
- 'No Login Required',
+ pht('No Login Required'),
id(clone $controller)->setConfig('login', false),
$request,
array(
@@ -170,7 +170,7 @@
// Test public access.
$this->checkAccess(
- 'Public Access',
+ pht('Public Access'),
id(clone $controller)->setConfig('public', true),
$request,
array(
@@ -185,7 +185,7 @@
$env->overrideEnvConfig('policy.allow-public', true);
$this->checkAccess(
- 'Public + configured',
+ pht('Public + configured'),
id(clone $controller)->setConfig('public', true),
$request,
array(
@@ -210,7 +210,7 @@
$app_controller = id(clone $controller)->setCurrentApplication($app);
$this->checkAccess(
- 'Application Controller',
+ pht('Application Controller'),
$app_controller,
$request,
array(
@@ -225,7 +225,7 @@
));
$this->checkAccess(
- 'Application Controller',
+ pht('Application Controller'),
id(clone $app_controller)->setConfig('login', false),
$request,
array(
@@ -259,7 +259,7 @@
$this->assertTrue(
($result === null),
- "Expect user '{$uname}' to be allowed access to '{$label}'.");
+ pht("Expect user '%s' to be allowed access to '%s'.", $uname, $label));
}
foreach ($no as $user) {
@@ -274,7 +274,7 @@
$this->assertFalse(
($result === null),
- "Expect user '{$uname}' to be denied access to '{$label}'.");
+ pht("Expect user '%s' to be denied access to '%s'.", $uname, $label));
}
}
diff --git a/src/applications/cache/PhabricatorCaches.php b/src/applications/cache/PhabricatorCaches.php
--- a/src/applications/cache/PhabricatorCaches.php
+++ b/src/applications/cache/PhabricatorCaches.php
@@ -332,7 +332,9 @@
public static function inflateData($value) {
if (!function_exists('gzinflate')) {
throw new Exception(
- pht('gzinflate() is not available; unable to read deflated data!'));
+ pht(
+ '%s is not available; unable to read deflated data!',
+ 'gzinflate()'));
}
$value = gzinflate($value);
diff --git a/src/applications/cache/PhabricatorKeyValueDatabaseCache.php b/src/applications/cache/PhabricatorKeyValueDatabaseCache.php
--- a/src/applications/cache/PhabricatorKeyValueDatabaseCache.php
+++ b/src/applications/cache/PhabricatorKeyValueDatabaseCache.php
@@ -136,7 +136,7 @@
private function willWriteValue($key, $value) {
if (!is_string($value)) {
- throw new Exception('Only strings may be written to the DB cache!');
+ throw new Exception(pht('Only strings may be written to the DB cache!'));
}
static $can_deflate;
@@ -162,7 +162,7 @@
case self::CACHE_FORMAT_DEFLATE:
return PhabricatorCaches::inflateData($value);
default:
- throw new Exception('Unknown cache format.');
+ throw new Exception(pht('Unknown cache format.'));
}
}
diff --git a/src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php b/src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php
--- a/src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php
+++ b/src/applications/cache/management/PhabricatorCacheManagementPurgeWorkflow.php
@@ -6,24 +6,24 @@
protected function didConstruct() {
$this
->setName('purge')
- ->setSynopsis('Drop data from caches.')
+ ->setSynopsis(pht('Drop data from caches.'))
->setArguments(
array(
array(
'name' => 'purge-all',
- 'help' => 'Purge all caches.',
+ 'help' => pht('Purge all caches.'),
),
array(
'name' => 'purge-remarkup',
- 'help' => 'Purge the remarkup cache.',
+ 'help' => pht('Purge the remarkup cache.'),
),
array(
'name' => 'purge-changeset',
- 'help' => 'Purge the Differential changeset cache.',
+ 'help' => pht('Purge the Differential changeset cache.'),
),
array(
'name' => 'purge-general',
- 'help' => 'Purge the general cache.',
+ 'help' => pht('Purge the general cache.'),
),
));
}
@@ -46,27 +46,30 @@
}
throw new PhutilArgumentUsageException(
- "Specify which cache or caches to purge, or use '--purge-all'. ".
- "Available caches are: ".implode(', ', $list).". Use '--help' ".
- "for more information.");
+ pht(
+ "Specify which cache or caches to purge, or use '%s'. Available ".
+ "caches are: %s. Use '%s' for more information.",
+ '--purge-all',
+ implode(', ', $list),
+ '--help'));
}
if ($purge['remarkup']) {
- $console->writeOut('Purging remarkup cache...');
+ $console->writeOut(pht('Purging remarkup cache...'));
$this->purgeRemarkupCache();
- $console->writeOut("done.\n");
+ $console->writeOut("%s\n", pht('Done.'));
}
if ($purge['changeset']) {
- $console->writeOut('Purging changeset cache...');
+ $console->writeOut(pht('Purging changeset cache...'));
$this->purgeChangesetCache();
- $console->writeOut("done.\n");
+ $console->writeOut("%s\n", pht('Done.'));
}
if ($purge['general']) {
- $console->writeOut('Purging general cache...');
+ $console->writeOut(pht('Purging general cache...'));
$this->purgeGeneralCache();
- $console->writeOut("done.\n");
+ $console->writeOut("%s\n", pht('Done.'));
}
}
diff --git a/src/applications/cache/spec/PhabricatorCacheSpec.php b/src/applications/cache/spec/PhabricatorCacheSpec.php
--- a/src/applications/cache/spec/PhabricatorCacheSpec.php
+++ b/src/applications/cache/spec/PhabricatorCacheSpec.php
@@ -96,8 +96,8 @@
$message = pht(
'The APC or APCu PHP extensions are installed, but not enabled in your '.
'PHP configuration. Enabling these extensions will improve Phabricator '.
- 'performance. Edit the "apc.enabled" setting to enable these '.
- 'extensions.');
+ 'performance. Edit the "%s" setting to enable these extensions.',
+ 'apc.enabled');
return $this
->newIssue('extension.apc.enabled')
diff --git a/src/applications/cache/spec/PhabricatorOpcodeCacheSpec.php b/src/applications/cache/spec/PhabricatorOpcodeCacheSpec.php
--- a/src/applications/cache/spec/PhabricatorOpcodeCacheSpec.php
+++ b/src/applications/cache/spec/PhabricatorOpcodeCacheSpec.php
@@ -35,14 +35,14 @@
$slam_defense = ini_get('apc.slam_defense');
if (!$write_lock || $slam_defense) {
- $summary = pht(
- 'Adjust APC settings to quiet unnecessary errors.');
+ $summary = pht('Adjust APC settings to quiet unnecessary errors.');
$message = pht(
'Some versions of APC may emit unnecessary errors into the '.
'error log under the current APC settings. To resolve this, '.
- 'enable "apc.write_lock" and disable "apc.slam_defense" in '.
- 'your PHP configuration.');
+ 'enable "%s" and disable "%s" in your PHP configuration.',
+ 'apc.write_lock',
+ 'apc.slam_defense');
$this
->newIssue('extension.apc.write-lock')
@@ -58,36 +58,40 @@
$is_stat_enabled = ini_get('apc.stat');
if ($is_stat_enabled && !$is_dev) {
$summary = pht(
- '"apc.stat" is currently enabled, but should probably be disabled.');
+ '"%s" is currently enabled, but should probably be disabled.',
+ 'apc.stat');
$message = pht(
- 'The "apc.stat" setting is currently enabled in your PHP '.
- 'configuration. In production mode, "apc.stat" should be '.
- 'disabled. This will improve performance slightly.');
+ 'The "%s" setting is currently enabled in your PHP configuration. '.
+ 'In production mode, "%s" should be disabled. '.
+ 'This will improve performance slightly.',
+ 'apc.stat',
+ 'apc.stat');
$this
->newIssue('extension.apc.stat-enabled')
- ->setShortName(pht('"apc.stat" Enabled'))
- ->setName(pht('"apc.stat" Enabled in Production'))
+ ->setShortName(pht('"%s" Enabled', 'apc.stat'))
+ ->setName(pht('"%s" Enabled in Production', 'apc.stat'))
->setSummary($summary)
->setMessage($message)
->addPHPConfig('apc.stat')
->addPhabricatorConfig('phabricator.developer-mode');
} else if (!$is_stat_enabled && $is_dev) {
$summary = pht(
- '"apc.stat" is currently disabled, but should probably be enabled.');
+ '"%s" is currently disabled, but should probably be enabled.',
+ 'apc.stat');
$message = pht(
- 'The "apc.stat" setting is currently disabled in your PHP '.
- 'configuration, but Phabricator is running in development mode. '.
- 'This option should normally be enabled in development so you do '.
- 'not need to restart your webserver after making changes to the '.
- 'code.');
+ 'The "%s" setting is currently disabled in your PHP configuration, '.
+ 'but Phabricator is running in development mode. This option should '.
+ 'normally be enabled in development so you do not need to restart '.
+ 'your webserver after making changes to the code.',
+ 'apc.stat');
$this
->newIssue('extension.apc.stat-disabled')
- ->setShortName(pht('"apc.stat" Disabled'))
- ->setName(pht('"apc.stat" Disabled in Development'))
+ ->setShortName(pht('"%s" Disabled', 'apc.stat'))
+ ->setName(pht('"%s" Disabled in Development', 'apc.stat'))
->setSummary($summary)
->setMessage($message)
->addPHPConfig('apc.stat')
@@ -128,8 +132,9 @@
$message = pht(
'In development, OPcache should be configured to always reload '.
'code so the webserver does not need to be restarted after making '.
- 'changes. To do this, enable "opcache.validate_timestamps" and '.
- 'set "opcache.revalidate_freq" to 0.');
+ 'changes. To do this, enable "%s" and set "%s" to 0.',
+ 'opcache.validate_timestamps',
+ 'opcache.revalidate_freq');
$this
->newIssue('extension.opcache.devmode')
@@ -141,14 +146,13 @@
->addPHPConfig('opcache.revalidate_freq')
->addPhabricatorConfig('phabricator.developer-mode');
} else if (!$is_dev && $validate) {
- $summary = pht(
- 'OPcache is not configured ideally for production.');
+ $summary = pht('OPcache is not configured ideally for production.');
$message = pht(
'In production, OPcache should be configured to never '.
'revalidate code. This will slightly improve performance. '.
- 'To do this, disable "opcache.validate_timestamps" in your PHP '.
- 'configuration.');
+ 'To do this, disable "%s" in your PHP configuration.',
+ 'opcache.validate_timestamps');
$this
->newIssue('extension.opcache.production')
@@ -166,8 +170,9 @@
$message = pht(
'The PHP "Zend OPcache" extension is installed, but not enabled in '.
'your PHP configuration. Enabling it will dramatically improve '.
- 'Phabricator performance. Edit the "opcache.enable" setting to '.
- 'enable the extension.');
+ 'Phabricator performance. Edit the "%s" setting to '.
+ 'enable the extension.',
+ 'opcache.enable');
$this->newIssue('extension.opcache.enable')
->setShortName(pht('OPcache Disabled'))
diff --git a/src/applications/calendar/editor/PhabricatorCalendarEventEditor.php b/src/applications/calendar/editor/PhabricatorCalendarEventEditor.php
--- a/src/applications/calendar/editor/PhabricatorCalendarEventEditor.php
+++ b/src/applications/calendar/editor/PhabricatorCalendarEventEditor.php
@@ -311,13 +311,9 @@
public function getMailTagsMap() {
return array(
PhabricatorCalendarEventTransaction::MAILTAG_CONTENT =>
- pht(
- "An event's name, status, invite list, ".
- "and description changes."),
+ pht("An event's name, status, invite list, and description changes."),
PhabricatorCalendarEventTransaction::MAILTAG_RESCHEDULE =>
- pht(
- "An event's start and end date ".
- "and cancellation status changes."),
+ pht("An event's start and end date and cancellation status changes."),
PhabricatorCalendarEventTransaction::MAILTAG_OTHER =>
pht('Other event activity not listed above occurs.'),
);
diff --git a/src/applications/calendar/mail/PhabricatorCalendarReplyHandler.php b/src/applications/calendar/mail/PhabricatorCalendarReplyHandler.php
--- a/src/applications/calendar/mail/PhabricatorCalendarReplyHandler.php
+++ b/src/applications/calendar/mail/PhabricatorCalendarReplyHandler.php
@@ -5,7 +5,10 @@
public function validateMailReceiver($mail_receiver) {
if (!($mail_receiver instanceof PhabricatorCalendarEvent)) {
- throw new Exception('Mail receiver is not a PhabricatorCalendarEvent!');
+ throw new Exception(
+ pht(
+ 'Mail receiver is not a %s!',
+ 'PhabricatorCalendarEvent'));
}
}
diff --git a/src/applications/calendar/view/AphrontCalendarEventView.php b/src/applications/calendar/view/AphrontCalendarEventView.php
--- a/src/applications/calendar/view/AphrontCalendarEventView.php
+++ b/src/applications/calendar/view/AphrontCalendarEventView.php
@@ -101,7 +101,7 @@
}
public function render() {
- throw new Exception('Events are only rendered indirectly.');
+ throw new Exception(pht('Events are only rendered indirectly.'));
}
}
diff --git a/src/applications/celerity/CelerityResourceGraph.php b/src/applications/celerity/CelerityResourceGraph.php
--- a/src/applications/celerity/CelerityResourceGraph.php
+++ b/src/applications/celerity/CelerityResourceGraph.php
@@ -8,8 +8,9 @@
protected function loadEdges(array $nodes) {
if (!$this->graphSet) {
throw new Exception(
- 'Call setResourceGraph before loading the graph!'
- );
+ pht(
+ 'Call %s before loading the graph!',
+ 'setResourceGraph()'));
}
$graph = $this->getResourceGraph();
diff --git a/src/applications/celerity/CelerityResourceMap.php b/src/applications/celerity/CelerityResourceMap.php
--- a/src/applications/celerity/CelerityResourceMap.php
+++ b/src/applications/celerity/CelerityResourceMap.php
@@ -43,7 +43,8 @@
if (empty($resources_list[$name])) {
throw new Exception(
pht(
- 'No resource source exists with name "%s"!', $name));
+ 'No resource source exists with name "%s"!',
+ $name));
}
$instance = new CelerityResourceMap($resources_list[$name]);
diff --git a/src/applications/celerity/CelerityResourceMapGenerator.php b/src/applications/celerity/CelerityResourceMapGenerator.php
--- a/src/applications/celerity/CelerityResourceMapGenerator.php
+++ b/src/applications/celerity/CelerityResourceMapGenerator.php
@@ -244,7 +244,10 @@
if (count($provides) > 1) {
throw new Exception(
- pht('Resource "%s" must @provide at most one Celerity target.', $name));
+ pht(
+ 'Resource "%s" must %s at most one Celerity target.',
+ $name,
+ '@provide'));
}
return array(head($provides), $requires);
@@ -268,7 +271,9 @@
$cycle = $graph->detectCycles($provides);
if ($cycle) {
throw new Exception(
- pht('Cycle detected in resource graph: %s', implode(' > ', $cycle)));
+ pht(
+ 'Cycle detected in resource graph: %s',
+ implode(' > ', $cycle)));
}
}
}
@@ -298,9 +303,10 @@
throw new Exception(
pht(
'Package specification for "%s" includes "%s", but that symbol '.
- 'is not @provided by any resource.',
+ 'is not %s by any resource.',
$package_name,
- $symbol));
+ $symbol,
+ '@provided'));
}
$resource_name = $reverse_map[$symbol_hash];
diff --git a/src/applications/celerity/CelerityResourceTransformer.php b/src/applications/celerity/CelerityResourceTransformer.php
--- a/src/applications/celerity/CelerityResourceTransformer.php
+++ b/src/applications/celerity/CelerityResourceTransformer.php
@@ -332,7 +332,10 @@
if (empty($map[$var_name])) {
$path = $this->currentPath;
throw new Exception(
- "CSS file '{$path}' has unknown variable '{$var_name}'.");
+ pht(
+ "CSS file '%s' has unknown variable '%s'.",
+ $path,
+ $var_name));
}
return $map[$var_name];
diff --git a/src/applications/celerity/CeleritySpriteGenerator.php b/src/applications/celerity/CeleritySpriteGenerator.php
--- a/src/applications/celerity/CeleritySpriteGenerator.php
+++ b/src/applications/celerity/CeleritySpriteGenerator.php
@@ -223,8 +223,11 @@
foreach ($images as $image) {
if (!preg_match('/\.png$/', $image)) {
throw new Exception(
- "Expected file '{$image}' in '{$path}' to be a sprite source ".
- "ending in '.png'.");
+ pht(
+ "Expected file '%s' in '%s' to be a sprite source ending in '%s'.",
+ $image,
+ $path,
+ '.png'));
}
$result[] = substr($image, 0, -4);
}
diff --git a/src/applications/celerity/CelerityStaticResourceResponse.php b/src/applications/celerity/CelerityStaticResourceResponse.php
--- a/src/applications/celerity/CelerityStaticResourceResponse.php
+++ b/src/applications/celerity/CelerityStaticResourceResponse.php
@@ -242,10 +242,15 @@
public static function renderInlineScript($data) {
if (stripos($data, '</script>') !== false) {
throw new Exception(
- 'Literal </script> is not allowed inside inline script.');
+ pht(
+ 'Literal %s is not allowed inside inline script.',
+ '</script>'));
}
if (strpos($data, '<!') !== false) {
- throw new Exception('Literal <! is not allowed inside inline script.');
+ throw new Exception(
+ pht(
+ 'Literal %s is not allowed inside inline script.',
+ '<!'));
}
// We don't use <![CDATA[ ]]> because it is ignored by HTML parsers. We
// would need to send the document with XHTML content type.
diff --git a/src/applications/celerity/controller/CelerityResourceController.php b/src/applications/celerity/controller/CelerityResourceController.php
--- a/src/applications/celerity/controller/CelerityResourceController.php
+++ b/src/applications/celerity/controller/CelerityResourceController.php
@@ -35,7 +35,7 @@
$type_map = self::getSupportedResourceTypes();
if (empty($type_map[$type])) {
- throw new Exception('Only static resources may be served.');
+ throw new Exception(pht('Only static resources may be served.'));
}
$dev_mode = PhabricatorEnv::getEnvConfig('phabricator.developer-mode');
diff --git a/src/applications/chatlog/conduit/ChatLogQueryConduitAPIMethod.php b/src/applications/chatlog/conduit/ChatLogQueryConduitAPIMethod.php
--- a/src/applications/chatlog/conduit/ChatLogQueryConduitAPIMethod.php
+++ b/src/applications/chatlog/conduit/ChatLogQueryConduitAPIMethod.php
@@ -11,7 +11,7 @@
}
public function getMethodDescription() {
- return 'Retrieve chatter.';
+ return pht('Retrieve chatter.');
}
protected function defineParamTypes() {
diff --git a/src/applications/chatlog/conduit/ChatLogRecordConduitAPIMethod.php b/src/applications/chatlog/conduit/ChatLogRecordConduitAPIMethod.php
--- a/src/applications/chatlog/conduit/ChatLogRecordConduitAPIMethod.php
+++ b/src/applications/chatlog/conduit/ChatLogRecordConduitAPIMethod.php
@@ -11,7 +11,7 @@
}
public function getMethodDescription() {
- return 'Record chatter.';
+ return pht('Record chatter.');
}
protected function defineParamTypes() {
diff --git a/src/applications/chatlog/controller/PhabricatorChatLogChannelListController.php b/src/applications/chatlog/controller/PhabricatorChatLogChannelListController.php
--- a/src/applications/chatlog/controller/PhabricatorChatLogChannelListController.php
+++ b/src/applications/chatlog/controller/PhabricatorChatLogChannelListController.php
@@ -12,8 +12,8 @@
$user = $request->getUser();
$channels = id(new PhabricatorChatLogChannelQuery())
- ->setViewer($user)
- ->execute();
+ ->setViewer($user)
+ ->execute();
$list = new PHUIObjectItemListView();
foreach ($channels as $channel) {
diff --git a/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php b/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php
--- a/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php
+++ b/src/applications/chatlog/controller/PhabricatorChatLogChannelLogController.php
@@ -29,9 +29,9 @@
->withChannelIDs(array($this->channelID));
$channel = id(new PhabricatorChatLogChannelQuery())
- ->setViewer($user)
- ->withIDs(array($this->channelID))
- ->executeOne();
+ ->setViewer($user)
+ ->withIDs(array($this->channelID))
+ ->executeOne();
if (!$channel) {
return new Aphront404Response();
diff --git a/src/applications/conduit/controller/PhabricatorConduitAPIController.php b/src/applications/conduit/controller/PhabricatorConduitAPIController.php
--- a/src/applications/conduit/controller/PhabricatorConduitAPIController.php
+++ b/src/applications/conduit/controller/PhabricatorConduitAPIController.php
@@ -176,11 +176,14 @@
$config_key = 'security.allow-conduit-act-as-user';
if (!PhabricatorEnv::getEnvConfig($config_key)) {
- throw new Exception('security.allow-conduit-act-as-user is disabled');
+ throw new Exception(pht('%s is disabled.', $config_key));
}
if (!$api_request->getUser()->getIsAdmin()) {
- throw new Exception('Only administrators can use actAsUser');
+ throw new Exception(
+ pht(
+ 'Only administrators can use %s.',
+ __FUNCTION__));
}
$user = id(new PhabricatorUser())->loadOneWhere(
@@ -189,8 +192,10 @@
if (!$user) {
throw new Exception(
- "The actAsUser username '{$user_name}' is not a valid user."
- );
+ pht(
+ "The %s username '%s' is not a valid user.",
+ __FUNCTION__,
+ $user_name));
}
$api_request->setUser($user);
@@ -224,7 +229,8 @@
return array(
'ERR-INVALID-AUTH',
pht(
- 'Request is missing required "auth.host" parameter.'),
+ 'Request is missing required "%s" parameter.',
+ 'auth.host'),
);
}
@@ -266,8 +272,7 @@
if (!$stored_key) {
return array(
'ERR-INVALID-AUTH',
- pht(
- 'No user or device is associated with that public key.'),
+ pht('No user or device is associated with that public key.'),
);
}
@@ -311,7 +316,8 @@
return array(
'ERR-INVALID-AUTH',
pht(
- 'Provided "auth.type" ("%s") is not recognized.',
+ 'Provided "%s" ("%s") is not recognized.',
+ 'auth.type',
$auth_type),
);
}
@@ -405,8 +411,7 @@
if (!($user instanceof PhabricatorUser)) {
return array(
'ERR-INVALID-AUTH',
- pht(
- 'API token is not associated with a valid user.'),
+ pht('API token is not associated with a valid user.'),
);
}
@@ -421,12 +426,11 @@
if ($access_token &&
$method_scope != PhabricatorOAuthServerScope::SCOPE_NOT_ACCESSIBLE) {
$token = id(new PhabricatorOAuthServerAccessToken())
- ->loadOneWhere('token = %s',
- $access_token);
+ ->loadOneWhere('token = %s', $access_token);
if (!$token) {
return array(
'ERR-INVALID-AUTH',
- 'Access token does not exist.',
+ pht('Access token does not exist.'),
);
}
@@ -436,19 +440,18 @@
if (!$valid) {
return array(
'ERR-INVALID-AUTH',
- 'Access token is invalid.',
+ pht('Access token is invalid.'),
);
}
// valid token, so let's log in the user!
$user_phid = $token->getUserPHID();
$user = id(new PhabricatorUser())
- ->loadOneWhere('phid = %s',
- $user_phid);
+ ->loadOneWhere('phid = %s', $user_phid);
if (!$user) {
return array(
'ERR-INVALID-AUTH',
- 'Access token is for invalid user.',
+ pht('Access token is for invalid user.'),
);
}
return $this->validateAuthenticatedUser(
@@ -467,7 +470,7 @@
if (!$user) {
return array(
'ERR-INVALID-AUTH',
- 'Authentication is invalid.',
+ pht('Authentication is invalid.'),
);
}
$token = idx($metadata, 'authToken');
@@ -476,7 +479,7 @@
if (sha1($token.$certificate) !== $signature) {
return array(
'ERR-INVALID-AUTH',
- 'Authentication is invalid.',
+ pht('Authentication is invalid.'),
);
}
return $this->validateAuthenticatedUser(
@@ -491,7 +494,7 @@
if (!$session_key) {
return array(
'ERR-INVALID-SESSION',
- 'Session key is not present.',
+ pht('Session key is not present.'),
);
}
@@ -501,7 +504,7 @@
if (!$user) {
return array(
'ERR-INVALID-SESSION',
- 'Session key is invalid.',
+ pht('Session key is invalid.'),
);
}
@@ -642,10 +645,13 @@
// actually do type checking, it might be reasonable to treat it as
// a string if the parameter type is string.
throw new Exception(
- "The value for parameter '{$key}' is not valid JSON. All ".
- "parameters must be encoded as JSON values, including strings ".
- "(which means you need to surround them in double quotes). ".
- "Check your syntax. Value was: {$value}");
+ pht(
+ "The value for parameter '%s' is not valid JSON. All ".
+ "parameters must be encoded as JSON values, including strings ".
+ "(which means you need to surround them in double quotes). ".
+ "Check your syntax. Value was: %s.",
+ $key,
+ $value));
}
$params[$key] = $decoded_value;
}
@@ -666,7 +672,7 @@
} catch (PhutilJSONParserException $ex) {
throw new PhutilProxyException(
pht(
- "Invalid parameter information was passed to method '%s'",
+ "Invalid parameter information was passed to method '%s'.",
$method),
$ex);
}
diff --git a/src/applications/conduit/controller/PhabricatorConduitConsoleController.php b/src/applications/conduit/controller/PhabricatorConduitConsoleController.php
--- a/src/applications/conduit/controller/PhabricatorConduitConsoleController.php
+++ b/src/applications/conduit/controller/PhabricatorConduitConsoleController.php
@@ -46,7 +46,8 @@
->appendRemarkupInstructions(
pht(
'Enter parameters using **JSON**. For instance, to enter a '.
- 'list, type: `["apple", "banana", "cherry"]`'));
+ 'list, type: `%s`',
+ '["apple", "banana", "cherry"]'));
$params = $method->getParamTypes();
foreach ($params as $param => $desc) {
@@ -67,12 +68,12 @@
$form
->appendChild(
id(new AphrontFormSelectControl())
- ->setLabel('Output Format')
+ ->setLabel(pht('Output Format'))
->setName('output')
->setOptions(
array(
- 'human' => 'Human Readable',
- 'json' => 'JSON',
+ 'human' => pht('Human Readable'),
+ 'json' => pht('JSON'),
)))
->appendChild(
id(new AphrontFormSubmitControl())
diff --git a/src/applications/config/check/PhabricatorAuthSetupCheck.php b/src/applications/config/check/PhabricatorAuthSetupCheck.php
--- a/src/applications/config/check/PhabricatorAuthSetupCheck.php
+++ b/src/applications/config/check/PhabricatorAuthSetupCheck.php
@@ -27,13 +27,12 @@
'You have not configured any authentication providers yet. You '.
'should add a provider (like username/password, LDAP, or GitHub '.
'OAuth) so users can register and log in. You can add and configure '.
- 'providers %s.',
+ 'providers using the "Auth" application.',
phutil_tag(
'a',
array(
'href' => '/auth/',
- ),
- pht('using the "Auth" application')));
+ )));
$this
->newIssue('auth.noproviders')
diff --git a/src/applications/config/check/PhabricatorBinariesSetupCheck.php b/src/applications/config/check/PhabricatorBinariesSetupCheck.php
--- a/src/applications/config/check/PhabricatorBinariesSetupCheck.php
+++ b/src/applications/config/check/PhabricatorBinariesSetupCheck.php
@@ -7,7 +7,6 @@
}
protected function executeChecks() {
-
if (phutil_is_windows()) {
$bin_name = 'where';
} else {
@@ -28,8 +27,9 @@
if (!Filesystem::binaryExists('diff')) {
$message = pht(
- "Without 'diff', Phabricator will not be able to generate or render ".
- "diffs in multiple applications.");
+ "Without '%s', Phabricator will not be able to generate or render ".
+ "diffs in multiple applications.",
+ 'diff');
$this->raiseWarning('diff', $message);
} else {
$tmp_a = new TempFile();
@@ -43,12 +43,13 @@
list($err) = exec_manual('diff %s %s', $tmp_a, $tmp_b);
if ($err) {
$this->newIssue('bin.diff.same')
- ->setName(pht("Unexpected 'diff' Behavior"))
+ ->setName(pht("Unexpected '%s' Behavior", 'diff'))
->setMessage(
pht(
- "The 'diff' binary on this system has unexpected behavior: ".
+ "The '%s' binary on this system has unexpected behavior: ".
"it was expected to exit without an error code when passed ".
"identical files, but exited with code %d.",
+ 'diff',
$err));
}
@@ -58,9 +59,10 @@
->setName(pht("Unexpected 'diff' Behavior"))
->setMessage(
pht(
- "The 'diff' binary on this system has unexpected behavior: ".
+ "The '%s' binary on this system has unexpected behavior: ".
"it was expected to exit with a nonzero error code when passed ".
- "differing files, but did not."));
+ "differing files, but did not.",
+ 'diff'));
}
}
@@ -249,7 +251,6 @@
}
private function raiseBadVersionWarning($binary, $bad_version) {
-
switch ($binary) {
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
break;
diff --git a/src/applications/config/check/PhabricatorDaemonsSetupCheck.php b/src/applications/config/check/PhabricatorDaemonsSetupCheck.php
--- a/src/applications/config/check/PhabricatorDaemonsSetupCheck.php
+++ b/src/applications/config/check/PhabricatorDaemonsSetupCheck.php
@@ -16,8 +16,7 @@
->execute();
if (!$task_daemon) {
- $doc_href = PhabricatorEnv::getDocLink(
- 'Managing Daemons with phd');
+ $doc_href = PhabricatorEnv::getDocLink('Managing Daemons with phd');
$summary = pht(
'You must start the Phabricator daemons to send email, rebuild '.
@@ -57,24 +56,29 @@
if ($phd_user) {
if ($daemon->getRunningAsUser() != $phd_user) {
- $doc_href = PhabricatorEnv::getDocLink(
- 'Managing Daemons with phd');
+ $doc_href = PhabricatorEnv::getDocLink('Managing Daemons with phd');
$summary = pht(
'At least one daemon is currently running as a different '.
- 'user than configured in the Phabricator phd.user setting');
+ 'user than configured in the Phabricator %s setting',
+ 'phd.user');
$message = pht(
'A daemon is running as user %s while the Phabricator config '.
- 'specifies phd.user to be %s.'.
+ 'specifies %s to be %s.'.
"\n\n".
- 'Either adjust phd.user to match %s or start '.
+ 'Either adjust %s to match %s or start '.
'the daemons as the correct user. '.
"\n\n".
- 'phd Daemons will try to '.
- 'use sudo to start as the configured user. '.
- 'Make sure that the user who starts phd has the correct '.
- 'sudo permissions to start phd daemons as %s',
+ '%s Daemons will try to use %s to start as the configured user. '.
+ 'Make sure that the user who starts %s has the correct '.
+ 'sudo permissions to start %s daemons as %s',
+ 'phd.user',
+ 'phd.user',
+ 'phd',
+ 'sudo',
+ 'phd',
+ 'phd',
phutil_tag('tt', array(), $daemon->getRunningAsUser()),
phutil_tag('tt', array(), $phd_user),
phutil_tag('tt', array(), $daemon->getRunningAsUser()),
diff --git a/src/applications/config/check/PhabricatorDatabaseSetupCheck.php b/src/applications/config/check/PhabricatorDatabaseSetupCheck.php
--- a/src/applications/config/check/PhabricatorDatabaseSetupCheck.php
+++ b/src/applications/config/check/PhabricatorDatabaseSetupCheck.php
@@ -79,8 +79,8 @@
if (empty($databases[$namespace.'_meta_data'])) {
$message = pht(
- 'Run the storage upgrade script to setup Phabricator\'s database '.
- 'schema.');
+ "Run the storage upgrade script to setup Phabricator's database ".
+ "schema.");
$this->newIssue('storage.upgrade')
->setName(pht('Setup MySQL Schema'))
@@ -103,10 +103,11 @@
if ($diff) {
$this->newIssue('storage.patch')
->setName(pht('Upgrade MySQL Schema'))
- ->setMessage(pht(
- "Run the storage upgrade script to upgrade Phabricator's database ".
- "schema. Missing patches:<br />%s<br />",
- phutil_implode_html(phutil_tag('br'), array_keys($diff))))
+ ->setMessage(
+ pht(
+ "Run the storage upgrade script to upgrade Phabricator's ".
+ "database schema. Missing patches:<br />%s<br />",
+ phutil_implode_html(phutil_tag('br'), array_keys($diff))))
->addCommand(
hsprintf('<tt>phabricator/ $</tt> ./bin/storage upgrade'));
}
@@ -123,13 +124,15 @@
->setName(pht('Deprecated mysql.host Format'))
->setSummary(
pht(
- 'Move port information from `mysql.host` to `mysql.port` in your '.
- 'config.'))
+ 'Move port information from `%s` to `%s` in your config.',
+ 'mysql.host',
+ 'mysql.port'))
->setMessage(
pht(
- 'Your `mysql.host` configuration contains a port number, but '.
- 'this usage is deprecated. Instead, put the port number in '.
- '`mysql.port`.'))
+ 'Your `%s` configuration contains a port number, but this usage '.
+ 'is deprecated. Instead, put the port number in `%s`.',
+ 'mysql.host',
+ 'mysql.port'))
->addPhabricatorConfig('mysql.host')
->addPhabricatorConfig('mysql.port')
->addCommand(
diff --git a/src/applications/config/check/PhabricatorElasticSetupCheck.php b/src/applications/config/check/PhabricatorElasticSetupCheck.php
--- a/src/applications/config/check/PhabricatorElasticSetupCheck.php
+++ b/src/applications/config/check/PhabricatorElasticSetupCheck.php
@@ -14,8 +14,10 @@
'You enabled Elasticsearch but the index does not exist.');
$message = pht(
- 'You likely enabled search.elastic.host without creating the '.
- 'index. Run `./bin/search init` to correct the index.');
+ 'You likely enabled %s without creating the index. '.
+ 'Run `%s` to correct the index.',
+ 'search.elastic.host',
+ './bin/search init');
$this
->newIssue('elastic.missing-index')
@@ -24,13 +26,13 @@
->setMessage($message)
->addRelatedPhabricatorConfig('search.elastic.host');
} else if (!$engine->indexIsSane()) {
- $summary = pht(
- 'Elasticsearch index exists but needs correction.');
+ $summary = pht('Elasticsearch index exists but needs correction.');
$message = pht(
'Either the Phabricator schema for Elasticsearch has changed '.
'or Elasticsearch created the index automatically. Run '.
- '`./bin/search init` to correct the index.');
+ '`%s` to correct the index.',
+ './bin/search init');
$this
->newIssue('elastic.broken-index')
diff --git a/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php b/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php
--- a/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php
+++ b/src/applications/config/check/PhabricatorExtraConfigSetupCheck.php
@@ -147,8 +147,9 @@
$markup_reason = pht(
'Custom remarkup rules are now added by subclassing '.
- 'PhabricatorRemarkupCustomInlineRule or '.
- 'PhabricatorRemarkupCustomBlockRule.');
+ '%s or %s.',
+ 'PhabricatorRemarkupCustomInlineRule',
+ 'PhabricatorRemarkupCustomBlockRule');
$session_reason = pht(
'Sessions now expire and are garbage collected rather than having an '.
@@ -174,24 +175,26 @@
$ancient_config += array(
'phid.external-loaders' =>
pht(
- 'External loaders have been replaced. Extend `PhabricatorPHIDType` '.
- 'to implement new PHID and handle types.'),
+ 'External loaders have been replaced. Extend `%s` '.
+ 'to implement new PHID and handle types.',
+ 'PhabricatorPHIDType'),
'maniphest.custom-task-extensions-class' =>
pht(
- 'Maniphest fields are now loaded automatically. You can configure '.
- 'them with `maniphest.fields`.'),
+ 'Maniphest fields are now loaded automatically. '.
+ 'You can configure them with `%s`.',
+ 'maniphest.fields'),
'maniphest.custom-fields' =>
pht(
- 'Maniphest fields are now defined in '.
- '`maniphest.custom-field-definitions`. Existing definitions have '.
- 'been migrated.'),
+ 'Maniphest fields are now defined in `%s`. '.
+ 'Existing definitions have been migrated.',
+ 'maniphest.custom-field-definitions'),
'differential.custom-remarkup-rules' => $markup_reason,
'differential.custom-remarkup-block-rules' => $markup_reason,
'auth.sshkeys.enabled' => pht(
'SSH keys are now actually useful, so they are always enabled.'),
'differential.anonymous-access' => pht(
- 'Phabricator now has meaningful global access controls. See '.
- '`policy.allow-public`.'),
+ 'Phabricator now has meaningful global access controls. See `%s`.',
+ 'policy.allow-public'),
'celerity.resource-path' => pht(
'An alternate resource map is no longer supported. Instead, use '.
'multiple maps. See T4222.'),
@@ -207,9 +210,10 @@
'differential.show-test-plan-field' => $differential_field_reason,
'differential.field-selector' => $differential_field_reason,
'phabricator.show-beta-applications' => pht(
- 'This option has been renamed to `phabricator.show-prototypes` '.
- 'to emphasize the unfinished nature of many prototype applications. '.
- 'Your existing setting has been migrated.'),
+ 'This option has been renamed to `%s` to emphasize the '.
+ 'unfinished nature of many prototype applications. '.
+ 'Your existing setting has been migrated.',
+ 'phabricator.show-prototypes'),
'notification.user' => pht(
'The notification server no longer requires root permissions. Start '.
'the server as the user you want it to run under.'),
@@ -219,10 +223,12 @@
'The translation implementation has changed and providers are no '.
'longer used or supported.'),
'config.mask' => pht(
- 'Use `config.hide` instead of this option.'),
+ 'Use `%s` instead of this option.',
+ 'config.hide'),
'phd.start-taskmasters' => pht(
'Taskmasters now use an autoscaling pool. You can configure the '.
- 'pool size with `phd.taskmasters`.'),
+ 'pool size with `%s`.',
+ 'phd.taskmasters'),
'storage.engine-selector' => pht(
'Phabricator now automatically discovers available storage engines '.
'at runtime.'),
@@ -230,8 +236,8 @@
'Phabricator now supports arbitrarily large files. Consult the '.
'documentation for configuration details.'),
'security.allow-outbound-http' => pht(
- 'This option has been replaced with the more granular option '.
- '`security.outbound-blacklist`.'),
+ 'This option has been replaced with the more granular option `%s`.',
+ 'security.outbound-blacklist'),
'metamta.reply.show-hints' => pht(
'Phabricator no longer shows reply hints in mail.'),
diff --git a/src/applications/config/check/PhabricatorFileinfoSetupCheck.php b/src/applications/config/check/PhabricatorFileinfoSetupCheck.php
--- a/src/applications/config/check/PhabricatorFileinfoSetupCheck.php
+++ b/src/applications/config/check/PhabricatorFileinfoSetupCheck.php
@@ -9,12 +9,14 @@
protected function executeChecks() {
if (!extension_loaded('fileinfo')) {
$message = pht(
- "The 'fileinfo' extension is not installed. Without 'fileinfo', ".
+ "The '%s' extension is not installed. Without '%s', ".
"support, Phabricator may not be able to determine the MIME types ".
- "of uploaded files.");
+ "of uploaded files.",
+ 'fileinfo',
+ 'fileinfo');
$this->newIssue('extension.fileinfo')
- ->setName(pht("Missing 'fileinfo' Extension"))
+ ->setName(pht("Missing '%s' Extension", 'fileinfo'))
->setMessage($message);
}
}
diff --git a/src/applications/config/check/PhabricatorGDSetupCheck.php b/src/applications/config/check/PhabricatorGDSetupCheck.php
--- a/src/applications/config/check/PhabricatorGDSetupCheck.php
+++ b/src/applications/config/check/PhabricatorGDSetupCheck.php
@@ -9,12 +9,15 @@
protected function executeChecks() {
if (!extension_loaded('gd')) {
$message = pht(
- "The 'gd' extension is not installed. Without 'gd', support, ".
+ "The '%s' extension is not installed. Without '%s', support, ".
"Phabricator will not be able to process or resize images ".
- "(for example, to generate thumbnails). Install or enable 'gd'.");
+ "(for example, to generate thumbnails). Install or enable '%s'.",
+ 'gd',
+ 'gd',
+ 'gd');
$this->newIssue('extension.gd')
- ->setName(pht("Missing 'gd' Extension"))
+ ->setName(pht("Missing '%s' Extension", 'gd'))
->setMessage($message);
} else {
$image_type_map = array(
@@ -36,15 +39,17 @@
$have = implode(', ', $have);
$message = pht(
- "The 'gd' extension has support for only some image types. ".
+ "The '%s' extension has support for only some image types. ".
"Phabricator will be unable to process images of the missing ".
- "types until you build 'gd' with support for them. ".
+ "types until you build '%s' with support for them. ".
"Supported types: %s. Missing types: %s.",
+ 'gd',
+ 'gd',
$have,
$missing);
$this->newIssue('extension.gd.support')
- ->setName(pht("Partial 'gd' Support"))
+ ->setName(pht("Partial '%s' Support", 'gd'))
->setMessage($message);
}
}
diff --git a/src/applications/config/check/PhabricatorImagemagickSetupCheck.php b/src/applications/config/check/PhabricatorImagemagickSetupCheck.php
--- a/src/applications/config/check/PhabricatorImagemagickSetupCheck.php
+++ b/src/applications/config/check/PhabricatorImagemagickSetupCheck.php
@@ -11,13 +11,15 @@
if ($imagemagick) {
if (!Filesystem::binaryExists('convert')) {
$message = pht(
- 'You have enabled Imagemagick in your config, but the \'convert\' '.
- 'binary is not in the webserver\'s $PATH. Disable imagemagick '.
- 'or make it available to the webserver.');
+ "You have enabled Imagemagick in your config, but the '%s' ".
+ "binary is not in the webserver's %s. Disable imagemagick ".
+ "or make it available to the webserver.",
+ 'convert',
+ '$PATH');
$this->newIssue('files.enable-imagemagick')
->setName(pht(
- "'convert' binary not found or Imagemagick is not installed."))
+ "'%s' binary not found or Imagemagick is not installed.", 'convert'))
->setMessage($message)
->addRelatedPhabricatorConfig('files.enable-imagemagick')
->addPhabricatorConfig('environment.append-paths');
diff --git a/src/applications/config/check/PhabricatorMySQLSetupCheck.php b/src/applications/config/check/PhabricatorMySQLSetupCheck.php
--- a/src/applications/config/check/PhabricatorMySQLSetupCheck.php
+++ b/src/applications/config/check/PhabricatorMySQLSetupCheck.php
@@ -27,14 +27,15 @@
$recommended_minimum = (32 * 1024 * 1024);
if ($max_allowed_packet < $recommended_minimum) {
$message = pht(
- "MySQL is configured with a small 'max_allowed_packet' (%d), ".
+ "MySQL is configured with a small '%s' (%d), ".
"which may cause some large writes to fail. Strongly consider raising ".
"this to at least %d in your MySQL configuration.",
+ 'max_allowed_packet',
$max_allowed_packet,
$recommended_minimum);
$this->newIssue('mysql.max_allowed_packet')
- ->setName(pht('Small MySQL "max_allowed_packet"'))
+ ->setName(pht('Small MySQL "%s"', 'max_allowed_packet'))
->setMessage($message)
->addMySQLConfig('max_allowed_packet');
}
@@ -70,7 +71,7 @@
phutil_tag('pre', array(), 'sql_mode=STRICT_ALL_TABLES'));
$this->newIssue('mysql.mode')
- ->setName(pht('MySQL STRICT_ALL_TABLES Mode Not Set'))
+ ->setName(pht('MySQL %s Mode Not Set', 'STRICT_ALL_TABLES'))
->setSummary($summary)
->setMessage($message)
->addMySQLConfig('sql_mode');
@@ -109,7 +110,7 @@
phutil_tag('tt', array(), 'ONLY_FULL_GROUP_BY'));
$this->newIssue('mysql.mode')
- ->setName(pht('MySQL ONLY_FULL_GROUP_BY Mode Set'))
+ ->setName(pht('MySQL %s Mode Set', 'ONLY_FULL_GROUP_BY'))
->setSummary($summary)
->setMessage($message)
->addMySQLConfig('sql_mode');
@@ -133,7 +134,7 @@
phutil_tag('tt', array(), 'ft_stopword_file'));
$this->newIssue('mysql.ft_stopword_file')
- ->setName(pht('MySQL ft_stopword_file Not Supported'))
+ ->setName(pht('MySQL %s Not Supported', 'ft_stopword_file'))
->setSummary($summary)
->setMessage($message)
->addMySQLConfig('ft_stopword_file');
diff --git a/src/applications/config/check/PhabricatorPHPConfigSetupCheck.php b/src/applications/config/check/PhabricatorPHPConfigSetupCheck.php
--- a/src/applications/config/check/PhabricatorPHPConfigSetupCheck.php
+++ b/src/applications/config/check/PhabricatorPHPConfigSetupCheck.php
@@ -14,15 +14,14 @@
$safe_mode = ini_get('safe_mode');
if ($safe_mode) {
$message = pht(
- "You have 'safe_mode' enabled in your PHP configuration, but ".
- "Phabricator will not run in safe mode. Safe mode has been deprecated ".
- "in PHP 5.3 and removed in PHP 5.4.".
- "\n\n".
- "Disable safe mode to continue.");
+ "You have '%s' enabled in your PHP configuration, but Phabricator ".
+ "will not run in safe mode. Safe mode has been deprecated in PHP 5.3 ".
+ "and removed in PHP 5.4.\n\nDisable safe mode to continue.",
+ 'safe_mode');
$this->newIssue('php.safe_mode')
->setIsFatal(true)
- ->setName(pht('Disable PHP safe_mode'))
+ ->setName(pht('Disable PHP %s', 'safe_mode'))
->setMessage($message)
->addPHPConfig('safe_mode');
return;
@@ -146,17 +145,15 @@
}
$issue = $this->newIssue('php.open_basedir')
- ->setName(pht('Disable PHP open_basedir'))
+ ->setName(pht('Disable PHP %s', 'open_basedir'))
->addPHPConfig('open_basedir');
if ($failures) {
$message = pht(
- "Your server is configured with 'open_basedir', which prevents ".
- "Phabricator from opening files it requires access to.".
- "\n\n".
- "Disable this setting to continue.".
- "\n\n".
- "Failures:\n\n%s",
+ "Your server is configured with '%s', which prevents Phabricator ".
+ "from opening files it requires access to.\n\n".
+ "Disable this setting to continue.\n\nFailures:\n\n%s",
+ 'open_basedir',
implode("\n\n", $failures));
$issue
@@ -166,15 +163,17 @@
return;
} else {
$summary = pht(
- "You have 'open_basedir' configured in your PHP settings, which ".
- "may cause some features to fail.");
+ "You have '%s' configured in your PHP settings, which ".
+ "may cause some features to fail.",
+ 'open_basedir');
$message = pht(
- "You have 'open_basedir' configured in your PHP settings. Although ".
- "this setting appears permissive enough that Phabricator will ".
- "work properly, you may still run into problems because of it.".
- "\n\n".
- "Consider disabling 'open_basedir'.");
+ "You have '%s' configured in your PHP settings. Although this ".
+ "setting appears permissive enough that Phabricator will work ".
+ "properly, you may still run into problems because of it.\n\n".
+ "Consider disabling '%s'.",
+ 'open_basedir',
+ 'open_basedir');
$issue
->setSummary($summary)
diff --git a/src/applications/config/check/PhabricatorPathSetupCheck.php b/src/applications/config/check/PhabricatorPathSetupCheck.php
--- a/src/applications/config/check/PhabricatorPathSetupCheck.php
+++ b/src/applications/config/check/PhabricatorPathSetupCheck.php
@@ -13,19 +13,25 @@
if (!$path) {
$summary = pht(
- 'The environmental variable $PATH is empty. Phabricator will not '.
- 'be able to execute some commands.');
+ 'The environmental variable %s is empty. Phabricator will not '.
+ 'be able to execute some commands.',
+ '$PATH');
$message = pht(
- 'The environmental variable $PATH is empty. Phabricator needs to '.
- 'execute some system commands, like `svn`, `git`, `hg`, and `diff`. '.
- 'To execute these commands, the binaries must be available in the '.
- 'webserver\'s $PATH. You can set additional paths in Phabricator '.
- 'configuration.');
+ "The environmental variable %s is empty. Phabricator needs to execute ".
+ "some system commands, like `%s`, `%s`, `%s`, and `%s`. To execute ".
+ "these commands, the binaries must be available in the webserver's ".
+ "%s. You can set additional paths in Phabricator configuration.",
+ '$PATH',
+ 'svn',
+ 'git',
+ 'hg',
+ 'diff',
+ '$PATH');
$this
->newIssue('config.environment.append-paths')
- ->setName(pht('$PATH Not Set'))
+ ->setName(pht('%s Not Set', '$PATH'))
->setSummary($summary)
->setMessage($message)
->addPhabricatorConfig('environment.append-paths');
@@ -86,10 +92,11 @@
if (!phutil_is_windows() && !@file_exists($path_part.'/.')) {
$message = pht(
"The PATH component '%s' (which resolves as the absolute path ".
- "'%s') is not usable because it is not traversable (its '+x' ".
+ "'%s') is not usable because it is not traversable (its '%s' ".
"permission bit is not set).",
$path_part,
- Filesystem::resolvePath($path_part));
+ Filesystem::resolvePath($path_part),
+ '+x');
}
}
diff --git a/src/applications/config/check/PhabricatorPygmentSetupCheck.php b/src/applications/config/check/PhabricatorPygmentSetupCheck.php
--- a/src/applications/config/check/PhabricatorPygmentSetupCheck.php
+++ b/src/applications/config/check/PhabricatorPygmentSetupCheck.php
@@ -12,17 +12,23 @@
if ($pygment) {
if (!Filesystem::binaryExists('pygmentize')) {
$summary = pht(
- 'You enabled pygments but the pygmentize script is not '.
- 'actually available, your $PATH is probably broken.');
+ 'You enabled pygments but the %s script is not '.
+ 'actually available, your %s is probably broken.',
+ 'pygmentize',
+ '$PATH');
$message = pht(
- 'The environmental variable $PATH does not contain '.
- 'pygmentize. You have enabled pygments, which requires '.
- 'pygmentize to be available in your $PATH variable.');
+ 'The environmental variable %s does not contain %s. '.
+ 'You have enabled pygments, which requires '.
+ '%s to be available in your %s variable.',
+ '$PATH',
+ 'pygmentize',
+ 'pygmentize',
+ '$PATH');
$this
->newIssue('pygments.enabled')
- ->setName(pht('pygmentize Not Found'))
+ ->setName(pht('%s Not Found', 'pygmentize'))
->setSummary($summary)
->setMessage($message)
->addRelatedPhabricatorConfig('pygments.enabled')
@@ -31,19 +37,21 @@
list($err) = exec_manual('pygmentize -h');
if ($err) {
$summary = pht(
- 'You have enabled pygments and the pygmentize script is '.
- 'available, but does not seem to work.');
+ 'You have enabled pygments and the %s script is '.
+ 'available, but does not seem to work.',
+ 'pygmentize');
$message = pht(
- 'Phabricator has %s available in $PATH, but the binary '.
+ 'Phabricator has %s available in %s, but the binary '.
'exited with an error code when run as %s. Check that it is '.
'installed correctly.',
+ phutil_tag('tt', array(), '$PATH'),
phutil_tag('tt', array(), 'pygmentize'),
phutil_tag('tt', array(), 'pygmentize -h'));
$this
->newIssue('pygments.failed')
- ->setName(pht('pygmentize Not Working'))
+ ->setName(pht('%s Not Working', 'pygmentize'))
->setSummary($summary)
->setMessage($message)
->addRelatedPhabricatorConfig('pygments.enabled')
@@ -51,12 +59,14 @@
}
}
} else {
- $summary = pht('Pygments should be installed and enabled '.
+ $summary = pht(
+ 'Pygments should be installed and enabled '.
'to provide advanced syntax highlighting.');
- $message = pht('Phabricator can highlight a few languages by default, '.
+ $message = pht(
+ 'Phabricator can highlight a few languages by default, '.
'but installing and enabling Pygments (a third-party highlighting '.
- 'tool) will add syntax highlighting for many more languages. '."\n\n".
+ "tool) will add syntax highlighting for many more languages. \n\n".
'For instructions on installing and enabling Pygments, see the '.
'%s configuration option.'."\n\n".
'If you do not want to install Pygments, you can ignore this issue.',
diff --git a/src/applications/config/check/PhabricatorSetupCheck.php b/src/applications/config/check/PhabricatorSetupCheck.php
--- a/src/applications/config/check/PhabricatorSetupCheck.php
+++ b/src/applications/config/check/PhabricatorSetupCheck.php
@@ -130,7 +130,9 @@
foreach ($check->getIssues() as $key => $issue) {
if (isset($issues[$key])) {
throw new Exception(
- "Two setup checks raised an issue with key '{$key}'!");
+ pht(
+ "Two setup checks raised an issue with key '%s'!",
+ $key));
}
$issues[$key] = $issue;
if ($issue->getIsFatal()) {
@@ -139,8 +141,8 @@
}
}
- foreach (PhabricatorEnv::getEnvConfig('config.ignore-issues')
- as $ignorable => $derp) {
+ $ignore_issues = PhabricatorEnv::getEnvConfig('config.ignore-issues');
+ foreach ($ignore_issues as $ignorable => $derp) {
if (isset($issues[$ignorable])) {
$issues[$ignorable]->setIsIgnored(true);
}
diff --git a/src/applications/config/check/PhabricatorTimezoneSetupCheck.php b/src/applications/config/check/PhabricatorTimezoneSetupCheck.php
--- a/src/applications/config/check/PhabricatorTimezoneSetupCheck.php
+++ b/src/applications/config/check/PhabricatorTimezoneSetupCheck.php
@@ -40,8 +40,10 @@
$message = pht(
"Your configuration fails to specify a server timezone. You can either ".
- "set the PHP configuration value 'date.timezone' or the Phabricator ".
- "configuration value 'phabricator.timezone' to specify one.");
+ "set the PHP configuration value '%s' or the Phabricator ".
+ "configuration value '%s' to specify one.",
+ 'date.timezone',
+ 'phabricator.timezone');
$this
->newIssue('config.timezone')
diff --git a/src/applications/config/controller/PhabricatorConfigIgnoreController.php b/src/applications/config/controller/PhabricatorConfigIgnoreController.php
--- a/src/applications/config/controller/PhabricatorConfigIgnoreController.php
+++ b/src/applications/config/controller/PhabricatorConfigIgnoreController.php
@@ -34,7 +34,7 @@
'This issue will no longer be suppressed, and will return to its '.
'rightful place as a global setup warning.');
} else {
- throw new Exception('Unrecognized verb: '.$this->verb);
+ throw new Exception(pht('Unrecognized verb: %s', $this->verb));
}
$dialog = id(new AphrontDialogView())
diff --git a/src/applications/config/custom/PhabricatorCustomHeaderConfigType.php b/src/applications/config/custom/PhabricatorCustomHeaderConfigType.php
--- a/src/applications/config/custom/PhabricatorCustomHeaderConfigType.php
+++ b/src/applications/config/custom/PhabricatorCustomHeaderConfigType.php
@@ -5,8 +5,10 @@
public function validateOption(PhabricatorConfigOption $option, $value) {
if (phid_get_type($value) != PhabricatorFileFilePHIDType::TYPECONST) {
- throw new Exception(pht(
- '%s is not a valid file phid.', $value));
+ throw new Exception(
+ pht(
+ '%s is not a valid file PHID.',
+ $value));
}
$file = id(new PhabricatorFileQuery())
@@ -14,23 +16,27 @@
->withPHIDs(array($value))
->executeOne();
if (!$file) {
- throw new Exception(pht(
- '%s is not a valid file phid.', $value));
+ throw new Exception(
+ pht(
+ '%s is not a valid file PHID.',
+ $value));
}
$most_open_policy = PhabricatorPolicies::getMostOpenPolicy();
if ($file->getViewPolicy() != $most_open_policy) {
- throw new Exception(pht(
- 'Specified file %s has policy "%s" but should have policy "%s".',
- $value,
- $file->getViewPolicy(),
- $most_open_policy));
+ throw new Exception(
+ pht(
+ 'Specified file %s has policy "%s" but should have policy "%s".',
+ $value,
+ $file->getViewPolicy(),
+ $most_open_policy));
}
if (!$file->isViewableImage()) {
- throw new Exception(pht(
- 'Specified file %s is not a viewable image.',
- $value));
+ throw new Exception(
+ pht(
+ 'Specified file %s is not a viewable image.',
+ $value));
}
}
diff --git a/src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php b/src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php
--- a/src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php
+++ b/src/applications/config/management/PhabricatorConfigManagementDeleteWorkflow.php
@@ -12,8 +12,9 @@
array(
array(
'name' => 'database',
- 'help' => pht('Delete configuration in the database instead of '.
- 'in local configuration.'),
+ 'help' => pht(
+ 'Delete configuration in the database instead of '.
+ 'in local configuration.'),
),
array(
'name' => 'args',
@@ -27,15 +28,15 @@
$argv = $args->getArg('args');
if (count($argv) == 0) {
- throw new PhutilArgumentUsageException(pht(
- 'Specify a configuration key to delete.'));
+ throw new PhutilArgumentUsageException(
+ pht('Specify a configuration key to delete.'));
}
$key = $argv[0];
if (count($argv) > 1) {
- throw new PhutilArgumentUsageException(pht(
- 'Too many arguments: expected one key.'));
+ throw new PhutilArgumentUsageException(
+ pht('Too many arguments: expected one key.'));
}
@@ -49,10 +50,11 @@
}
$values = $config->getKeys(array($key));
if (!$values) {
- throw new PhutilArgumentUsageException(pht(
- "Configuration key '%s' is not set in %s configuration!",
- $key,
- $config_type));
+ throw new PhutilArgumentUsageException(
+ pht(
+ "Configuration key '%s' is not set in %s configuration!",
+ $key,
+ $config_type));
}
if ($use_database) {
@@ -64,7 +66,8 @@
}
$console->writeOut(
- pht("Deleted '%s' from %s configuration.", $key, $config_type)."\n");
+ "%s\n",
+ pht("Deleted '%s' from %s configuration.", $key, $config_type));
}
}
diff --git a/src/applications/config/management/PhabricatorConfigManagementGetWorkflow.php b/src/applications/config/management/PhabricatorConfigManagementGetWorkflow.php
--- a/src/applications/config/management/PhabricatorConfigManagementGetWorkflow.php
+++ b/src/applications/config/management/PhabricatorConfigManagementGetWorkflow.php
@@ -7,7 +7,7 @@
$this
->setName('get')
->setExamples('**get** __key__')
- ->setSynopsis('Get a local configuration value.')
+ ->setSynopsis(pht('Get a local configuration value.'))
->setArguments(
array(
array(
@@ -23,21 +23,23 @@
$argv = $args->getArg('args');
if (count($argv) == 0) {
throw new PhutilArgumentUsageException(
- 'Specify a configuration key to get.');
+ pht('Specify a configuration key to get.'));
}
$key = $argv[0];
if (count($argv) > 1) {
throw new PhutilArgumentUsageException(
- 'Too many arguments: expected one key.');
+ pht('Too many arguments: expected one key.'));
}
$options = PhabricatorApplicationConfigOptions::loadAllOptions();
if (empty($options[$key])) {
throw new PhutilArgumentUsageException(
- "No such configuration key '{$key}'! Use `config list` to list all ".
- "keys.");
+ pht(
+ "No such configuration key '%s'! Use `%s` to list all keys.",
+ $key,
+ 'config list'));
}
$values = array();
diff --git a/src/applications/config/management/PhabricatorConfigManagementListWorkflow.php b/src/applications/config/management/PhabricatorConfigManagementListWorkflow.php
--- a/src/applications/config/management/PhabricatorConfigManagementListWorkflow.php
+++ b/src/applications/config/management/PhabricatorConfigManagementListWorkflow.php
@@ -7,7 +7,7 @@
$this
->setName('list')
->setExamples('**list**')
- ->setSynopsis('List all configuration keys.');
+ ->setSynopsis(pht('List all configuration keys.'));
}
public function execute(PhutilArgumentParser $args) {
diff --git a/src/applications/config/management/PhabricatorConfigManagementMigrateWorkflow.php b/src/applications/config/management/PhabricatorConfigManagementMigrateWorkflow.php
--- a/src/applications/config/management/PhabricatorConfigManagementMigrateWorkflow.php
+++ b/src/applications/config/management/PhabricatorConfigManagementMigrateWorkflow.php
@@ -20,54 +20,60 @@
$database_config = new PhabricatorConfigDatabaseSource('default');
$config_sources = PhabricatorEnv::getConfigSourceStack()->getStack();
$console->writeOut(
- pht('Migrating file-based config to more modern config...')."\n");
+ "%s\n",
+ pht('Migrating file-based config to more modern config...'));
foreach ($config_sources as $config_source) {
if (!($config_source instanceof PhabricatorConfigFileSource)) {
$console->writeOut(
- pht('Skipping config of source type %s...',
- get_class($config_source))."\n");
+ "%s\n",
+ pht(
+ 'Skipping config of source type %s...',
+ get_class($config_source)));
continue;
}
- $console->writeOut(pht('Migrating file source...')."\n");
+ $console->writeOut("%s\n", pht('Migrating file source...'));
$all_keys = $config_source->getAllKeys();
foreach ($all_keys as $key => $value) {
$option = idx($options, $key);
if (!$option) {
- $console->writeOut(pht('Skipping obsolete option: %s', $key)."\n");
+ $console->writeOut("%s\n", pht('Skipping obsolete option: %s', $key));
continue;
}
$in_local = $local_config->getKeys(array($option->getKey()));
if ($in_local) {
- $console->writeOut(pht(
- 'Skipping option "%s"; already in local config.', $key)."\n");
+ $console->writeOut(
+ "%s\n",
+ pht('Skipping option "%s"; already in local config.', $key));
continue;
}
$is_locked = $option->getLocked();
if ($is_locked) {
$local_config->setKeys(array($option->getKey() => $value));
$key_count++;
- $console->writeOut(pht(
- 'Migrated option "%s" from file to local config.', $key)."\n");
+ $console->writeOut(
+ "%s\n",
+ pht('Migrated option "%s" from file to local config.', $key));
} else {
$in_database = $database_config->getKeys(array($option->getKey()));
if ($in_database) {
- $console->writeOut(pht(
- 'Skipping option "%s"; already in database config.', $key)."\n");
+ $console->writeOut(
+ "%s\n",
+ pht('Skipping option "%s"; already in database config.', $key));
continue;
} else {
$config_entry = PhabricatorConfigEntry::loadConfigEntry($key);
$config_entry->setValue($value);
$config_entry->save();
$key_count++;
- $console->writeOut(pht(
- 'Migrated option "%s" from file to database config.', $key)."\n");
+ $console->writeOut(
+ "%s\n",
+ pht('Migrated option "%s" from file to database config.', $key));
}
}
}
}
- $console->writeOut(pht(
- 'Done. Migrated %d keys.', $key_count)."\n");
+ $console->writeOut("%s\n", pht('Done. Migrated %d keys.', $key_count));
return 0;
}
diff --git a/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php b/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php
--- a/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php
+++ b/src/applications/config/management/PhabricatorConfigManagementSetWorkflow.php
@@ -12,8 +12,9 @@
array(
array(
'name' => 'database',
- 'help' => pht('Update configuration in the database instead of '.
- 'in local configuration.'),
+ 'help' => pht(
+ 'Update configuration in the database instead of '.
+ 'in local configuration.'),
),
array(
'name' => 'args',
@@ -26,31 +27,34 @@
$console = PhutilConsole::getConsole();
$argv = $args->getArg('args');
if (count($argv) == 0) {
- throw new PhutilArgumentUsageException(pht(
- 'Specify a configuration key and a value to set it to.'));
+ throw new PhutilArgumentUsageException(
+ pht('Specify a configuration key and a value to set it to.'));
}
$key = $argv[0];
if (count($argv) == 1) {
- throw new PhutilArgumentUsageException(pht(
- "Specify a value to set the key '%s' to.",
- $key));
+ throw new PhutilArgumentUsageException(
+ pht(
+ "Specify a value to set the key '%s' to.",
+ $key));
}
$value = $argv[1];
if (count($argv) > 2) {
- throw new PhutilArgumentUsageException(pht(
- 'Too many arguments: expected one key and one value.'));
+ throw new PhutilArgumentUsageException(
+ pht(
+ 'Too many arguments: expected one key and one value.'));
}
$options = PhabricatorApplicationConfigOptions::loadAllOptions();
if (empty($options[$key])) {
- throw new PhutilArgumentUsageException(pht(
- "No such configuration key '%s'! Use `config list` to list all ".
- "keys.",
- $key));
+ throw new PhutilArgumentUsageException(
+ pht(
+ "No such configuration key '%s'! Use `%s` to list all keys.",
+ $key,
+ 'config list'));
}
$option = $options[$key];
@@ -64,10 +68,11 @@
break;
case 'int':
if (!ctype_digit($value)) {
- throw new PhutilArgumentUsageException(pht(
- "Config key '%s' is of type '%s'. Specify an integer.",
- $key,
- $type));
+ throw new PhutilArgumentUsageException(
+ pht(
+ "Config key '%s' is of type '%s'. Specify an integer.",
+ $key,
+ $type));
}
$value = (int)$value;
break;
@@ -77,11 +82,13 @@
} else if ($value == 'false') {
$value = false;
} else {
- throw new PhutilArgumentUsageException(pht(
- "Config key '%s' is of type '%s'. ".
- "Specify 'true' or 'false'.",
- $key,
- $type));
+ throw new PhutilArgumentUsageException(
+ pht(
+ "Config key '%s' is of type '%s'. Specify '%s' or '%s'.",
+ $key,
+ $type,
+ 'true',
+ 'false'));
}
break;
default:
@@ -89,23 +96,25 @@
if (!is_array($value)) {
switch ($type) {
case 'set':
- $message = pht(
- "Config key '%s' is of type '%s'. Specify it in JSON. ".
- "For example:\n\n".
- ' ./bin/config set \'{"value1": true, "value2": true}\''.
- "\n",
- $key,
- $type);
+ $message = sprintf(
+ "%s%s\n\n %s\n",
+ pht(
+ "Config key '%s' is of type '%s'. Specify it in JSON.",
+ $key,
+ $type),
+ pht('For example:'),
+ './bin/config set \'{"value1": true, "value2": true}\'');
break;
default:
if (preg_match('/^list</', $type)) {
- $message = pht(
- "Config key '%s' is of type '%s'. Specify it in JSON. ".
- "For example:\n\n".
- ' ./bin/config set \'["a", "b", "c"]\''.
- "\n",
- $key,
- $type);
+ $message = sprintf(
+ "%s%s\n\n %s\n",
+ pht(
+ "Config key '%s' is of type '%s'. Specify it in JSON.",
+ $key,
+ $type),
+ pht('For example:'),
+ './bin/config set \'["a", "b", "c"]\'');
} else {
$message = pht(
'Config key "%s" is of type "%s". Specify it in JSON.',
@@ -120,10 +129,11 @@
}
$use_database = $args->getArg('database');
if ($option->getLocked() && $use_database) {
- throw new PhutilArgumentUsageException(pht(
- "Config key '%s' is locked and can only be set in local ".
- 'configuration.',
- $key));
+ throw new PhutilArgumentUsageException(
+ pht(
+ "Config key '%s' is locked and can only be set in local ".
+ "configuration.",
+ $key));
}
try {
@@ -145,7 +155,8 @@
}
$console->writeOut(
- pht("Set '%s' in %s configuration.", $key, $config_type)."\n");
+ "%s\n",
+ pht("Set '%s' in %s configuration.", $key, $config_type));
}
}
diff --git a/src/applications/config/option/PhabricatorAccessLogConfigOptions.php b/src/applications/config/option/PhabricatorAccessLogConfigOptions.php
--- a/src/applications/config/option/PhabricatorAccessLogConfigOptions.php
+++ b/src/applications/config/option/PhabricatorAccessLogConfigOptions.php
@@ -49,14 +49,16 @@
);
$http_desc = pht(
- 'Format for the HTTP access log. Use {{log.access.path}} to set the '.
- 'path. Available variables are:');
+ 'Format for the HTTP access log. Use `%s` to set the path. '.
+ 'Available variables are:',
+ 'log.access.path');
$http_desc .= "\n\n";
$http_desc .= $this->renderMapHelp($http_map);
$ssh_desc = pht(
- 'Format for the SSH access log. Use {{log.ssh.path}} to set the '.
- 'path. Available variables are:');
+ 'Format for the SSH access log. Use %s to set the path. '.
+ 'Available variables are:',
+ 'log.ssh.path');
$ssh_desc .= "\n\n";
$ssh_desc .= $this->renderMapHelp($ssh_map);
@@ -67,7 +69,6 @@
->setDescription(
pht(
"To enable the Phabricator access log, specify a path. The ".
- "access log can provide more detailed information about ".
"Phabricator access than normal HTTP access logs (for instance, ".
"it can show logged-in users, controllers, and other application ".
"data).\n\n".
diff --git a/src/applications/config/option/PhabricatorApplicationConfigOptions.php b/src/applications/config/option/PhabricatorApplicationConfigOptions.php
--- a/src/applications/config/option/PhabricatorApplicationConfigOptions.php
+++ b/src/applications/config/option/PhabricatorApplicationConfigOptions.php
@@ -204,8 +204,12 @@
$nclass = $symbol['name'];
throw new Exception(
- "Multiple PhabricatorApplicationConfigOptions subclasses have the ".
- "same key ('{$key}'): {$pclass}, {$nclass}.");
+ pht(
+ "Multiple %s subclasses have the same key ('%s'): %s, %s.",
+ __CLASS__,
+ $key,
+ $pclass,
+ $nclass));
}
$groups[$key] = $obj;
}
@@ -222,8 +226,10 @@
$key = $option->getKey();
if (isset($options[$key])) {
throw new Exception(
- "Mulitple PhabricatorApplicationConfigOptions subclasses contain ".
- "an option named '{$key}'!");
+ pht(
+ "Mulitple %s subclasses contain an option named '%s'!",
+ __CLASS__,
+ $key));
}
$options[$key] = $option;
}
diff --git a/src/applications/config/option/PhabricatorAuthenticationConfigOptions.php b/src/applications/config/option/PhabricatorAuthenticationConfigOptions.php
--- a/src/applications/config/option/PhabricatorAuthenticationConfigOptions.php
+++ b/src/applications/config/option/PhabricatorAuthenticationConfigOptions.php
@@ -33,7 +33,8 @@
pht(
'If true, email addresses must be verified (by clicking a link '.
'in an email) before a user can login. By default, verification '.
- 'is optional unless {{auth.email-domains}} is nonempty.')),
+ 'is optional unless `%s` is nonempty.',
+ 'auth.email-domains')),
$this->newOption('auth.require-approval', 'bool', true)
->setBoolOptions(
array(
@@ -55,8 +56,8 @@
"registration, you can disable the queue to reduce administrative ".
"overhead.\n\n".
"NOTE: Before you disable the queue, make sure ".
- "{{auth.email-domains}} is configured correctly for your ".
- "install!")),
+ "`%s` is configured correctly for your install!",
+ 'auth.email-domains')),
$this->newOption('auth.email-domains', 'list<string>', array())
->setSummary(pht('Only allow registration from particular domains.'))
->setDescription(
@@ -66,10 +67,11 @@
"here.\n\nUsers will only be allowed to register using email ".
"addresses at one of the domains, and will only be able to add ".
"new email addresses for these domains. If you configure this, ".
- "it implies {{auth.require-email-verification}}.\n\n".
+ "it implies `%s`.\n\n".
"You should omit the `@` from domains. Note that the domain must ".
"match exactly. If you allow `yourcompany.com`, that permits ".
- "`joe@yourcompany.com` but rejects `joe@mail.yourcompany.com`."))
+ "`joe@yourcompany.com` but rejects `joe@mail.yourcompany.com`.",
+ 'auth.require-email-verification'))
->addExample(
"yourcompany.com\nmail.yourcompany.com",
pht('Valid Setting')),
@@ -89,8 +91,7 @@
))
->setSummary(
pht(
- 'Determines whether or not basic account information is '.
- 'editable.'))
+ 'Determines whether or not basic account information is editable.'))
->setDescription(
pht(
'Is basic account information (email, real name, profile '.
diff --git a/src/applications/config/option/PhabricatorClusterConfigOptions.php b/src/applications/config/option/PhabricatorClusterConfigOptions.php
--- a/src/applications/config/option/PhabricatorClusterConfigOptions.php
+++ b/src/applications/config/option/PhabricatorClusterConfigOptions.php
@@ -69,9 +69,10 @@
'hosting providers running multi-tenant clusters.'.
"\n\n".
'If you provide an instance identifier here (normally by '.
- 'injecting it with a `PhabricatorConfigSiteSource`), Phabricator '.
- 'will pass it to subprocesses and commit hooks in the '.
- '`PHABRICATOR_INSTANCE` environmental variable.')),
+ 'injecting it with a `%s`), Phabricator will pass it to '.
+ 'subprocesses and commit hooks in the `%s` environmental variable.',
+ 'PhabricatorConfigSiteSource',
+ 'PHABRICATOR_INSTANCE')),
);
}
diff --git a/src/applications/config/option/PhabricatorConfigOption.php b/src/applications/config/option/PhabricatorConfigOption.php
--- a/src/applications/config/option/PhabricatorConfigOption.php
+++ b/src/applications/config/option/PhabricatorConfigOption.php
@@ -76,7 +76,9 @@
}
return pht(
'This configuration is locked and can not be edited from the web '.
- 'interface. Use `./bin/config` in `phabricator/` to edit it.');
+ 'interface. Use `%s` in `%s` to edit it.',
+ './bin/config',
+ 'phabricator/');
}
public function addExample($value, $description) {
@@ -123,7 +125,9 @@
}
throw new Exception(
- 'Call setEnumOptions() before trying to access them!');
+ pht(
+ 'Call %s before trying to access them!',
+ 'setEnumOptions()'));
}
public function setKey($key) {
@@ -181,7 +185,7 @@
public function getCustomObject() {
if (!$this->customObject) {
if (!$this->isCustomType()) {
- throw new Exception('This option does not have a custom type!');
+ throw new Exception(pht('This option does not have a custom type!'));
}
$this->customObject = newv(substr($this->getType(), 7), array());
}
diff --git a/src/applications/config/option/PhabricatorCoreConfigOptions.php b/src/applications/config/option/PhabricatorCoreConfigOptions.php
--- a/src/applications/config/option/PhabricatorCoreConfigOptions.php
+++ b/src/applications/config/option/PhabricatorCoreConfigOptions.php
@@ -58,9 +58,9 @@
'Phabricator, and a production environment for deploying it), '.
'set the production environment URI here so that emails and other '.
'durable URIs will always generate with links pointing at the '.
- 'production environment. If unset, defaults to '.
- '{{phabricator.base-uri}}. Most installs do not need to set '.
- 'this option.'))
+ 'production environment. If unset, defaults to `%s`. Most '.
+ 'installs do not need to set this option.',
+ 'phabricator.base-uri'))
->addExample('http://phabricator.example.com/', pht('Valid Setting')),
$this->newOption('phabricator.allowed-uris', 'list<string>', array())
->setLocked(true)
@@ -68,9 +68,9 @@
->setDescription(
pht(
"These alternative URIs will be able to access 'normal' pages ".
- "on your Phabricator install. Other features such as OAuth ".
- "won't work. The major use case for this is moving installs ".
- "across domains."))
+ "on your Phabricator install. Other features such as OAuth ".
+ "won't work. The major use case for this is moving installs ".
+ "across domains."))
->addExample(
"http://phabricator2.example.com/\n".
"http://phabricator3.example.com/",
@@ -83,8 +83,9 @@
"PHP requires that you set a timezone in your php.ini before ".
"using date functions, or it will emit a warning. If this isn't ".
"possible (for instance, because you are using HPHP) you can set ".
- "some valid constant for date_default_timezone_set() here and ".
- "Phabricator will set it on your behalf, silencing the warning."))
+ "some valid constant for %s here and Phabricator will set it on ".
+ "your behalf, silencing the warning.",
+ 'date_default_timezone_set()'))
->addExample('America/New_York', pht('US East (EDT)'))
->addExample('America/Chicago', pht('US Central (CDT)'))
->addExample('America/Boise', pht('US Mountain (MDT)'))
@@ -92,14 +93,14 @@
$this->newOption('phabricator.cookie-prefix', 'string', null)
->setLocked(true)
->setSummary(
- pht('Set a string Phabricator should use to prefix '.
- 'cookie names.'))
+ pht(
+ 'Set a string Phabricator should use to prefix cookie names.'))
->setDescription(
pht(
'Cookies set for x.com are also sent for y.x.com. Assuming '.
'Phabricator instances are running on both domains, this will '.
'create a collision preventing you from logging in.'))
- ->addExample('dev', pht('Prefix cookie with "dev"')),
+ ->addExample('dev', pht('Prefix cookie with "%s"', 'dev')),
$this->newOption('phabricator.show-prototypes', 'bool', false)
->setLocked(true)
->setBoolOptions(
@@ -155,22 +156,29 @@
'linked.')),
$this->newOption('environment.append-paths', 'list<string>', $paths)
->setSummary(
- pht('These paths get appended to your \$PATH envrionment variable.'))
+ pht(
+ 'These paths get appended to your %s environment variable.',
+ '$PATH'))
->setDescription(
pht(
"Phabricator occasionally shells out to other binaries on the ".
- "server. An example of this is the `pygmentize` command, used ".
- "to syntax-highlight code written in languages other than PHP. ".
- "By default, it is assumed that these binaries are in the \$PATH ".
- "of the user running Phabricator (normally 'apache', 'httpd', or ".
- "'nobody'). Here you can add extra directories to the \$PATH ".
+ "server. An example of this is the `%s` command, used to ".
+ "syntax-highlight code written in languages other than PHP. By ".
+ "default, it is assumed that these binaries are in the %s of the ".
+ "user running Phabricator (normally 'apache', 'httpd', or ".
+ "'nobody'). Here you can add extra directories to the %s ".
"environment variable, for when these binaries are in ".
"non-standard locations.\n\n".
- "Note that you can also put binaries in ".
- "`phabricator/support/bin/` (for example, by symlinking them).\n\n".
+ "Note that you can also put binaries in `%s` (for example, by ".
+ "symlinking them).\n\n".
"The current value of PATH after configuration is applied is:\n\n".
" lang=text\n".
- " %s", $path))
+ " %s",
+ '$PATH',
+ '$PATH',
+ 'phabricator/support/bin/',
+ $path,
+ 'pygmentize'))
->setLocked(true)
->addExample('/usr/local/bin', pht('Add One Path'))
->addExample("/usr/bin\n/usr/local/bin", pht('Add Multiple Paths')),
@@ -200,7 +208,7 @@
),
pht('Applications application'))))
->setDescription(
- pht('Array containing list of Uninstalled applications.')),
+ pht('Array containing list of uninstalled applications.')),
$this->newOption('phabricator.application-settings', 'wild', array())
->setLocked(true)
->setDescription(
@@ -261,7 +269,9 @@
throw new PhabricatorConfigValidationException(
pht(
"Config option '%s' is invalid. The URI must start with ".
- "'http://' or 'https://'.",
+ "%s' or '%s'.",
+ 'http://',
+ 'https://',
$key));
}
@@ -269,10 +279,12 @@
if (strpos($domain, '.') === false) {
throw new PhabricatorConfigValidationException(
pht(
- "Config option '%s' is invalid. The URI must contain a dot ('.'), ".
- "like 'http://example.com/', not just a bare name like ".
- "'http://example/'. Some web browsers will not set cookies on ".
- "domains with no TLD.",
+ "Config option '%s' is invalid. The URI must contain a dot ".
+ "('%s'), like '%s', not just a bare name like '%s'. Some web ".
+ "browsers will not set cookies on domains with no TLD.",
+ '.',
+ 'http://example.com/',
+ 'http://example/',
$key));
}
@@ -281,11 +293,11 @@
throw new PhabricatorConfigValidationException(
pht(
"Config option '%s' is invalid. The URI must NOT have a path, ".
- "e.g. 'http://phabricator.example.com/' is OK, but ".
- "'http://example.com/phabricator/' is not. Phabricator must be ".
- "installed on an entire domain; it can not be installed on a ".
- "path.",
- $key));
+ "e.g. '%s' is OK, but '%s' is not. Phabricator must be installed ".
+ "on an entire domain; it can not be installed on a path.",
+ $key,
+ 'http://phabricator.example.com/',
+ 'http://example.com/phabricator/'));
}
}
@@ -299,16 +311,13 @@
throw new PhabricatorConfigValidationException(
pht(
"Config option '%s' is invalid. The timezone identifier must ".
- "be a valid timezone identifier recognized by PHP, like ".
- "'America/Los_Angeles'. You can find a list of valid identifiers ".
- "here: %s",
+ "be a valid timezone identifier recognized by PHP, like '%s'. "."
+ You can find a list of valid identifiers here: %s",
$key,
+ 'America/Los_Angeles',
'http://php.net/manual/timezones.php'));
}
}
-
-
-
}
diff --git a/src/applications/config/option/PhabricatorDeveloperConfigOptions.php b/src/applications/config/option/PhabricatorDeveloperConfigOptions.php
--- a/src/applications/config/option/PhabricatorDeveloperConfigOptions.php
+++ b/src/applications/config/option/PhabricatorDeveloperConfigOptions.php
@@ -52,8 +52,9 @@
"even for logged-out users. This is only really useful if you ".
"need to debug something on a logged-out page. You should not ".
"enable this option in production.\n\n".
- "You must enable DarkConsole by setting {{darkconsole.enabled}} ".
- "before this option will have any effect.")),
+ "You must enable DarkConsole by setting '%s' ".
+ "before this option will have any effect.",
+ 'darkconsole.enabled')),
$this->newOption('debug.time-limit', 'int', null)
->setSummary(
pht(
@@ -170,12 +171,13 @@
pht('Disable deflate compression'),
))
->setSummary(
- pht('Toggle gzdeflate()-based compression for some caches.'))
+ pht('Toggle %s-based compression for some caches.', 'gzdeflate()'))
->setDescription(
pht(
- 'Set this to false to disable the use of gzdeflate()-based '.
+ 'Set this to false to disable the use of %s-based '.
'compression in some caches. This may give you less performant '.
- '(but more debuggable) caching.')),
+ '(but more debuggable) caching.',
+ 'gzdeflate()')),
);
}
}
diff --git a/src/applications/config/option/PhabricatorMailgunConfigOptions.php b/src/applications/config/option/PhabricatorMailgunConfigOptions.php
--- a/src/applications/config/option/PhabricatorMailgunConfigOptions.php
+++ b/src/applications/config/option/PhabricatorMailgunConfigOptions.php
@@ -25,8 +25,9 @@
->setLocked(true)
->setDescription(
pht(
- 'Mailgun domain name. See https://mailgun.com/cp/domains'))
- ->addExample('mycompany.com', 'Use specific domain'),
+ 'Mailgun domain name. See %s.',
+ 'https://mailgun.com/cp/domains'))
+ ->addExample('mycompany.com', pht('Use specific domain')),
$this->newOption('mailgun.api-key', 'string', null)
->setHidden(true)
->setDescription(pht('Mailgun API key.')),
diff --git a/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php b/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php
--- a/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php
+++ b/src/applications/config/option/PhabricatorMetaMTAConfigOptions.php
@@ -24,7 +24,7 @@
When a user takes an action which generates an email notification (like
commenting on a Differential revision), Phabricator can either send that mail
"From" the user's email address (like "alincoln@logcabin.com") or "From" the
-'metamta.default-address' address.
+'%s' address.
The user experience is generally better if Phabricator uses the user's real
address as the "From" since the messages are easier to organize when they appear
@@ -43,7 +43,8 @@
initially, since the risk in turning it on is that your outgoing mail will
never arrive.
EODOC
-));
+ ,
+ 'metamta.default-address'));
$one_mail_per_recipient_desc = $this->deformat(pht(<<<EODOC
When a message is sent to multiple recipients (for example, several reviewers on
@@ -126,21 +127,23 @@
$vary_subjects_description = $this->deformat(pht(<<<EODOC
If true, allow MetaMTA to change mail subjects to put text like '[Accepted]' and
'[Commented]' in them. This makes subjects more useful, but might break
-threading on some clients. If you've set 'metamta.one-mail-per-recipient', users
-can override this setting in their preferences.
+threading on some clients. If you've set '%s', users can override this setting
+in their preferences.
EODOC
-));
+ ,
+ 'metamta.one-mail-per-recipient'));
$reply_to_description = $this->deformat(pht(<<<EODOC
-If you enable {{metamta.public-replies}}, Phabricator uses "From" to
-authenticate users. You can additionally enable this setting to try to
-authenticate with 'Reply-To'. Note that this is completely spoofable and
-insecure (any user can set any 'Reply-To' address) but depending on the nature
-of your install or other deliverability conditions this might be okay.
-Generally, you can't do much more by spoofing Reply-To than be annoying (you can
-write but not read content). But this is still **COMPLETELY INSECURE**.
+If you enable `%s`, Phabricator uses "From" to authenticate users. You can
+additionally enable this setting to try to authenticate with 'Reply-To'. Note
+that this is completely spoofable and insecure (any user can set any 'Reply-To'
+address) but depending on the nature of your install or other deliverability
+conditions this might be okay. Generally, you can't do much more by spoofing
+Reply-To than be annoying (you can write but not read content). But this is
+still **COMPLETELY INSECURE**.
EODOC
-));
+ ,
+ 'metamta.public-replies'));
$adapter_description = $this->deformat(pht(<<<EODOC
Adapter class to use to transmit mail to the MTA. The default uses
diff --git a/src/applications/config/option/PhabricatorMySQLConfigOptions.php b/src/applications/config/option/PhabricatorMySQLConfigOptions.php
--- a/src/applications/config/option/PhabricatorMySQLConfigOptions.php
+++ b/src/applications/config/option/PhabricatorMySQLConfigOptions.php
@@ -63,8 +63,8 @@
'Phabricator connects to MySQL through a swappable abstraction '.
'layer. You can choose an alternate implementation by setting '.
'this option. To provide your own implementation, extend '.
- '`AphrontMySQLDatabaseConnectionBase`. It is very unlikely that '.
- 'you need to change this.')),
+ '`%s`. It is very unlikely that you need to change this.',
+ 'AphrontMySQLDatabaseConnectionBase')),
$this->newOption('storage.default-namespace', 'string', 'phabricator')
->setLocked(true)
->setSummary(
diff --git a/src/applications/config/option/PhabricatorPHDConfigOptions.php b/src/applications/config/option/PhabricatorPHDConfigOptions.php
--- a/src/applications/config/option/PhabricatorPHDConfigOptions.php
+++ b/src/applications/config/option/PhabricatorPHDConfigOptions.php
@@ -23,12 +23,10 @@
return array(
$this->newOption('phd.pid-directory', 'string', '/var/tmp/phd/pid')
->setDescription(
- pht(
- 'Directory that phd should use to track running daemons.')),
+ pht('Directory that phd should use to track running daemons.')),
$this->newOption('phd.log-directory', 'string', '/var/tmp/phd/log')
->setDescription(
- pht(
- 'Directory that the daemons should use to store log files.')),
+ pht('Directory that the daemons should use to store log files.')),
$this->newOption('phd.taskmasters', 'int', 4)
->setSummary(pht('Maximum taskmaster daemon pool size.'))
->setDescription(
@@ -47,8 +45,10 @@
pht(
"Launch daemons in 'verbose' mode by default. This creates a lot ".
"of output, but can help debug issues. Daemons launched in debug ".
- "mode with 'phd debug' are always launched in verbose mode. See ".
- "also 'phd.trace'.")),
+ "mode with '%s' are always launched in verbose mode. ".
+ "See also '%s'.",
+ 'phd debug',
+ 'phd.trace')),
$this->newOption('phd.user', 'string', null)
->setLocked(true)
->setSummary(pht('System user to run daemons as.'))
@@ -69,8 +69,10 @@
pht(
"Launch daemons in 'trace' mode by default. This creates an ".
"ENORMOUS amount of output, but can help debug issues. Daemons ".
- "launched in debug mode with 'phd debug' are always launched in ".
- "trace mode. See also 'phd.verbose'.")),
+ "launched in debug mode with '%s' are always launched in ".
+ "trace mode. See also '%s'.",
+ 'phd debug',
+ 'phd.verbose')),
$this->newOption('phd.variant-config', 'list<string>', array())
->setDescription(
pht(
diff --git a/src/applications/config/option/PhabricatorPHPMailerConfigOptions.php b/src/applications/config/option/PhabricatorPHPMailerConfigOptions.php
--- a/src/applications/config/option/PhabricatorPHPMailerConfigOptions.php
+++ b/src/applications/config/option/PhabricatorPHPMailerConfigOptions.php
@@ -43,9 +43,12 @@
->setSummary(pht('Configure TLS or SSL for SMTP.'))
->setDescription(
pht(
- "Using PHPMailer with SMTP, you can set this to one of 'tls' or ".
- "'ssl' to use TLS or SSL, respectively. Leave it blank for ".
- "vanilla SMTP. If you're sending via Gmail, set it to 'ssl'.")),
+ "Using PHPMailer with SMTP, you can set this to one of '%s' or ".
+ "'%s' to use TLS or SSL, respectively. Leave it blank for ".
+ "vanilla SMTP. If you're sending via Gmail, set it to '%s'.",
+ 'tls',
+ 'ssl',
+ 'ssl')),
$this->newOption('phpmailer.smtp-user', 'string', null)
->setLocked(true)
->setDescription(pht('Username for SMTP.')),
diff --git a/src/applications/config/option/PhabricatorSMSConfigOptions.php b/src/applications/config/option/PhabricatorSMSConfigOptions.php
--- a/src/applications/config/option/PhabricatorSMSConfigOptions.php
+++ b/src/applications/config/option/PhabricatorSMSConfigOptions.php
@@ -20,12 +20,10 @@
}
public function getOptions() {
- $adapter_description = $this->deformat(pht(<<<EODOC
-Adapter class to use to transmit SMS to an external provider. A given external
-provider will most likely need more configuration which will most likely
-require registration and payment for the service.
-EODOC
- ));
+ $adapter_description = pht(
+ 'Adapter class to use to transmit SMS to an external provider. A given '.
+ 'external provider will most likely need more configuration which will '.
+ 'most likely require registration and payment for the service.');
return array(
$this->newOption(
@@ -40,7 +38,7 @@
'class',
null)
->setBaseClass('PhabricatorSMSImplementationAdapter')
- ->setSummary(pht('Control how sms is sent.'))
+ ->setSummary(pht('Control how SMS is sent.'))
->setDescription($adapter_description),
$this->newOption(
'twilio.account-sid',
diff --git a/src/applications/config/option/PhabricatorSecurityConfigOptions.php b/src/applications/config/option/PhabricatorSecurityConfigOptions.php
--- a/src/applications/config/option/PhabricatorSecurityConfigOptions.php
+++ b/src/applications/config/option/PhabricatorSecurityConfigOptions.php
@@ -92,12 +92,13 @@
"reasonably configure more granular behavior there.\n\n".
"IMPORTANT: Phabricator determines if a request is HTTPS or not ".
- "by examining the PHP \$_SERVER['HTTPS'] variable. If you run ".
+ "by examining the PHP `%s` variable. If you run ".
"Apache/mod_php this will probably be set correctly for you ".
"automatically, but if you run Phabricator as CGI/FCGI (e.g., ".
"through nginx or lighttpd), you need to configure your web ".
"server so that it passes the value correctly based on the ".
- "connection type."))
+ "connection type.",
+ "\$_SERVER['HTTPS']"))
->setBoolOptions(
array(
pht('Force HTTPS'),
@@ -163,7 +164,8 @@
"When users write comments which have URIs, they'll be ".
"automatically linked if the protocol appears in this set. This ".
"whitelist is primarily to prevent security issues like ".
- "javascript:// URIs."))
+ "%s URIs.",
+ 'javascript://'))
->addExample("http\nhttps", pht('Valid Setting'))
->setLocked(true),
$this->newOption(
@@ -226,7 +228,7 @@
pht('Determines whether or not YouTube videos get embedded.'))
->setDescription(
pht(
- "If you enable this, linked YouTube videos will be embeded ".
+ "If you enable this, linked YouTube videos will be embedded ".
"inline. This has mild security implications (you'll leak ".
"referrers to YouTube) and is pretty silly (but sort of ".
"awesome).")),
@@ -308,8 +310,10 @@
throw new PhabricatorConfigValidationException(
pht(
"Config option '%s' is invalid. The URI must start with ".
- "'http://' or 'https://'.",
- $key));
+ "'%s' or '%s'.",
+ $key,
+ 'http://',
+ 'https://'));
}
$domain = $uri->getDomain();
@@ -317,10 +321,11 @@
throw new PhabricatorConfigValidationException(
pht(
"Config option '%s' is invalid. The URI must contain a dot ('.'), ".
- "like 'http://example.com/', not just a bare name like ".
- "'http://example/'. Some web browsers will not set cookies on ".
- "domains with no TLD.",
- $key));
+ "like '%s', not just a bare name like '%s'. ".
+ "Some web browsers will not set cookies on domains with no TLD.",
+ $key,
+ 'http://example.com/',
+ 'http://example/'));
}
$path = $uri->getPath();
@@ -328,11 +333,11 @@
throw new PhabricatorConfigValidationException(
pht(
"Config option '%s' is invalid. The URI must NOT have a path, ".
- "e.g. 'http://phabricator.example.com/' is OK, but ".
- "'http://example.com/phabricator/' is not. Phabricator must be ".
- "installed on an entire domain; it can not be installed on a ".
- "path.",
- $key));
+ "e.g. '%s' is OK, but '%s' is not. Phabricator must be installed ".
+ "on an entire domain; it can not be installed on a path.",
+ $key,
+ 'http://phabricator.example.com/',
+ 'http://example.com/phabricator/'));
}
}
}
diff --git a/src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php b/src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php
--- a/src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php
+++ b/src/applications/config/option/PhabricatorSyntaxHighlightingConfigOptions.php
@@ -34,8 +34,8 @@
pht(
'Phabricator can highlight PHP by default and use Pygments for '.
'other languages if enabled. You can provide a custom '.
- 'highlighter engine by extending class '.
- 'PhutilSyntaxHighlighterEngine.')),
+ 'highlighter engine by extending class %s.',
+ 'PhutilSyntaxHighlighterEngine')),
$this->newOption('pygments.enabled', 'bool', false)
->setSummary(
pht('Should Phabricator use Pygments to highlight code?'))
@@ -128,7 +128,7 @@
'be tested against the filename. They should map to either an '.
'explicit language as a string value, or a numeric index into '.
'the captured groups as an integer.'))
- ->addExample('{"@\\.xyz$@": "php"}', pht('Highlight *.xyz as PHP.'))
+ ->addExample('{"@\\.xyz$@": "php"}', pht('Highlight %s as PHP.', '*.xyz'))
->addExample(
'{"@/httpd\\.conf@": "apacheconf"}',
pht('Highlight httpd.conf as "apacheconf".'))
diff --git a/src/applications/config/option/PhabricatorTranslationsConfigOptions.php b/src/applications/config/option/PhabricatorTranslationsConfigOptions.php
--- a/src/applications/config/option/PhabricatorTranslationsConfigOptions.php
+++ b/src/applications/config/option/PhabricatorTranslationsConfigOptions.php
@@ -25,10 +25,10 @@
->setSummary(pht('Override translations.'))
->setDescription(
pht(
- "You can use 'translation.override' if you don't want to create ".
- "a full translation to give users an option for switching to it ".
- "and you just want to override some strings in the default ".
- "translation."))
+ "You can use '%s' if you don't want to create a full translation ".
+ "to give users an option for switching to it and you just want to ".
+ "override some strings in the default translation.",
+ 'translation.override'))
->addExample(
'{"some string": "my alternative"}',
pht('Valid Setting')),
diff --git a/src/applications/config/option/PhabricatorUIConfigOptions.php b/src/applications/config/option/PhabricatorUIConfigOptions.php
--- a/src/applications/config/option/PhabricatorUIConfigOptions.php
+++ b/src/applications/config/option/PhabricatorUIConfigOptions.php
@@ -50,8 +50,7 @@
return array(
$this->newOption('ui.header-color', 'enum', 'dark')
->setDescription(
- pht(
- 'Sets the color of the main header.'))
+ pht('Sets the color of the main header.'))
->setEnumOptions($options),
$this->newOption('ui.footer-items', 'list<wild>', array())
->setSummary(
diff --git a/src/applications/config/schema/PhabricatorConfigSchemaQuery.php b/src/applications/config/schema/PhabricatorConfigSchemaQuery.php
--- a/src/applications/config/schema/PhabricatorConfigSchemaQuery.php
+++ b/src/applications/config/schema/PhabricatorConfigSchemaQuery.php
@@ -11,7 +11,10 @@
protected function getAPI() {
if (!$this->api) {
- throw new Exception(pht('Call setAPI() before issuing a query!'));
+ throw new Exception(
+ pht(
+ 'Call %s before issuing a query!',
+ 'setAPI()'));
}
return $this->api;
}
diff --git a/src/applications/conpherence/conduit/ConpherenceQueryThreadConduitAPIMethod.php b/src/applications/conpherence/conduit/ConpherenceQueryThreadConduitAPIMethod.php
--- a/src/applications/conpherence/conduit/ConpherenceQueryThreadConduitAPIMethod.php
+++ b/src/applications/conpherence/conduit/ConpherenceQueryThreadConduitAPIMethod.php
@@ -9,10 +9,10 @@
public function getMethodDescription() {
return pht(
- 'Query for conpherence threads for the logged in user. '.
- 'You can query by ids or phids for specific conpherence threads. '.
- 'Otherwise, specify limit and offset to query the most recently '.
- 'updated conpherences for the logged in user.');
+ 'Query for Conpherence threads for the logged in user. You can query '.
+ 'by IDs or PHIDs for specific Conpherence threads. Otherwise, specify '.
+ 'limit and offset to query the most recently updated Conpherences for '.
+ 'the logged in user.');
}
protected function defineParamTypes() {
diff --git a/src/applications/conpherence/conduit/ConpherenceQueryTransactionConduitAPIMethod.php b/src/applications/conpherence/conduit/ConpherenceQueryTransactionConduitAPIMethod.php
--- a/src/applications/conpherence/conduit/ConpherenceQueryTransactionConduitAPIMethod.php
+++ b/src/applications/conpherence/conduit/ConpherenceQueryTransactionConduitAPIMethod.php
@@ -10,9 +10,9 @@
public function getMethodDescription() {
return pht(
'Query for transactions for the logged in user within a specific '.
- 'conpherence thread. You can specify the thread by id or phid. '.
+ 'Conpherence thread. You can specify the thread by ID or PHID. '.
'Otherwise, specify limit and offset to query the most recent '.
- 'transactions within the conpherence for the logged in user.');
+ 'transactions within the Conpherence for the logged in user.');
}
protected function defineParamTypes() {
@@ -31,7 +31,7 @@
protected function defineErrorTypes() {
return array(
'ERR_USAGE_NO_THREAD_ID' => pht(
- 'You must specify a thread id or thread phid to query transactions '.
+ 'You must specify a thread id or thread PHID to query transactions '.
'from.'),
);
}
diff --git a/src/applications/console/plugin/DarkConsoleEventPlugin.php b/src/applications/console/plugin/DarkConsoleEventPlugin.php
--- a/src/applications/console/plugin/DarkConsoleEventPlugin.php
+++ b/src/applications/console/plugin/DarkConsoleEventPlugin.php
@@ -3,11 +3,11 @@
final class DarkConsoleEventPlugin extends DarkConsolePlugin {
public function getName() {
- return 'Events';
+ return pht('Events');
}
public function getDescription() {
- return 'Information about Phabricator events and event listeners.';
+ return pht('Information about Phabricator events and event listeners.');
}
public function generateData() {
@@ -51,8 +51,8 @@
$table = new AphrontTableView($rows);
$table->setHeaders(
array(
- 'Internal ID',
- 'Listener Class',
+ pht('Internal ID'),
+ pht('Listener Class'),
));
$table->setColumnClasses(
array(
@@ -71,7 +71,7 @@
foreach ($data['events'] as $event) {
$rows[] = array(
$event['type'],
- $event['stopped'] ? 'STOPPED' : null,
+ $event['stopped'] ? pht('STOPPED') : null,
);
}
@@ -82,8 +82,8 @@
));
$table->setHeaders(
array(
- 'Event Type',
- 'Stopped',
+ pht('Event Type'),
+ pht('Stopped'),
));
$out[] = $table->render();
diff --git a/src/applications/console/plugin/DarkConsoleRequestPlugin.php b/src/applications/console/plugin/DarkConsoleRequestPlugin.php
--- a/src/applications/console/plugin/DarkConsoleRequestPlugin.php
+++ b/src/applications/console/plugin/DarkConsoleRequestPlugin.php
@@ -3,11 +3,14 @@
final class DarkConsoleRequestPlugin extends DarkConsolePlugin {
public function getName() {
- return 'Request';
+ return pht('Request');
}
public function getDescription() {
- return 'Information about $_REQUEST and $_SERVER.';
+ return pht(
+ 'Information about %s and %s.',
+ '$_REQUEST',
+ '$_SERVER');
}
public function generateData() {
@@ -47,7 +50,7 @@
if (isset($mask[$key])) {
$rows[] = array(
$key,
- phutil_tag('em', array(), '(Masked)'),
+ phutil_tag('em', array(), pht('(Masked)')),
);
} else {
$rows[] = array(
diff --git a/src/applications/console/plugin/DarkConsoleServicesPlugin.php b/src/applications/console/plugin/DarkConsoleServicesPlugin.php
--- a/src/applications/console/plugin/DarkConsoleServicesPlugin.php
+++ b/src/applications/console/plugin/DarkConsoleServicesPlugin.php
@@ -5,11 +5,11 @@
protected $observations;
public function getName() {
- return 'Services';
+ return pht('Services');
}
public function getDescription() {
- return 'Information about services.';
+ return pht('Information about services.');
}
public static function getQueryAnalyzerHeader() {
@@ -44,7 +44,7 @@
$log[$key]['explain'] = array(
'sev' => 7,
'size' => null,
- 'reason' => 'Disabled',
+ 'reason' => pht('Disabled'),
);
// Query analysis is disabled for this request, so don't do any of it.
continue;
@@ -102,26 +102,26 @@
if (preg_match('/Using where/', $table['Extra'])) {
if ($table['rows'] < 256 && !empty($table['possible_keys'])) {
$cur_badness = 2;
- $cur_reason = 'Small Table Scan';
+ $cur_reason = pht('Small Table Scan');
} else {
$cur_badness = 6;
- $cur_reason = 'TABLE SCAN!';
+ $cur_reason = pht('TABLE SCAN!');
}
} else {
$cur_badness = 3;
- $cur_reason = 'Whole Table';
+ $cur_reason = pht('Whole Table');
}
break;
default:
if (preg_match('/No tables used/i', $table['Extra'])) {
$cur_badness = 1;
- $cur_reason = 'No Tables';
+ $cur_reason = pht('No Tables');
} else if (preg_match('/Impossible/i', $table['Extra'])) {
$cur_badness = 1;
- $cur_reason = 'Empty';
+ $cur_reason = pht('Empty');
} else {
$cur_badness = 4;
- $cur_reason = "Can't Analyze";
+ $cur_reason = pht("Can't Analyze");
}
break;
}
@@ -212,10 +212,10 @@
));
$summary_table->setHeaders(
array(
- 'Type',
- 'Count',
- 'Total Cost',
- 'Page Weight',
+ pht('Type'),
+ pht('Count'),
+ pht('Total Cost'),
+ pht('Page Weight'),
));
$results[] = $summary_table->render();
@@ -278,11 +278,11 @@
));
$table->setHeaders(
array(
- 'Event',
- 'Start',
- 'Duration',
- 'Details',
- 'Analysis',
+ pht('Event'),
+ pht('Start'),
+ pht('Duration'),
+ pht('Details'),
+ pht('Analysis'),
));
$results[] = $table->render();
diff --git a/src/applications/console/plugin/DarkConsoleXHProfPlugin.php b/src/applications/console/plugin/DarkConsoleXHProfPlugin.php
--- a/src/applications/console/plugin/DarkConsoleXHProfPlugin.php
+++ b/src/applications/console/plugin/DarkConsoleXHProfPlugin.php
@@ -5,7 +5,7 @@
protected $profileFilePHID;
public function getName() {
- return 'XHProf';
+ return pht('XHProf');
}
public function getColor() {
@@ -17,7 +17,7 @@
}
public function getDescription() {
- return 'Provides detailed PHP profiling information through XHProf.';
+ return pht('Provides detailed PHP profiling information through XHProf.');
}
public function generateData() {
@@ -49,12 +49,12 @@
),
'Installation Guide');
return hsprintf(
- '<div class="dark-console-no-content">'.
+ '<div class="dark-console-no-content">%s</div>',
+ pht(
'The "xhprof" PHP extension is not available. Install xhprof '.
'to enable the XHProf console plugin. You can find instructions in '.
- 'the %s.'.
- '</div>',
- $install_guide);
+ 'the %s.',
+ $install_guide));
}
$result = array();
diff --git a/src/applications/console/plugin/errorlog/DarkConsoleErrorLogPluginAPI.php b/src/applications/console/plugin/errorlog/DarkConsoleErrorLogPluginAPI.php
--- a/src/applications/console/plugin/errorlog/DarkConsoleErrorLogPluginAPI.php
+++ b/src/applications/console/plugin/errorlog/DarkConsoleErrorLogPluginAPI.php
@@ -67,7 +67,7 @@
);
break;
default:
- error_log('Unknown event : '.$event);
+ error_log(pht('Unknown event: %s', $event));
break;
}
}
diff --git a/src/applications/countdown/controller/PhabricatorCountdownDeleteController.php b/src/applications/countdown/controller/PhabricatorCountdownDeleteController.php
--- a/src/applications/countdown/controller/PhabricatorCountdownDeleteController.php
+++ b/src/applications/countdown/controller/PhabricatorCountdownDeleteController.php
@@ -33,8 +33,9 @@
->setURI('/countdown/');
}
- $inst = pht('Are you sure you want to delete the countdown %s?',
- $countdown->getTitle());
+ $inst = pht(
+ 'Are you sure you want to delete the countdown %s?',
+ $countdown->getTitle());
$dialog = new AphrontDialogView();
$dialog->setUser($request->getUser());
diff --git a/src/applications/daemon/controller/PhabricatorDaemonLogViewController.php b/src/applications/daemon/controller/PhabricatorDaemonLogViewController.php
--- a/src/applications/daemon/controller/PhabricatorDaemonLogViewController.php
+++ b/src/applications/daemon/controller/PhabricatorDaemonLogViewController.php
@@ -148,12 +148,10 @@
phutil_format_relative_time($wait_time));
break;
case PhabricatorDaemonLog::STATUS_EXITING:
- $details = pht(
- 'This daemon is shutting down gracefully.');
+ $details = pht('This daemon is shutting down gracefully.');
break;
case PhabricatorDaemonLog::STATUS_EXITED:
- $details = pht(
- 'This daemon exited normally and is no longer running.');
+ $details = pht('This daemon exited normally and is no longer running.');
break;
}
diff --git a/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php b/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php
--- a/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php
+++ b/src/applications/daemon/controller/PhabricatorWorkerTaskDetailController.php
@@ -95,7 +95,7 @@
$status = pht('Cancelled');
break;
default:
- throw new Exception('Unknown task status!');
+ throw new Exception(pht('Unknown task status!'));
}
} else {
$status = pht('Queued');
diff --git a/src/applications/daemon/management/PhabricatorDaemonManagementDebugWorkflow.php b/src/applications/daemon/management/PhabricatorDaemonManagementDebugWorkflow.php
--- a/src/applications/daemon/management/PhabricatorDaemonManagementDebugWorkflow.php
+++ b/src/applications/daemon/management/PhabricatorDaemonManagementDebugWorkflow.php
@@ -23,8 +23,10 @@
),
array(
'name' => 'as-current-user',
- 'help' => 'Run the daemon as the current user '.
- 'instead of the configured phd.user',
+ 'help' => pht(
+ 'Run the daemon as the current user '.
+ 'instead of the configured %s',
+ 'phd.user'),
),
array(
'name' => 'autoscale',
diff --git a/src/applications/daemon/management/PhabricatorDaemonManagementLogWorkflow.php b/src/applications/daemon/management/PhabricatorDaemonManagementLogWorkflow.php
--- a/src/applications/daemon/management/PhabricatorDaemonManagementLogWorkflow.php
+++ b/src/applications/daemon/management/PhabricatorDaemonManagementLogWorkflow.php
@@ -17,15 +17,15 @@
array(
'name' => 'id',
'param' => 'id',
- 'help' => 'Show logs for daemon(s) with given ID(s).',
+ 'help' => pht('Show logs for daemon(s) with given ID(s).'),
'repeat' => true,
),
array(
'name' => 'limit',
'param' => 'N',
'default' => 100,
- 'help' => 'Show a specific number of log messages '.
- '(default 100).',
+ 'help' => pht(
+ 'Show a specific number of log messages (default 100).'),
),
));
}
@@ -87,7 +87,7 @@
$console->writeOut(
"%s\n",
- sprintf(
+ pht(
'Daemon %d %s [%s] %s',
$id,
$type,
diff --git a/src/applications/daemon/management/PhabricatorDaemonManagementReloadWorkflow.php b/src/applications/daemon/management/PhabricatorDaemonManagementReloadWorkflow.php
--- a/src/applications/daemon/management/PhabricatorDaemonManagementReloadWorkflow.php
+++ b/src/applications/daemon/management/PhabricatorDaemonManagementReloadWorkflow.php
@@ -10,7 +10,8 @@
pht(
'Gracefully restart daemon processes in-place to pick up changes '.
'to source. This will not disrupt running jobs. This is an '.
- 'advanced workflow; most installs should use __phd restart__.'))
+ 'advanced workflow; most installs should use __%s__.',
+ 'phd restart'))
->setArguments(
array(
array(
diff --git a/src/applications/daemon/management/PhabricatorDaemonManagementRestartWorkflow.php b/src/applications/daemon/management/PhabricatorDaemonManagementRestartWorkflow.php
--- a/src/applications/daemon/management/PhabricatorDaemonManagementRestartWorkflow.php
+++ b/src/applications/daemon/management/PhabricatorDaemonManagementRestartWorkflow.php
@@ -6,9 +6,7 @@
protected function didConstruct() {
$this
->setName('restart')
- ->setSynopsis(
- pht(
- 'Stop, then start the standard daemon loadout.'))
+ ->setSynopsis(pht('Stop, then start the standard daemon loadout.'))
->setArguments(
array(
array(
diff --git a/src/applications/daemon/management/PhabricatorDaemonManagementStartWorkflow.php b/src/applications/daemon/management/PhabricatorDaemonManagementStartWorkflow.php
--- a/src/applications/daemon/management/PhabricatorDaemonManagementStartWorkflow.php
+++ b/src/applications/daemon/management/PhabricatorDaemonManagementStartWorkflow.php
@@ -9,20 +9,21 @@
->setSynopsis(
pht(
'Start the standard configured collection of Phabricator daemons. '.
- 'This is appropriate for most installs. Use **phd launch** to '.
- 'customize which daemons are launched.'))
+ 'This is appropriate for most installs. Use **%s** to '.
+ 'customize which daemons are launched.',
+ 'phd launch'))
->setArguments(
array(
array(
'name' => 'keep-leases',
'help' => pht(
- 'By default, **phd start** will free all task leases held by '.
- 'the daemons. With this flag, this step will be skipped.'),
+ 'By default, **%s** will free all task leases held by '.
+ 'the daemons. With this flag, this step will be skipped.',
+ 'phd start'),
),
array(
'name' => 'force',
- 'help' => pht(
- 'Start daemons even if daemons are already running.'),
+ 'help' => pht('Start daemons even if daemons are already running.'),
),
$this->getAutoscaleReserveArgument(),
));
diff --git a/src/applications/daemon/management/PhabricatorDaemonManagementStopWorkflow.php b/src/applications/daemon/management/PhabricatorDaemonManagementStopWorkflow.php
--- a/src/applications/daemon/management/PhabricatorDaemonManagementStopWorkflow.php
+++ b/src/applications/daemon/management/PhabricatorDaemonManagementStopWorkflow.php
@@ -9,7 +9,8 @@
->setSynopsis(
pht(
'Stop all running daemons, or specific daemons identified by PIDs. '.
- 'Use **phd status** to find PIDs.'))
+ 'Use **%s** to find PIDs.',
+ 'phd status'))
->setArguments(
array(
array(
diff --git a/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php b/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php
--- a/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php
+++ b/src/applications/daemon/management/PhabricatorDaemonManagementWorkflow.php
@@ -28,10 +28,15 @@
list($err) = exec_manual('mkdir -p %s', $path);
if ($err) {
throw new Exception(
- "phd requires the directory '{$path}' to exist, but it does not ".
- "exist and could not be created. Create this directory or update ".
- "'phd.pid-directory' / 'phd.log-directory' in your configuration ".
- "to point to an existing directory.");
+ pht(
+ "%s requires the directory '%s' to exist, but it does not exist ".
+ "and could not be created. Create this directory or update ".
+ "'%s' / '%s' in your configuration to point to an existing ".
+ "directory.",
+ 'phd',
+ $path,
+ 'phd.pid-directory',
+ 'phd.log-directory'));
}
}
return $path;
@@ -95,9 +100,9 @@
if (count($match) == 0) {
throw new PhutilArgumentUsageException(
pht(
- "No daemons match '%s'! Use 'phd list' for a list of available ".
- "daemons.",
- $substring));
+ "No daemons match '%s'! Use '%s' for a list of available daemons.",
+ $substring,
+ 'phd list'));
} else if (count($match) > 1) {
throw new PhutilArgumentUsageException(
pht(
@@ -130,14 +135,21 @@
$current_user = $current_user['name'];
if ($phd_user && $phd_user != $current_user) {
if ($debug) {
- throw new PhutilArgumentUsageException(pht(
- 'You are trying to run a daemon as a nonstandard user, '.
- 'and `phd` was not able to `sudo` to the correct user. '."\n".
- 'Phabricator is configured to run daemons as "%s", '.
- 'but the current user is "%s". '."\n".
- 'Use `sudo` to run as a different user, pass `--as-current-user` '.
- 'to ignore this warning, or edit `phd.user` '.
- 'to change the configuration.', $phd_user, $current_user));
+ throw new PhutilArgumentUsageException(
+ pht(
+ "You are trying to run a daemon as a nonstandard user, ".
+ "and `%s` was not able to `%s` to the correct user. \n".
+ 'Phabricator is configured to run daemons as "%s", '.
+ 'but the current user is "%s". '."\n".
+ 'Use `%s` to run as a different user, pass `%s` to ignore this '.
+ 'warning, or edit `%s` to change the configuration.',
+ 'phd',
+ 'sudo',
+ $phd_user,
+ $current_user,
+ 'sudo',
+ '--as-current-user',
+ 'phd.user'));
} else {
$this->runDaemonsAsUser = $phd_user;
$console->writeOut(pht('Starting daemons as %s', $phd_user)."\n");
@@ -213,8 +225,9 @@
$this->runDaemonsAsUser);
} catch (Exception $e) {
// Retry without sudo
- $console->writeOut(pht(
- "sudo command failed. Starting daemon as current user\n"));
+ $console->writeOut(
+ "%s\n",
+ pht('sudo command failed. Starting daemon as current user.'));
$this->executeDaemonLaunchCommand(
$command,
$daemon_script_dir,
@@ -270,8 +283,10 @@
private static function mustHaveExtension($ext) {
if (!extension_loaded($ext)) {
- echo "ERROR: The PHP extension '{$ext}' is not installed. You must ".
- "install it to run daemons on this machine.\n";
+ echo pht(
+ "ERROR: The PHP extension '%s' is not installed. You must ".
+ "install it to run daemons on this machine.\n",
+ $ext);
exit(1);
}
@@ -279,8 +294,10 @@
foreach ($extension->getFunctions() as $function) {
$function = $function->name;
if (!function_exists($function)) {
- echo "ERROR: The PHP function {$function}() is disabled. You must ".
- "enable it to run daemons on this machine.\n";
+ echo pht(
+ "ERROR: The PHP function %s is disabled. You must ".
+ "enable it to run daemons on this machine.\n",
+ $function.'()');
exit(1);
}
}
@@ -311,11 +328,15 @@
$message = pht(
"phd start: Unable to start daemons because daemons are already ".
"running.\n\n".
- "You can view running daemons with 'phd status'.\n".
- "You can stop running daemons with 'phd stop'.\n".
- "You can use 'phd restart' to stop all daemons before starting ".
+ "You can view running daemons with '%s'.\n".
+ "You can stop running daemons with '%s'.\n".
+ "You can use '%s' to stop all daemons before starting ".
"new daemons.\n".
- "You can force daemons to start anyway with --force.");
+ "You can force daemons to start anyway with %s.",
+ 'phd status',
+ 'phd stop',
+ 'phd restart',
+ '--force');
$console->writeErr("%s\n", $message);
exit(1);
@@ -352,7 +373,7 @@
$this->launchDaemons($daemons, $is_debug = false);
- $console->writeErr(pht('Done.')."\n");
+ $console->writeErr("%s\n", pht('Done.'));
return 0;
}
@@ -369,8 +390,9 @@
if ($gently && $force) {
throw new PhutilArgumentUsageException(
pht(
- 'You can not specify conflicting options --gently and --force '.
- 'together.'));
+ 'You can not specify conflicting options %s and %s together.',
+ '--gently',
+ '--force'));
}
$daemons = $this->loadRunningDaemons();
@@ -383,8 +405,9 @@
$force);
}
if (!$survivors) {
- $console->writeErr(pht(
- 'There are no running Phabricator daemons.')."\n");
+ $console->writeErr(
+ "%s\n",
+ pht('There are no running Phabricator daemons.'));
}
return 0;
}
@@ -392,7 +415,7 @@
$stop_pids = $this->selectDaemonPIDs($daemons, $pids);
if (!$stop_pids) {
- $console->writeErr(pht('No daemons to kill.')."\n");
+ $console->writeErr("%s\n", pht('No daemons to kill.'));
return 0;
}
@@ -470,12 +493,13 @@
$survivors = $this->sendStopSignals($rogue_pids, $grace_period);
if ($survivors) {
$console->writeErr(
+ "%s\n",
pht(
'Unable to stop processes running without PID files. '.
- 'Try running this command again with sudo.')."\n");
+ 'Try running this command again with sudo.'));
}
} else if ($warn) {
- $console->writeErr($this->getForceStopHint($rogue_daemons)."\n");
+ $console->writeErr("%s\n", $this->getForceStopHint($rogue_daemons));
}
}
@@ -488,11 +512,11 @@
$debug_output .= $rogue['pid'].' '.$rogue['command']."\n";
}
return pht(
- 'There are processes running that look like Phabricator daemons but '.
- 'have no corresponding PID files:'."\n\n".'%s'."\n\n".
- 'Stop these processes by re-running this command with the --force '.
- 'parameter.',
- $debug_output);
+ "There are processes running that look like Phabricator daemons but ".
+ "have no corresponding PID files:\n\n%s\n\n".
+ "Stop these processes by re-running this command with the %s parameter.",
+ $debug_output,
+ '--force');
}
private function sendStopSignals($pids, $grace_period) {
diff --git a/src/applications/daemon/view/PhabricatorDaemonLogEventsView.php b/src/applications/daemon/view/PhabricatorDaemonLogEventsView.php
--- a/src/applications/daemon/view/PhabricatorDaemonLogEventsView.php
+++ b/src/applications/daemon/view/PhabricatorDaemonLogEventsView.php
@@ -27,7 +27,10 @@
$rows = array();
if (!$this->user) {
- throw new Exception('Call setUser() before rendering!');
+ throw new Exception(
+ pht(
+ 'Call %s before rendering!',
+ 'setUser()'));
}
foreach ($this->events as $event) {
@@ -99,7 +102,7 @@
array(
'href' => '/daemon/log/'.$event->getLogID().'/',
),
- 'Daemon '.$event->getLogID()));
+ pht('Daemon %s', $event->getLogID())));
}
$rows[] = $row;
diff --git a/src/applications/daemon/view/PhabricatorDaemonLogListView.php b/src/applications/daemon/view/PhabricatorDaemonLogListView.php
--- a/src/applications/daemon/view/PhabricatorDaemonLogListView.php
+++ b/src/applications/daemon/view/PhabricatorDaemonLogListView.php
@@ -14,7 +14,10 @@
$rows = array();
if (!$this->user) {
- throw new Exception('Call setUser() before rendering!');
+ throw new Exception(
+ pht(
+ 'Call %s before rendering!',
+ 'setUser()'));
}
$env_hash = PhabricatorEnv::calculateEnvironmentHash();
diff --git a/src/applications/dashboard/controller/PhabricatorDashboardEditController.php b/src/applications/dashboard/controller/PhabricatorDashboardEditController.php
--- a/src/applications/dashboard/controller/PhabricatorDashboardEditController.php
+++ b/src/applications/dashboard/controller/PhabricatorDashboardEditController.php
@@ -226,11 +226,9 @@
"This is a simple template dashboard. You can edit this panel ".
"to change this text and replace it with a welcome message, or ".
"leave this placeholder text as-is to give your dashboard a ".
- "rustic, authentic feel.".
- "\n\n".
+ "rustic, authentic feel.\n\n".
"You can drag, remove, add, and edit panels to customize the ".
- "rest of this dashboard to show the information you want.".
- "\n\n".
+ "rest of this dashboard to show the information you want.\n\n".
"To install this dashboard on the home page, use the ".
"**Install Dashboard** action link above."),
));
diff --git a/src/applications/dashboard/layoutconfig/PhabricatorDashboardLayoutConfig.php b/src/applications/dashboard/layoutconfig/PhabricatorDashboardLayoutConfig.php
--- a/src/applications/dashboard/layoutconfig/PhabricatorDashboardLayoutConfig.php
+++ b/src/applications/dashboard/layoutconfig/PhabricatorDashboardLayoutConfig.php
@@ -124,10 +124,10 @@
);
break;
case self::MODE_FULL:
- throw new Exception('There is only one column in mode full.');
+ throw new Exception(pht('There is only one column in mode full.'));
break;
default:
- throw new Exception('Unknown layout mode!');
+ throw new Exception(pht('Unknown layout mode!'));
break;
}
diff --git a/src/applications/differential/__tests__/DifferentialParseRenderTestCase.php b/src/applications/differential/__tests__/DifferentialParseRenderTestCase.php
--- a/src/applications/differential/__tests__/DifferentialParseRenderTestCase.php
+++ b/src/applications/differential/__tests__/DifferentialParseRenderTestCase.php
@@ -109,8 +109,7 @@
} else if ($type == 'two') {
$cparser->setRenderer(new DifferentialChangesetTwoUpTestRenderer());
} else {
- throw new Exception(
- pht('Unknown renderer type "%s"!', $type));
+ throw new Exception(pht('Unknown renderer type "%s"!', $type));
}
$parsers[] = $cparser;
diff --git a/src/applications/differential/application/PhabricatorDifferentialApplication.php b/src/applications/differential/application/PhabricatorDifferentialApplication.php
--- a/src/applications/differential/application/PhabricatorDifferentialApplication.php
+++ b/src/applications/differential/application/PhabricatorDifferentialApplication.php
@@ -50,11 +50,9 @@
}
public function getOverview() {
- return pht(<<<EOTEXT
-Differential is a **code review application** which allows engineers to review,
-discuss and approve changes to software.
-EOTEXT
-);
+ return pht(
+ 'Differential is a **code review application** which allows '.
+ 'engineers to review, discuss and approve changes to software.');
}
public function getRoutes() {
diff --git a/src/applications/differential/conduit/DifferentialCloseConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialCloseConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialCloseConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialCloseConduitAPIMethod.php
@@ -23,7 +23,7 @@
protected function defineErrorTypes() {
return array(
- 'ERR_NOT_FOUND' => 'Revision was not found.',
+ 'ERR_NOT_FOUND' => pht('Revision was not found.'),
);
}
diff --git a/src/applications/differential/conduit/DifferentialCreateCommentConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialCreateCommentConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialCreateCommentConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialCreateCommentConduitAPIMethod.php
@@ -27,7 +27,7 @@
protected function defineErrorTypes() {
return array(
- 'ERR_BAD_REVISION' => 'Bad revision ID.',
+ 'ERR_BAD_REVISION' => pht('Bad revision ID.'),
);
}
diff --git a/src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialCreateDiffConduitAPIMethod.php
@@ -8,11 +8,10 @@
}
public function getMethodDescription() {
- return 'Create a new Differential diff.';
+ return pht('Create a new Differential diff.');
}
protected function defineParamTypes() {
-
$vcs_const = $this->formatStringConstants(
array(
'svn',
diff --git a/src/applications/differential/conduit/DifferentialCreateInlineConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialCreateInlineConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialCreateInlineConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialCreateInlineConduitAPIMethod.php
@@ -8,7 +8,7 @@
}
public function getMethodDescription() {
- return 'Add an inline comment to a Differential revision.';
+ return pht('Add an inline comment to a Differential revision.');
}
protected function defineParamTypes() {
@@ -29,11 +29,16 @@
protected function defineErrorTypes() {
return array(
- 'ERR-BAD-REVISION' => 'Bad revision ID.',
- 'ERR-BAD-DIFF' => 'Bad diff ID, or diff does not belong to revision.',
- 'ERR-NEED-DIFF' => 'Neither revision ID nor diff ID was provided.',
- 'ERR-NEED-FILE' => 'A file path was not provided.',
- 'ERR-BAD-FILE' => "Requested file doesn't exist in this revision.",
+ 'ERR-BAD-REVISION' => pht(
+ 'Bad revision ID.'),
+ 'ERR-BAD-DIFF' => pht(
+ 'Bad diff ID, or diff does not belong to revision.'),
+ 'ERR-NEED-DIFF' => pht(
+ 'Neither revision ID nor diff ID was provided.'),
+ 'ERR-NEED-FILE' => pht(
+ 'A file path was not provided.'),
+ 'ERR-BAD-FILE' => pht(
+ "Requested file doesn't exist in this revision."),
);
}
diff --git a/src/applications/differential/conduit/DifferentialCreateRevisionConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialCreateRevisionConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialCreateRevisionConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialCreateRevisionConduitAPIMethod.php
@@ -27,7 +27,7 @@
protected function defineErrorTypes() {
return array(
- 'ERR_BAD_DIFF' => 'Bad diff ID.',
+ 'ERR_BAD_DIFF' => pht('Bad diff ID.'),
);
}
diff --git a/src/applications/differential/conduit/DifferentialFindConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialFindConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialFindConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialFindConduitAPIMethod.php
@@ -12,11 +12,11 @@
}
public function getMethodStatusDescription() {
- return "Replaced by 'differential.query'.";
+ return pht("Replaced by '%s'.", 'differential.query');
}
public function getMethodDescription() {
- return 'Query Differential revisions which match certain criteria.';
+ return pht('Query Differential revisions which match certain criteria.');
}
protected function defineParamTypes() {
diff --git a/src/applications/differential/conduit/DifferentialFinishPostponedLintersConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialFinishPostponedLintersConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialFinishPostponedLintersConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialFinishPostponedLintersConduitAPIMethod.php
@@ -8,8 +8,9 @@
}
public function getMethodDescription() {
- return 'Update diff with new lint messages and mark postponed '.
- 'linters as finished.';
+ return pht(
+ 'Update diff with new lint messages and mark postponed '.
+ 'linters as finished.');
}
protected function defineParamTypes() {
@@ -25,14 +26,13 @@
protected function defineErrorTypes() {
return array(
- 'ERR-BAD-DIFF' => 'Bad diff ID.',
- 'ERR-BAD-LINTER' => 'No postponed linter by the given name',
- 'ERR-NO-LINT' => 'No postponed lint field available in diff',
+ 'ERR-BAD-DIFF' => pht('Bad diff ID.'),
+ 'ERR-BAD-LINTER' => pht('No postponed linter by the given name.'),
+ 'ERR-NO-LINT' => pht('No postponed lint field available in diff.'),
);
}
protected function execute(ConduitAPIRequest $request) {
-
$diff_id = $request->getValue('diffID');
$linter_map = $request->getValue('linters');
diff --git a/src/applications/differential/conduit/DifferentialGetAllDiffsConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialGetAllDiffsConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialGetAllDiffsConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialGetAllDiffsConduitAPIMethod.php
@@ -13,11 +13,12 @@
public function getMethodStatusDescription() {
return pht(
- 'This method has been deprecated in favor of differential.querydiffs.');
+ 'This method has been deprecated in favor of %s.',
+ 'differential.querydiffs');
}
public function getMethodDescription() {
- return 'Load all diffs for given revisions from Differential.';
+ return pht('Load all diffs for given revisions from Differential.');
}
protected function defineParamTypes() {
diff --git a/src/applications/differential/conduit/DifferentialGetCommitMessageConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialGetCommitMessageConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialGetCommitMessageConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialGetCommitMessageConduitAPIMethod.php
@@ -8,7 +8,7 @@
}
public function getMethodDescription() {
- return 'Retrieve Differential commit messages or message templates.';
+ return pht('Retrieve Differential commit messages or message templates.');
}
protected function defineParamTypes() {
@@ -27,7 +27,7 @@
protected function defineErrorTypes() {
return array(
- 'ERR_NOT_FOUND' => 'Revision was not found.',
+ 'ERR_NOT_FOUND' => pht('Revision was not found.'),
);
}
diff --git a/src/applications/differential/conduit/DifferentialGetCommitPathsConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialGetCommitPathsConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialGetCommitPathsConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialGetCommitPathsConduitAPIMethod.php
@@ -8,8 +8,9 @@
}
public function getMethodDescription() {
- return 'Query which paths should be included when committing a '.
- 'Differential revision.';
+ return pht(
+ 'Query which paths should be included when committing a '.
+ 'Differential revision.');
}
protected function defineParamTypes() {
@@ -24,7 +25,7 @@
protected function defineErrorTypes() {
return array(
- 'ERR_NOT_FOUND' => 'No such revision exists.',
+ 'ERR_NOT_FOUND' => pht('No such revision exists.'),
);
}
diff --git a/src/applications/differential/conduit/DifferentialGetDiffConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialGetDiffConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialGetDiffConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialGetDiffConduitAPIMethod.php
@@ -17,13 +17,15 @@
public function getMethodStatusDescription() {
return pht(
- 'This method has been deprecated in favor of differential.querydiffs.');
+ 'This method has been deprecated in favor of %s.',
+ 'differential.querydiffs');
}
public function getMethodDescription() {
- return pht('Load the content of a diff from Differential by revision id '.
- 'or diff id.');
+ return pht(
+ 'Load the content of a diff from Differential by revision ID '.
+ 'or diff ID.');
}
protected function defineParamTypes() {
@@ -39,7 +41,7 @@
protected function defineErrorTypes() {
return array(
- 'ERR_BAD_DIFF' => 'No such diff exists.',
+ 'ERR_BAD_DIFF' => pht('No such diff exists.'),
);
}
diff --git a/src/applications/differential/conduit/DifferentialGetRevisionCommentsConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialGetRevisionCommentsConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialGetRevisionCommentsConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialGetRevisionCommentsConduitAPIMethod.php
@@ -16,7 +16,7 @@
}
public function getMethodDescription() {
- return 'Retrieve Differential Revision Comments.';
+ return pht('Retrieve Differential Revision Comments.');
}
protected function defineParamTypes() {
diff --git a/src/applications/differential/conduit/DifferentialGetRevisionConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialGetRevisionConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialGetRevisionConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialGetRevisionConduitAPIMethod.php
@@ -12,11 +12,11 @@
}
public function getMethodStatusDescription() {
- return "Replaced by 'differential.query'.";
+ return pht("Replaced by '%s'.", 'differential.query');
}
public function getMethodDescription() {
- return 'Load the content of a revision from Differential.';
+ return pht('Load the content of a revision from Differential.');
}
protected function defineParamTypes() {
@@ -31,7 +31,7 @@
protected function defineErrorTypes() {
return array(
- 'ERR_BAD_REVISION' => 'No such revision exists.',
+ 'ERR_BAD_REVISION' => pht('No such revision exists.'),
);
}
diff --git a/src/applications/differential/conduit/DifferentialQueryConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialQueryConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialQueryConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialQueryConduitAPIMethod.php
@@ -8,7 +8,7 @@
}
public function getMethodDescription() {
- return 'Query Differential revisions which match certain criteria.';
+ return pht('Query Differential revisions which match certain criteria.');
}
protected function defineParamTypes() {
@@ -54,7 +54,7 @@
protected function defineErrorTypes() {
return array(
- 'ERR-INVALID-PARAMETER' => 'Missing or malformed parameter.',
+ 'ERR-INVALID-PARAMETER' => pht('Missing or malformed parameter.'),
);
}
diff --git a/src/applications/differential/conduit/DifferentialSetDiffPropertyConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialSetDiffPropertyConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialSetDiffPropertyConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialSetDiffPropertyConduitAPIMethod.php
@@ -8,7 +8,7 @@
}
public function getMethodDescription() {
- return 'Attach properties to Differential diffs.';
+ return pht('Attach properties to Differential diffs.');
}
protected function defineParamTypes() {
@@ -25,7 +25,7 @@
protected function defineErrorTypes() {
return array(
- 'ERR_NOT_FOUND' => 'Diff was not found.',
+ 'ERR_NOT_FOUND' => pht('Diff was not found.'),
);
}
diff --git a/src/applications/differential/conduit/DifferentialUpdateRevisionConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialUpdateRevisionConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialUpdateRevisionConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialUpdateRevisionConduitAPIMethod.php
@@ -26,10 +26,10 @@
protected function defineErrorTypes() {
return array(
- 'ERR_BAD_DIFF' => 'Bad diff ID.',
- 'ERR_BAD_REVISION' => 'Bad revision ID.',
- 'ERR_WRONG_USER' => 'You are not the author of this revision.',
- 'ERR_CLOSED' => 'This revision has already been closed.',
+ 'ERR_BAD_DIFF' => pht('Bad diff ID.'),
+ 'ERR_BAD_REVISION' => pht('Bad revision ID.'),
+ 'ERR_WRONG_USER' => pht('You are not the author of this revision.'),
+ 'ERR_CLOSED' => pht('This revision has already been closed.'),
);
}
diff --git a/src/applications/differential/conduit/DifferentialUpdateUnitResultsConduitAPIMethod.php b/src/applications/differential/conduit/DifferentialUpdateUnitResultsConduitAPIMethod.php
--- a/src/applications/differential/conduit/DifferentialUpdateUnitResultsConduitAPIMethod.php
+++ b/src/applications/differential/conduit/DifferentialUpdateUnitResultsConduitAPIMethod.php
@@ -8,7 +8,7 @@
}
public function getMethodDescription() {
- return 'Update arc unit results for a postponed test.';
+ return pht('Update arc unit results for a postponed test.');
}
protected function defineParamTypes() {
@@ -29,13 +29,12 @@
protected function defineErrorTypes() {
return array(
- 'ERR_BAD_DIFF' => 'Bad diff ID.',
- 'ERR_NO_RESULTS' => 'Could not find the postponed test',
+ 'ERR_BAD_DIFF' => pht('Bad diff ID.'),
+ 'ERR_NO_RESULTS' => pht('Could not find the postponed test'),
);
}
protected function execute(ConduitAPIRequest $request) {
-
$diff_id = $request->getValue('diff_id');
if (!$diff_id) {
throw new ConduitException('ERR_BAD_DIFF');
diff --git a/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php b/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php
--- a/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php
+++ b/src/applications/differential/config/PhabricatorDifferentialConfigOptions.php
@@ -201,11 +201,12 @@
))
->setSummary(pht('Allows any user to reopen a closed revision.'))
->setDescription(
- pht('If you set this to true, any user can reopen a revision so '.
- 'long as it has been closed. This can be useful if a revision '.
- 'is accidentally closed or if a developer changes his or her '.
- 'mind after closing a revision. If it is false, reopening '.
- 'is not allowed.')),
+ pht(
+ 'If you set this to true, any user can reopen a revision so '.
+ 'long as it has been closed. This can be useful if a revision '.
+ 'is accidentally closed or if a developer changes his or her '.
+ 'mind after closing a revision. If it is false, reopening '.
+ 'is not allowed.')),
$this->newOption('differential.close-on-accept', 'bool', false)
->setBoolOptions(
array(
@@ -242,8 +243,9 @@
pht("After this many days, a revision will be considered 'stale'."))
->setDescription(
pht(
- "Similar to `differential.days-fresh` but marks stale revisions. ".
- "If the revision is even older than it is when marked as 'old'.")),
+ "Similar to `%s` but marks stale revisions. ".
+ "If the revision is even older than it is when marked as 'old'.",
+ 'differential.days-fresh')),
$this->newOption(
'metamta.differential.subject-prefix',
'string',
diff --git a/src/applications/differential/constants/DifferentialAction.php b/src/applications/differential/constants/DifferentialAction.php
--- a/src/applications/differential/constants/DifferentialAction.php
+++ b/src/applications/differential/constants/DifferentialAction.php
@@ -23,71 +23,88 @@
public static function getBasicStoryText($action, $author_name) {
switch ($action) {
case DifferentialAction::ACTION_COMMENT:
- $title = pht('%s commented on this revision.',
+ $title = pht(
+ '%s commented on this revision.',
$author_name);
break;
case DifferentialAction::ACTION_ACCEPT:
- $title = pht('%s accepted this revision.',
+ $title = pht(
+ '%s accepted this revision.',
$author_name);
break;
case DifferentialAction::ACTION_REJECT:
- $title = pht('%s requested changes to this revision.',
+ $title = pht(
+ '%s requested changes to this revision.',
$author_name);
break;
case DifferentialAction::ACTION_RETHINK:
- $title = pht('%s planned changes to this revision.',
+ $title = pht(
+ '%s planned changes to this revision.',
$author_name);
break;
case DifferentialAction::ACTION_ABANDON:
- $title = pht('%s abandoned this revision.',
+ $title = pht(
+ '%s abandoned this revision.',
$author_name);
break;
case DifferentialAction::ACTION_CLOSE:
- $title = pht('%s closed this revision.',
+ $title = pht(
+ '%s closed this revision.',
$author_name);
break;
case DifferentialAction::ACTION_REQUEST:
- $title = pht('%s requested a review of this revision.',
+ $title = pht(
+ '%s requested a review of this revision.',
$author_name);
break;
case DifferentialAction::ACTION_RECLAIM:
- $title = pht('%s reclaimed this revision.',
+ $title = pht(
+ '%s reclaimed this revision.',
$author_name);
break;
case DifferentialAction::ACTION_UPDATE:
- $title = pht('%s updated this revision.',
+ $title = pht(
+ '%s updated this revision.',
$author_name);
break;
case DifferentialAction::ACTION_RESIGN:
- $title = pht('%s resigned from this revision.',
+ $title = pht(
+ '%s resigned from this revision.',
$author_name);
break;
case DifferentialAction::ACTION_SUMMARIZE:
- $title = pht('%s summarized this revision.',
+ $title = pht(
+ '%s summarized this revision.',
$author_name);
break;
case DifferentialAction::ACTION_TESTPLAN:
- $title = pht('%s explained the test plan for this revision.',
+ $title = pht(
+ '%s explained the test plan for this revision.',
$author_name);
break;
case DifferentialAction::ACTION_CREATE:
- $title = pht('%s created this revision.',
+ $title = pht(
+ '%s created this revision.',
$author_name);
break;
case DifferentialAction::ACTION_ADDREVIEWERS:
- $title = pht('%s added reviewers to this revision.',
+ $title = pht(
+ '%s added reviewers to this revision.',
$author_name);
break;
case DifferentialAction::ACTION_ADDCCS:
- $title = pht('%s added CCs to this revision.',
+ $title = pht(
+ '%s added CCs to this revision.',
$author_name);
break;
case DifferentialAction::ACTION_CLAIM:
- $title = pht('%s commandeered this revision.',
+ $title = pht(
+ '%s commandeered this revision.',
$author_name);
break;
case DifferentialAction::ACTION_REOPEN:
- $title = pht('%s reopened this revision.',
+ $title = pht(
+ '%s reopened this revision.',
$author_name);
break;
case DifferentialTransaction::TYPE_INLINE:
@@ -105,9 +122,9 @@
public static function getActionVerb($action) {
$verbs = array(
self::ACTION_COMMENT => pht('Comment'),
- self::ACTION_ACCEPT => pht("Accept Revision \xE2\x9C\x94"),
- self::ACTION_REJECT => pht("Request Changes \xE2\x9C\x98"),
- self::ACTION_RETHINK => pht("Plan Changes \xE2\x9C\x98"),
+ self::ACTION_ACCEPT => pht('Accept Revision')." \xE2\x9C\x94",
+ self::ACTION_REJECT => pht('Request Changes')." \xE2\x9C\x98",
+ self::ACTION_RETHINK => pht('Plan Changes')." \xE2\x9C\x98",
self::ACTION_ABANDON => pht('Abandon Revision'),
self::ACTION_REQUEST => pht('Request Review'),
self::ACTION_RECLAIM => pht('Reclaim Revision'),
@@ -122,7 +139,7 @@
if (!empty($verbs[$action])) {
return $verbs[$action];
} else {
- return 'brazenly '.$action;
+ return pht('brazenly %s', $action);
}
}
diff --git a/src/applications/differential/constants/DifferentialChangeType.php b/src/applications/differential/constants/DifferentialChangeType.php
--- a/src/applications/differential/constants/DifferentialChangeType.php
+++ b/src/applications/differential/constants/DifferentialChangeType.php
@@ -105,7 +105,7 @@
self::TYPE_MESSAGE => pht('Commit Message'),
self::TYPE_CHILD => pht('Contents Modified'),
);
- return idx($types, coalesce($type, '?'), 'Unknown');
+ return idx($types, coalesce($type, '?'), pht('Unknown'));
}
}
diff --git a/src/applications/differential/controller/DifferentialInlineCommentEditController.php b/src/applications/differential/controller/DifferentialInlineCommentEditController.php
--- a/src/applications/differential/controller/DifferentialInlineCommentEditController.php
+++ b/src/applications/differential/controller/DifferentialInlineCommentEditController.php
@@ -59,7 +59,7 @@
$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;
}
diff --git a/src/applications/differential/controller/DifferentialRevisionCloseDetailsController.php b/src/applications/differential/controller/DifferentialRevisionCloseDetailsController.php
--- a/src/applications/differential/controller/DifferentialRevisionCloseDetailsController.php
+++ b/src/applications/differential/controller/DifferentialRevisionCloseDetailsController.php
@@ -55,9 +55,10 @@
$body_why = array();
if ($revision_match_data['usedURI']) {
return pht(
- 'We found a "Differential Revision" field with value "%s" in the '.
- 'commit message, and the domain on the URI matches this install, so '.
+ 'We found a "%s" field with value "%s" in the commit message, '.
+ 'and the domain on the URI matches this install, so '.
'we linked this commit to %s.',
+ 'Differential Revision',
$revision_match_data['foundURI'],
phutil_tag(
'a',
@@ -67,16 +68,17 @@
$obj_handle->getName()));
} else if ($revision_match_data['foundURI']) {
$body_why[] = pht(
- 'We found a "Differential Revision" field with value "%s" in the '.
- 'commit message, but the domain on this URI did not match the '.
- 'configured domain for this install, "%s", so we ignored it under '.
+ 'We found a "%s" field with value "%s" in the commit message, '.
+ 'but the domain on this URI did not match the configured '.
+ 'domain for this install, "%s", so we ignored it under '.
'the assumption that it refers to some third-party revision.',
+ 'Differential Revision',
$revision_match_data['foundURI'],
$revision_match_data['validDomain']);
} else {
$body_why[] = pht(
- 'We didn\'t find a "Differential Revision" field in the commit '.
- 'message.');
+ 'We didn\'t find a "%s" field in the commit message.',
+ 'Differential Revision');
}
switch ($revision_match_data['matchHashType']) {
diff --git a/src/applications/differential/controller/DifferentialRevisionEditController.php b/src/applications/differential/controller/DifferentialRevisionEditController.php
--- a/src/applications/differential/controller/DifferentialRevisionEditController.php
+++ b/src/applications/differential/controller/DifferentialRevisionEditController.php
@@ -49,7 +49,8 @@
}
if ($diff->getRevisionID()) {
// TODO: Redirect?
- throw new Exception('This diff is already attached to a revision!');
+ throw new Exception(
+ pht('This diff is already attached to a revision!'));
}
} else {
$diff = null;
diff --git a/src/applications/differential/controller/DifferentialRevisionLandController.php b/src/applications/differential/controller/DifferentialRevisionLandController.php
--- a/src/applications/differential/controller/DifferentialRevisionLandController.php
+++ b/src/applications/differential/controller/DifferentialRevisionLandController.php
@@ -29,10 +29,12 @@
$this->pushStrategy = newv($this->strategyClass, array());
} else {
throw new Exception(
- "Strategy type must be a valid class name and must subclass ".
- "DifferentialLandingStrategy. ".
- "'{$this->strategyClass}' is not a subclass of ".
- "DifferentialLandingStrategy.");
+ pht(
+ "Strategy type must be a valid class name and must subclass ".
+ "%s. '%s' is not a subclass of %s",
+ 'DifferentialLandingStrategy',
+ $this->strategyClass,
+ 'DifferentialLandingStrategy'));
}
if ($request->isDialogFormPost()) {
@@ -91,7 +93,7 @@
$prompt = hsprintf('%s<br><br>%s',
pht(
'This will squash and rebase revision %s, and push it to '.
- 'the default / master branch.',
+ 'the default / master branch.',
$revision_id),
pht('It is an experimental feature and may not work.'));
@@ -109,13 +111,13 @@
private function attemptLand($revision, $request) {
$status = $revision->getStatus();
if ($status != ArcanistDifferentialRevisionStatus::ACCEPTED) {
- throw new Exception('Only Accepted revisions can be landed.');
+ throw new Exception(pht('Only Accepted revisions can be landed.'));
}
$repository = $revision->getRepository();
if ($repository === null) {
- throw new Exception('revision is not attached to a repository.');
+ throw new Exception(pht('Revision is not attached to a repository.'));
}
$can_push = PhabricatorPolicyFilter::hasCapability(
diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php
--- a/src/applications/differential/controller/DifferentialRevisionViewController.php
+++ b/src/applications/differential/controller/DifferentialRevisionViewController.php
@@ -39,7 +39,7 @@
if (!$diffs) {
throw new Exception(
- 'This revision has no diffs. Something has gone quite wrong.');
+ pht('This revision has no diffs. Something has gone quite wrong.'));
}
$revision->attachActiveDiff(last($diffs));
diff --git a/src/applications/differential/customfield/DifferentialBranchField.php b/src/applications/differential/customfield/DifferentialBranchField.php
--- a/src/applications/differential/customfield/DifferentialBranchField.php
+++ b/src/applications/differential/customfield/DifferentialBranchField.php
@@ -45,8 +45,9 @@
public function getProTips() {
return array(
pht(
- 'In Git and Mercurial, use a branch like "T123" to automatically '.
- 'associate changes with the corresponding task.'),
+ 'In Git and Mercurial, use a branch like "%s" to automatically '.
+ 'associate changes with the corresponding task.',
+ 'T123'),
);
}
diff --git a/src/applications/differential/customfield/DifferentialConflictsField.php b/src/applications/differential/customfield/DifferentialConflictsField.php
--- a/src/applications/differential/customfield/DifferentialConflictsField.php
+++ b/src/applications/differential/customfield/DifferentialConflictsField.php
@@ -22,8 +22,8 @@
public function getFieldDescription() {
return pht(
- 'Parses the "Conflicts" field which Git can inject into commit '.
- 'messages.');
+ 'Parses the "%s" field which Git can inject into commit messages.',
+ 'Conflicts');
}
public function canDisableField() {
diff --git a/src/applications/differential/customfield/DifferentialDependsOnField.php b/src/applications/differential/customfield/DifferentialDependsOnField.php
--- a/src/applications/differential/customfield/DifferentialDependsOnField.php
+++ b/src/applications/differential/customfield/DifferentialDependsOnField.php
@@ -45,7 +45,8 @@
return array(
pht(
'Create a dependency between revisions by writing '.
- '"Depends on D123" in your summary.'),
+ '"%s" in your summary.',
+ 'Depends on D123'),
);
}
diff --git a/src/applications/differential/customfield/DifferentialGitSVNIDField.php b/src/applications/differential/customfield/DifferentialGitSVNIDField.php
--- a/src/applications/differential/customfield/DifferentialGitSVNIDField.php
+++ b/src/applications/differential/customfield/DifferentialGitSVNIDField.php
@@ -22,8 +22,8 @@
public function getFieldDescription() {
return pht(
- 'Parses the "git-svn-id" field which Git/SVN can inject into commit '.
- 'messages.');
+ 'Parses the "%s" field which Git/SVN can inject into commit messages.',
+ 'git-svn-id');
}
public function canDisableField() {
diff --git a/src/applications/differential/customfield/DifferentialLintField.php b/src/applications/differential/customfield/DifferentialLintField.php
--- a/src/applications/differential/customfield/DifferentialLintField.php
+++ b/src/applications/differential/customfield/DifferentialLintField.php
@@ -130,7 +130,9 @@
idx($location, 'path', $path).
($other_line ? ":{$other_line}" : '');
}
- $description .= "\nOther locations: ".implode(', ', $locations);
+ $description .= "\n".pht(
+ 'Other locations: %s',
+ implode(', ', $locations));
}
if (strlen($description)) {
@@ -231,7 +233,9 @@
}
}
- return 'Show Full Lint Results ('.implode(', ', $show).')';
+ return pht(
+ 'Show Full Lint Results (%s)',
+ implode(', ', $show));
}
public function getWarningsForDetailView() {
diff --git a/src/applications/differential/customfield/DifferentialManiphestTasksField.php b/src/applications/differential/customfield/DifferentialManiphestTasksField.php
--- a/src/applications/differential/customfield/DifferentialManiphestTasksField.php
+++ b/src/applications/differential/customfield/DifferentialManiphestTasksField.php
@@ -106,8 +106,9 @@
public function getProTips() {
return array(
pht(
- 'Write "Fixes T123" in your summary to automatically close the '.
- 'corresponding task when this change lands.'),
+ 'Write "%s" in your summary to automatically close the '.
+ 'corresponding task when this change lands.',
+ 'Fixes T123'),
);
}
diff --git a/src/applications/differential/customfield/DifferentialProjectReviewersField.php b/src/applications/differential/customfield/DifferentialProjectReviewersField.php
--- a/src/applications/differential/customfield/DifferentialProjectReviewersField.php
+++ b/src/applications/differential/customfield/DifferentialProjectReviewersField.php
@@ -61,7 +61,8 @@
return array(
pht(
'You can add a project as a subscriber or reviewer by writing '.
- '"#projectname" in the appropriate field.'),
+ '"%s" in the appropriate field.',
+ '#projectname'),
);
}
diff --git a/src/applications/differential/customfield/DifferentialRepositoryField.php b/src/applications/differential/customfield/DifferentialRepositoryField.php
--- a/src/applications/differential/customfield/DifferentialRepositoryField.php
+++ b/src/applications/differential/customfield/DifferentialRepositoryField.php
@@ -155,7 +155,8 @@
return;
}
- $body->addTextSection(pht('REPOSITORY'),
+ $body->addTextSection(
+ pht('REPOSITORY'),
$repository->getMonogram().' '.$repository->getName());
}
diff --git a/src/applications/differential/customfield/DifferentialRevisionIDField.php b/src/applications/differential/customfield/DifferentialRevisionIDField.php
--- a/src/applications/differential/customfield/DifferentialRevisionIDField.php
+++ b/src/applications/differential/customfield/DifferentialRevisionIDField.php
@@ -19,8 +19,7 @@
public function getFieldDescription() {
return pht(
- 'Ties commits to revisions and provides a permananent link between '.
- 'them.');
+ 'Ties commits to revisions and provides a permanent link between them.');
}
public function canDisableField() {
diff --git a/src/applications/differential/customfield/DifferentialUnitField.php b/src/applications/differential/customfield/DifferentialUnitField.php
--- a/src/applications/differential/customfield/DifferentialUnitField.php
+++ b/src/applications/differential/customfield/DifferentialUnitField.php
@@ -49,7 +49,7 @@
if ($excuse) {
$rows[] = array(
'style' => 'excuse',
- 'name' => 'Excuse',
+ 'name' => pht('Excuse'),
'value' => phutil_escape_html_newlines($excuse),
'show' => true,
);
@@ -83,8 +83,8 @@
$userdata = str_replace("\000", '', $userdata);
}
$markup_object = id(new PhabricatorMarkupOneOff())
- ->setContent($userdata)
- ->setPreserveLinebreaks(true);
+ ->setContent($userdata)
+ ->setPreserveLinebreaks(true);
$engine->addObject($markup_object, 'default');
$markup_objects[$key] = $markup_object;
}
@@ -189,12 +189,12 @@
)) + $hidden;
$noun = array(
- ArcanistUnitTestResult::RESULT_BROKEN => 'Broken',
- ArcanistUnitTestResult::RESULT_FAIL => 'Failed',
- ArcanistUnitTestResult::RESULT_UNSOUND => 'Unsound',
- ArcanistUnitTestResult::RESULT_SKIP => 'Skipped',
- ArcanistUnitTestResult::RESULT_POSTPONED => 'Postponed',
- ArcanistUnitTestResult::RESULT_PASS => 'Passed',
+ ArcanistUnitTestResult::RESULT_BROKEN => pht('Broken'),
+ ArcanistUnitTestResult::RESULT_FAIL => pht('Failed'),
+ ArcanistUnitTestResult::RESULT_UNSOUND => pht('Unsound'),
+ ArcanistUnitTestResult::RESULT_SKIP => pht('Skipped'),
+ ArcanistUnitTestResult::RESULT_POSTPONED => pht('Postponed'),
+ ArcanistUnitTestResult::RESULT_PASS => pht('Passed'),
);
$show = array();
@@ -206,7 +206,9 @@
}
}
- return 'Show Full Unit Results ('.implode(', ', $show).')';
+ return pht(
+ 'Show Full Unit Results (%s)',
+ implode(', ', $show));
}
public function getWarningsForDetailView() {
diff --git a/src/applications/differential/editor/DifferentialTransactionEditor.php b/src/applications/differential/editor/DifferentialTransactionEditor.php
--- a/src/applications/differential/editor/DifferentialTransactionEditor.php
+++ b/src/applications/differential/editor/DifferentialTransactionEditor.php
@@ -931,8 +931,7 @@
case DifferentialAction::ACTION_REJECT:
if ($actor_is_author) {
- return pht(
- 'You can not request changes to your own revision.');
+ return pht('You can not request changes to your own revision.');
}
if ($revision_status == $status_abandoned) {
@@ -1507,13 +1506,14 @@
$nested_comments = $this->nestCommentHistory(
$inline->getComment(), $comments_by_line_number, $authors_by_phid);
- $section->addFragment('================')
- ->addFragment('Comment at: '.$file.':'.$range)
- ->addPlaintextFragment($patch)
- ->addHTMLFragment($this->renderPatchHTMLForMail($patch))
- ->addFragment('----------------')
- ->addFragment($nested_comments)
- ->addFragment(null);
+ $section
+ ->addFragment('================')
+ ->addFragment('Comment at: '.$file.':'.$range)
+ ->addPlaintextFragment($patch)
+ ->addHTMLFragment($this->renderPatchHTMLForMail($patch))
+ ->addFragment('----------------')
+ ->addFragment($nested_comments)
+ ->addFragment(null);
}
}
}
@@ -1592,8 +1592,7 @@
->executeOne();
if (!$revision) {
throw new Exception(
- pht(
- 'Failed to load revision for Herald adapter construction!'));
+ pht('Failed to load revision for Herald adapter construction!'));
}
$adapter = HeraldDifferentialRevisionAdapter::newLegacyAdapter(
diff --git a/src/applications/differential/landing/DifferentialGitHubLandingStrategy.php b/src/applications/differential/landing/DifferentialGitHubLandingStrategy.php
--- a/src/applications/differential/landing/DifferentialGitHubLandingStrategy.php
+++ b/src/applications/differential/landing/DifferentialGitHubLandingStrategy.php
@@ -20,7 +20,7 @@
id(new DifferentialHostedGitLandingStrategy())
->commitRevisionToWorkspace($revision, $workspace, $viewer);
} catch (Exception $e) {
- throw new PhutilProxyException('Failed to commit patch', $e);
+ throw new PhutilProxyException(pht('Failed to commit patch.'), $e);
}
try {
@@ -33,7 +33,9 @@
}
// Else, throw what git said.
- throw new PhutilProxyException('Failed to push changes upstream', $e);
+ throw new PhutilProxyException(
+ pht('Failed to push changes upstream.'),
+ $e);
}
}
@@ -103,13 +105,14 @@
if (!$this->account) {
throw new Exception(
- "No matching GitHub account found for {$repo_domain}.");
+ pht('No matching GitHub account found for %s.', $repo_domain));
}
$this->provider = PhabricatorAuthProvider::getEnabledProviderByKey(
$this->account->getProviderKey());
if (!$this->provider) {
- throw new Exception("GitHub provider for {$repo_domain} is not enabled.");
+ throw new Exception(
+ pht('GitHub provider for %s is not enabled.', $repo_domain));
}
}
@@ -152,8 +155,9 @@
if ($no_permission) {
throw new Exception(
- "You don't have permission to push to this repository. \n".
- "Push permissions for this repository are managed on GitHub.");
+ pht(
+ "You don't have permission to push to this repository. ".
+ "Push permissions for this repository are managed on GitHub."));
}
$scopes = BaseHTTPFuture::getHeader($headers, 'X-OAuth-Scopes');
@@ -166,8 +170,8 @@
->setUser($viewer)
->setTitle(pht('Stronger token needed'))
->appendChild(pht(
- 'In order to complete this action, you need a '.
- 'stronger GitHub token.'))
+ 'In order to complete this action, you need a '.
+ 'stronger GitHub token.'))
->setSubmitURI($refresh_token_uri)
->addCancelButton('/D'.$revision->getId())
->setDisableWorkflowOnSubmit(true)
diff --git a/src/applications/differential/landing/DifferentialHostedGitLandingStrategy.php b/src/applications/differential/landing/DifferentialHostedGitLandingStrategy.php
--- a/src/applications/differential/landing/DifferentialHostedGitLandingStrategy.php
+++ b/src/applications/differential/landing/DifferentialHostedGitLandingStrategy.php
@@ -14,13 +14,17 @@
try {
$this->commitRevisionToWorkspace($revision, $workspace, $viewer);
} catch (Exception $e) {
- throw new PhutilProxyException('Failed to commit patch', $e);
+ throw new PhutilProxyException(
+ pht('Failed to commit patch.'),
+ $e);
}
try {
$this->pushWorkspaceRepository($repository, $workspace, $viewer);
} catch (Exception $e) {
- throw new PhutilProxyException('Failed to push changes upstream', $e);
+ throw new PhutilProxyException(
+ pht('Failed to push changes upstream.'),
+ $e);
}
}
@@ -45,7 +49,7 @@
."0000000000000000000000000000000000000000.."
."0000000000000000000000000000000000000000\n";
if (strpos($raw_diff, $missing_binary) !== false) {
- throw new Exception('Patch is missing content for a binary file');
+ throw new Exception(pht('Patch is missing content for a binary file'));
}
$future = $workspace->execFutureLocal('apply --index -');
diff --git a/src/applications/differential/landing/DifferentialHostedMercurialLandingStrategy.php b/src/applications/differential/landing/DifferentialHostedMercurialLandingStrategy.php
--- a/src/applications/differential/landing/DifferentialHostedMercurialLandingStrategy.php
+++ b/src/applications/differential/landing/DifferentialHostedMercurialLandingStrategy.php
@@ -15,13 +15,15 @@
try {
$this->commitRevisionToWorkspace($revision, $workspace, $viewer);
} catch (Exception $e) {
- throw new PhutilProxyException('Failed to commit patch', $e);
+ throw new PhutilProxyException(pht('Failed to commit patch.'), $e);
}
try {
$this->pushWorkspaceRepository($repository, $workspace, $viewer);
} catch (Exception $e) {
- throw new PhutilProxyException('Failed to push changes upstream', $e);
+ throw new PhutilProxyException(
+ pht('Failed to push changes upstream.'),
+ $e);
}
}
diff --git a/src/applications/differential/landing/DifferentialLandingStrategy.php b/src/applications/differential/landing/DifferentialLandingStrategy.php
--- a/src/applications/differential/landing/DifferentialLandingStrategy.php
+++ b/src/applications/differential/landing/DifferentialLandingStrategy.php
@@ -64,7 +64,9 @@
try {
return DifferentialGetWorkingCopy::getCleanGitWorkspace($repository);
} catch (Exception $e) {
- throw new PhutilProxyException('Failed to allocate a workspace', $e);
+ throw new PhutilProxyException(
+ pht('Failed to allocate a workspace.'),
+ $e);
}
}
@@ -76,7 +78,9 @@
return DifferentialGetWorkingCopy::getCleanMercurialWorkspace(
$repository);
} catch (Exception $e) {
- throw new PhutilProxyException('Failed to allocate a workspace', $e);
+ throw new PhutilProxyException(
+ pht('Failed to allocate a workspace.'),
+ $e);
}
}
diff --git a/src/applications/differential/lipsum/PhabricatorDifferentialRevisionTestDataGenerator.php b/src/applications/differential/lipsum/PhabricatorDifferentialRevisionTestDataGenerator.php
--- a/src/applications/differential/lipsum/PhabricatorDifferentialRevisionTestDataGenerator.php
+++ b/src/applications/differential/lipsum/PhabricatorDifferentialRevisionTestDataGenerator.php
@@ -53,10 +53,10 @@
$diff = id(new PhabricatorDifferenceEngine())
->generateRawDiffFromFileContent($code, $newcode);
$call = new ConduitCall(
- 'differential.createrawdiff',
- array(
- 'diff' => $diff,
- ));
+ 'differential.createrawdiff',
+ array(
+ 'diff' => $diff,
+ ));
$call->setUser($author);
$result = $call->execute();
$thediff = id(new DifferentialDiff())->load(
diff --git a/src/applications/differential/mail/DifferentialCreateMailReceiver.php b/src/applications/differential/mail/DifferentialCreateMailReceiver.php
--- a/src/applications/differential/mail/DifferentialCreateMailReceiver.php
+++ b/src/applications/differential/mail/DifferentialCreateMailReceiver.php
@@ -3,8 +3,8 @@
final class DifferentialCreateMailReceiver extends PhabricatorMailReceiver {
public function isEnabled() {
- $app_class = 'PhabricatorDifferentialApplication';
- return PhabricatorApplication::isClassInstalled($app_class);
+ return PhabricatorApplication::isClassInstalled(
+ 'PhabricatorDifferentialApplication');
}
public function canAcceptMail(PhabricatorMetaMTAReceivedMail $mail) {
diff --git a/src/applications/differential/mail/DifferentialReplyHandler.php b/src/applications/differential/mail/DifferentialReplyHandler.php
--- a/src/applications/differential/mail/DifferentialReplyHandler.php
+++ b/src/applications/differential/mail/DifferentialReplyHandler.php
@@ -5,7 +5,7 @@
public function validateMailReceiver($mail_receiver) {
if (!($mail_receiver instanceof DifferentialRevision)) {
- throw new Exception('Receiver is not a DifferentialRevision!');
+ throw new Exception(pht('Receiver is not a %s!', 'DifferentialRevision'));
}
}
diff --git a/src/applications/differential/mail/DifferentialRevisionMailReceiver.php b/src/applications/differential/mail/DifferentialRevisionMailReceiver.php
--- a/src/applications/differential/mail/DifferentialRevisionMailReceiver.php
+++ b/src/applications/differential/mail/DifferentialRevisionMailReceiver.php
@@ -4,8 +4,8 @@
extends PhabricatorObjectMailReceiver {
public function isEnabled() {
- $app_class = 'PhabricatorDifferentialApplication';
- return PhabricatorApplication::isClassInstalled($app_class);
+ return PhabricatorApplication::isClassInstalled(
+ 'PhabricatorDifferentialApplication');
}
protected function getObjectPattern() {
diff --git a/src/applications/differential/parser/DifferentialChangesetParser.php b/src/applications/differential/parser/DifferentialChangesetParser.php
--- a/src/applications/differential/parser/DifferentialChangesetParser.php
+++ b/src/applications/differential/parser/DifferentialChangesetParser.php
@@ -1154,10 +1154,11 @@
*
* @return array($gaps, $mask, $depths)
*/
- private function calculateGapsMaskAndDepths($mask_force,
- $feedback_mask,
- $range_start,
- $range_len) {
+ private function calculateGapsMaskAndDepths(
+ $mask_force,
+ $feedback_mask,
+ $range_start,
+ $range_len) {
// Calculate gaps and mask first
$gaps = array();
@@ -1263,7 +1264,7 @@
PhabricatorInlineCommentInterface $comment) {
if (!$this->isCommentVisibleOnRenderedDiff($comment)) {
- throw new Exception('Comment is not visible on changeset!');
+ throw new Exception(pht('Comment is not visible on changeset!'));
}
$changeset_id = $comment->getChangesetID();
diff --git a/src/applications/differential/parser/DifferentialCommitMessageParser.php b/src/applications/differential/parser/DifferentialCommitMessageParser.php
--- a/src/applications/differential/parser/DifferentialCommitMessageParser.php
+++ b/src/applications/differential/parser/DifferentialCommitMessageParser.php
@@ -73,8 +73,10 @@
if (!$key_title || !$key_summary || ($label_map === null)) {
throw new Exception(
pht(
- 'Expected labelMap, summaryKey and titleKey to be set before '.
- 'parsing a corpus.'));
+ 'Expected %s, %s and %s to be set before parsing a corpus.',
+ 'labelMap',
+ 'summaryKey',
+ 'titleKey'));
}
$label_regexp = $this->buildLabelRegexp($label_map);
diff --git a/src/applications/differential/parser/DifferentialHunkParser.php b/src/applications/differential/parser/DifferentialHunkParser.php
--- a/src/applications/differential/parser/DifferentialHunkParser.php
+++ b/src/applications/differential/parser/DifferentialHunkParser.php
@@ -36,8 +36,9 @@
public function getVisibleLinesMask() {
if ($this->visibleLinesMask === null) {
throw new Exception(
- 'You must generateVisibileLinesMask before accessing this data.'
- );
+ pht(
+ 'You must %s before accessing this data.',
+ 'generateVisibileLinesMask'));
}
return $this->visibleLinesMask;
}
@@ -49,8 +50,9 @@
public function getIntraLineDiffs() {
if ($this->intraLineDiffs === null) {
throw new Exception(
- 'You must generateIntraLineDiffs before accessing this data.'
- );
+ pht(
+ 'You must %s before accessing this data.',
+ 'generateIntraLineDiffs'));
}
return $this->intraLineDiffs;
}
@@ -62,8 +64,9 @@
public function getNewLines() {
if ($this->newLines === null) {
throw new Exception(
- 'You must parseHunksForLineData before accessing this data.'
- );
+ pht(
+ 'You must %s before accessing this data.',
+ 'parseHunksForLineData'));
}
return $this->newLines;
}
@@ -75,8 +78,9 @@
public function getOldLines() {
if ($this->oldLines === null) {
throw new Exception(
- 'You must parseHunksForLineData before accessing this data.'
- );
+ pht(
+ 'You must %s before accessing this data.',
+ 'parseHunksForLineData'));
}
return $this->oldLines;
}
@@ -132,8 +136,9 @@
private function getWhitespaceMode() {
if ($this->whitespaceMode === null) {
throw new Exception(
- 'You must setWhitespaceMode before accessing this data.'
- );
+ pht(
+ 'You must %s before accessing this data.',
+ 'setWhitespaceMode'));
}
return $this->whitespaceMode;
}
@@ -173,7 +178,7 @@
private function getHasChanges($filter) {
if ($filter !== 'any' && $filter !== 'text') {
- throw new Exception("Unknown change filter '{$filter}'.");
+ throw new Exception(pht("Unknown change filter '%s'.", $filter));
}
$old = $this->getOldLines();
diff --git a/src/applications/differential/parser/__tests__/DifferentialCommitMessageParserTestCase.php b/src/applications/differential/parser/__tests__/DifferentialCommitMessageParserTestCase.php
--- a/src/applications/differential/parser/__tests__/DifferentialCommitMessageParserTestCase.php
+++ b/src/applications/differential/parser/__tests__/DifferentialCommitMessageParserTestCase.php
@@ -18,8 +18,9 @@
throw new Exception(
pht(
'Expected test file "%s" to contain four parts (message, fields, '.
- 'output, errors) divided by "~~~~~~~~~~".',
- $file));
+ 'output, errors) divided by "%s".',
+ $file,
+ '~~~~~~~~~~'));
}
list($message, $fields, $output, $errors) = $parts;
diff --git a/src/applications/differential/parser/__tests__/DifferentialHunkParserTestCase.php b/src/applications/differential/parser/__tests__/DifferentialHunkParserTestCase.php
--- a/src/applications/differential/parser/__tests__/DifferentialHunkParserTestCase.php
+++ b/src/applications/differential/parser/__tests__/DifferentialHunkParserTestCase.php
@@ -37,7 +37,7 @@
$parser = new ArcanistDiffParser();
$changes = $parser->parseDiff($data);
if (count($changes) !== 1) {
- throw new Exception("Expected 1 changeset for '{$name}'!");
+ throw new Exception(pht("Expected 1 changeset for '%s'!", $name));
}
$diff = DifferentialDiff::newFromRawChanges(
@@ -113,10 +113,10 @@
public function testInclusionOfNewFileInOldCommentFromStart() {
$parser = new DifferentialHunkParser();
$hunks = $this->createSingleChange(2, 3,
- "+n1\n".
- " e1/2\n".
- "-o2\n".
- "+n3\n");
+ "+n1\n".
+ " e1/2\n".
+ "-o2\n".
+ "+n3\n");
$context = $parser->makeContextDiff(
$hunks,
0,
@@ -124,18 +124,18 @@
1,
0);
$this->assertEqual(
- "@@ -1,2 +2,1 @@\n".
- " e1/2\n".
- "-o2", $context);
+ "@@ -1,2 +2,1 @@\n".
+ " e1/2\n".
+ "-o2", $context);
}
public function testInclusionOfOldFileInNewCommentFromStart() {
$parser = new DifferentialHunkParser();
$hunks = $this->createSingleChange(2, 2,
- "-o1\n".
- " e2/1\n".
- "-o3\n".
- "+n2\n");
+ "-o1\n".
+ " e2/1\n".
+ "-o3\n".
+ "+n2\n");
$context = $parser->makeContextDiff(
$hunks,
1,
@@ -143,16 +143,16 @@
1,
0);
$this->assertEqual(
- "@@ -2,1 +1,2 @@\n".
- " e2/1\n".
- "+n2", $context);
+ "@@ -2,1 +1,2 @@\n".
+ " e2/1\n".
+ "+n2", $context);
}
public function testNoNewlineAtEndOfFile() {
$parser = new DifferentialHunkParser();
$hunks = $this->createSingleChange(0, 1,
- "+a\n".
- "\\No newline at end of file");
+ "+a\n".
+ "\\No newline at end of file");
// Note that this only works with additional context.
$context = $parser->makeContextDiff(
$hunks,
@@ -161,23 +161,23 @@
0,
1);
$this->assertEqual(
- "@@ +1,1 @@\n".
- "+a\n".
- "\\No newline at end of file", $context);
+ "@@ +1,1 @@\n".
+ "+a\n".
+ "\\No newline at end of file", $context);
}
public function testMultiLineNewComment() {
$parser = new DifferentialHunkParser();
$hunks = $this->createSingleChange(7, 7,
- " e1\n".
- " e2\n".
- "-o3\n".
- "-o4\n".
- "+n3\n".
- " e5/4\n".
- " e6/5\n".
- "+n6\n".
- " e7\n");
+ " e1\n".
+ " e2\n".
+ "-o3\n".
+ "-o4\n".
+ "+n3\n".
+ " e5/4\n".
+ " e6/5\n".
+ "+n6\n".
+ " e7\n");
$context = $parser->makeContextDiff(
$hunks,
1,
@@ -185,28 +185,28 @@
4,
0);
$this->assertEqual(
- "@@ -2,5 +2,5 @@\n".
- " e2\n".
- "-o3\n".
- "-o4\n".
- "+n3\n".
- " e5/4\n".
- " e6/5\n".
- "+n6", $context);
+ "@@ -2,5 +2,5 @@\n".
+ " e2\n".
+ "-o3\n".
+ "-o4\n".
+ "+n3\n".
+ " e5/4\n".
+ " e6/5\n".
+ "+n6", $context);
}
public function testMultiLineOldComment() {
$parser = new DifferentialHunkParser();
$hunks = $this->createSingleChange(7, 7,
- " e1\n".
- " e2\n".
- "-o3\n".
- "-o4\n".
- "+n3\n".
- " e5/4\n".
- " e6/5\n".
- "+n6\n".
- " e7\n");
+ " e1\n".
+ " e2\n".
+ "-o3\n".
+ "-o4\n".
+ "+n3\n".
+ " e5/4\n".
+ " e6/5\n".
+ "+n6\n".
+ " e7\n");
$context = $parser->makeContextDiff(
$hunks,
0,
@@ -214,22 +214,22 @@
4,
0);
$this->assertEqual(
- "@@ -2,5 +2,4 @@\n".
- " e2\n".
- "-o3\n".
- "-o4\n".
- "+n3\n".
- " e5/4\n".
- " e6/5", $context);
+ "@@ -2,5 +2,4 @@\n".
+ " e2\n".
+ "-o3\n".
+ "-o4\n".
+ "+n3\n".
+ " e5/4\n".
+ " e6/5", $context);
}
public function testInclusionOfNewFileInOldCommentFromStartWithContext() {
$parser = new DifferentialHunkParser();
$hunks = $this->createSingleChange(2, 3,
- "+n1\n".
- " e1/2\n".
- "-o2\n".
- "+n3\n");
+ "+n1\n".
+ " e1/2\n".
+ "-o2\n".
+ "+n3\n");
$context = $parser->makeContextDiff(
$hunks,
0,
@@ -237,19 +237,19 @@
1,
1);
$this->assertEqual(
- "@@ -1,2 +1,2 @@\n".
- "+n1\n".
- " e1/2\n".
- "-o2", $context);
+ "@@ -1,2 +1,2 @@\n".
+ "+n1\n".
+ " e1/2\n".
+ "-o2", $context);
}
public function testInclusionOfOldFileInNewCommentFromStartWithContext() {
$parser = new DifferentialHunkParser();
$hunks = $this->createSingleChange(2, 2,
- "-o1\n".
- " e2/1\n".
- "-o3\n".
- "+n2\n");
+ "-o1\n".
+ " e2/1\n".
+ "-o3\n".
+ "+n2\n");
$context = $parser->makeContextDiff(
$hunks,
1,
@@ -257,11 +257,11 @@
1,
1);
$this->assertEqual(
- "@@ -1,3 +1,2 @@\n".
- "-o1\n".
- " e2/1\n".
- "-o3\n".
- "+n2", $context);
+ "@@ -1,3 +1,2 @@\n".
+ "-o1\n".
+ " e2/1\n".
+ "-o3\n".
+ "+n2", $context);
}
public function testMissingContext() {
diff --git a/src/applications/differential/query/DifferentialHunkQuery.php b/src/applications/differential/query/DifferentialHunkQuery.php
--- a/src/applications/differential/query/DifferentialHunkQuery.php
+++ b/src/applications/differential/query/DifferentialHunkQuery.php
@@ -95,7 +95,9 @@
if (!$this->changesets) {
throw new Exception(
- pht('You must load hunks via changesets, with withChangesets()!'));
+ pht(
+ 'You must load hunks via changesets, with %s!',
+ 'withChangesets()'));
}
$where[] = qsprintf(
diff --git a/src/applications/differential/query/DifferentialRevisionQuery.php b/src/applications/differential/query/DifferentialRevisionQuery.php
--- a/src/applications/differential/query/DifferentialRevisionQuery.php
+++ b/src/applications/differential/query/DifferentialRevisionQuery.php
@@ -841,7 +841,7 @@
break;
default:
throw new Exception(
- "Unknown revision status filter constant '{$this->status}'!");
+ pht("Unknown revision status filter constant '%s'!", $this->status));
}
$where[] = $this->buildWhereClauseParts($conn_r);
@@ -1056,7 +1056,7 @@
// The author can never have authority unless we allow self-accept.
$has_authority = false;
} else {
- // Otherwise, look up whether th viewer has authority.
+ // Otherwise, look up whether the viewer has authority.
$has_authority = isset($authority[$reviewer_phid]);
}
diff --git a/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php b/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php
--- a/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php
+++ b/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php
@@ -265,8 +265,7 @@
'This file was converted from %s for display.',
phutil_tag('strong', array(), $encoding));
} else {
- $messages[] = pht(
- 'This file uses an unknown character encoding.');
+ $messages[] = pht('This file uses an unknown character encoding.');
}
}
}
@@ -371,7 +370,11 @@
$force !== 'whitespace' &&
$force !== 'none' &&
$force !== 'default') {
- throw new Exception("Invalid 'force' parameter '{$force}'!");
+ throw new Exception(
+ pht(
+ "Invalid '%s' parameter '%s'!",
+ 'force',
+ $force));
}
$range = "0-{$end}";
@@ -497,7 +500,7 @@
if ($is_first_block) {
$text = pht('Show First %d Line(s)', $block_size);
} else {
- $text = pht("\xE2\x96\xB2 Show %d Line(s)", $block_size);
+ $text = "\xE2\x96\xB2 ".pht('Show %d Line(s)', $block_size);
}
$links[] = $this->renderShowContextLink(
@@ -516,7 +519,7 @@
if ($is_last_block) {
$text = pht('Show Last %d Line(s)', $block_size);
} else {
- $text = pht("\xE2\x96\xBC Show %d Line(s)", $block_size);
+ $text = "\xE2\x96\xBC ".pht('Show %d Line(s)', $block_size);
}
$links[] = $this->renderShowContextLink(
diff --git a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php
--- a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php
+++ b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php
@@ -299,10 +299,12 @@
return $this->wrapChangeInTable(phutil_implode_html('', $html));
}
- public function renderFileChange($old_file = null,
- $new_file = null,
- $id = 0,
- $vs = 0) {
+ public function renderFileChange(
+ $old_file = null,
+ $new_file = null,
+ $id = 0,
+ $vs = 0) {
+
$old = null;
if ($old_file) {
$old = $this->renderImageStage($old_file);
diff --git a/src/applications/differential/search/DifferentialSearchIndexer.php b/src/applications/differential/search/DifferentialSearchIndexer.php
--- a/src/applications/differential/search/DifferentialSearchIndexer.php
+++ b/src/applications/differential/search/DifferentialSearchIndexer.php
@@ -14,7 +14,7 @@
->needReviewerStatus(true)
->executeOne();
if (!$object) {
- throw new Exception("Unable to load object by phid '{$phid}'!");
+ throw new Exception(pht("Unable to load object by PHID '%s'!", $phid));
}
return $object;
}
diff --git a/src/applications/differential/storage/DifferentialReviewer.php b/src/applications/differential/storage/DifferentialReviewer.php
--- a/src/applications/differential/storage/DifferentialReviewer.php
+++ b/src/applications/differential/storage/DifferentialReviewer.php
@@ -41,7 +41,7 @@
$viewer_phid = $viewer->getPHID();
if (!array_key_exists($viewer_phid, $this->authority)) {
- throw new Exception('You must attachAuthority() first!');
+ throw new Exception(pht('You must %s first!', 'attachAuthority()'));
}
return $this->authority[$viewer_phid];
}
diff --git a/src/applications/differential/storage/DifferentialRevision.php b/src/applications/differential/storage/DifferentialRevision.php
--- a/src/applications/differential/storage/DifferentialRevision.php
+++ b/src/applications/differential/storage/DifferentialRevision.php
@@ -316,8 +316,7 @@
switch ($capability) {
case PhabricatorPolicyCapability::CAN_VIEW:
- $description[] = pht(
- "A revision's reviewers can always view it.");
+ $description[] = pht("A revision's reviewers can always view it.");
$description[] = pht(
'If a revision belongs to a repository, other users must be able '.
'to view the repository in order to view the revision.');
diff --git a/src/applications/differential/storage/DifferentialTransaction.php b/src/applications/differential/storage/DifferentialTransaction.php
--- a/src/applications/differential/storage/DifferentialTransaction.php
+++ b/src/applications/differential/storage/DifferentialTransaction.php
@@ -274,14 +274,11 @@
case self::TYPE_STATUS:
switch ($this->getNewValue()) {
case ArcanistDifferentialRevisionStatus::ACCEPTED:
- return pht(
- 'This revision is now accepted and ready to land.');
+ return pht('This revision is now accepted and ready to land.');
case ArcanistDifferentialRevisionStatus::NEEDS_REVISION:
- return pht(
- 'This revision now requires changes to proceed.');
+ return pht('This revision now requires changes to proceed.');
case ArcanistDifferentialRevisionStatus::NEEDS_REVIEW:
- return pht(
- 'This revision now requires review to proceed.');
+ return pht('This revision now requires review to proceed.');
}
}
@@ -595,11 +592,9 @@
'You can not commandeer this revision because you already own '.
'it.');
case DifferentialAction::ACTION_ACCEPT:
- return pht(
- 'You have already accepted this revision.');
+ return pht('You have already accepted this revision.');
case DifferentialAction::ACTION_REJECT:
- return pht(
- 'You have already requested changes to this revision.');
+ return pht('You have already requested changes to this revision.');
}
break;
}
diff --git a/src/applications/differential/view/DifferentialDiffTableOfContentsView.php b/src/applications/differential/view/DifferentialDiffTableOfContentsView.php
--- a/src/applications/differential/view/DifferentialDiffTableOfContentsView.php
+++ b/src/applications/differential/view/DifferentialDiffTableOfContentsView.php
@@ -137,9 +137,9 @@
($changeset->getOldProperties() === $changeset->getNewProperties())
? ''
: phutil_tag(
- 'span',
- array('title' => pht('Properties Changed')),
- 'M');
+ 'span',
+ array('title' => pht('Properties Changed')),
+ 'M');
$fname = $changeset->getFilename();
$cov = $this->renderCoverage($coverage, $fname);
@@ -246,8 +246,8 @@
false,
));
$anchor = id(new PhabricatorAnchorView())
- ->setAnchorName('toc')
- ->setNavigationMarker(true);
+ ->setAnchorName('toc')
+ ->setNavigationMarker(true);
return id(new PHUIObjectBoxView())
->setHeaderText(pht('Table of Contents'))
diff --git a/src/applications/differential/view/DifferentialLocalCommitsView.php b/src/applications/differential/view/DifferentialLocalCommitsView.php
--- a/src/applications/differential/view/DifferentialLocalCommitsView.php
+++ b/src/applications/differential/view/DifferentialLocalCommitsView.php
@@ -19,7 +19,11 @@
public function render() {
$user = $this->user;
if (!$user) {
- throw new Exception('Call setUser() before render()-ing this view.');
+ throw new Exception(
+ pht(
+ 'Call %s before %s-ing this view.',
+ 'setUser()',
+ __FUNCTION__.'()'));
}
$local = $this->localCommits;
diff --git a/src/applications/differential/view/DifferentialRevisionListView.php b/src/applications/differential/view/DifferentialRevisionListView.php
--- a/src/applications/differential/view/DifferentialRevisionListView.php
+++ b/src/applications/differential/view/DifferentialRevisionListView.php
@@ -57,10 +57,13 @@
}
public function render() {
-
$user = $this->user;
if (!$user) {
- throw new Exception('Call setUser() before render()!');
+ throw new Exception(
+ pht(
+ 'Call %s before %s!',
+ 'setUser()',
+ __FUNCTION__.'()'));
}
$fresh = PhabricatorEnv::getEnvConfig('differential.days-fresh');
diff --git a/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php b/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
--- a/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
+++ b/src/applications/differential/view/DifferentialRevisionUpdateHistoryView.php
@@ -365,7 +365,7 @@
case DifferentialLintStatus::LINT_POSTPONED:
return pht('Lint Postponed');
}
- return '???';
+ return pht('Unknown');
}
public static function getDiffUnitMessage(DifferentialDiff $diff) {
@@ -386,7 +386,7 @@
case DifferentialUnitStatus::UNIT_POSTPONED:
return pht('Unit Tests Postponed');
}
- return '???';
+ return pht('Unknown');
}
private static function renderDiffStar($star) {
diff --git a/src/applications/differential/view/DifferentialTransactionView.php b/src/applications/differential/view/DifferentialTransactionView.php
--- a/src/applications/differential/view/DifferentialTransactionView.php
+++ b/src/applications/differential/view/DifferentialTransactionView.php
@@ -104,7 +104,7 @@
$inlines[] = $xaction;
break;
default:
- throw new Exception('Unknown grouped transaction type!');
+ throw new Exception(pht('Unknown grouped transaction type!'));
}
}
diff --git a/src/applications/diffusion/DiffusionLintSaveRunner.php b/src/applications/diffusion/DiffusionLintSaveRunner.php
--- a/src/applications/diffusion/DiffusionLintSaveRunner.php
+++ b/src/applications/diffusion/DiffusionLintSaveRunner.php
@@ -62,7 +62,7 @@
$project = id(new PhabricatorRepositoryArcanistProject())
->loadOneWhere('name = %s', $project_id);
if (!$project || !$project->getRepositoryID()) {
- throw new Exception("Couldn't find repository for {$project_id}.");
+ throw new Exception(pht("Couldn't find repository for %s.", $project_id));
}
$branch_name = $api->getBranchName();
@@ -158,7 +158,7 @@
try {
$paths = phutil_json_decode($json);
} catch (PhutilJSONParserException $ex) {
- fprintf(STDERR, pht("Invalid JSON: %s\n", $json));
+ fprintf(STDERR, pht('Invalid JSON: %s', $json)."\n");
continue;
}
diff --git a/src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php
--- a/src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionBrowseQueryConduitAPIMethod.php
@@ -8,9 +8,9 @@
}
public function getMethodDescription() {
- return
+ return pht(
'File(s) information for a repository at an (optional) path and '.
- '(optional) commit.';
+ '(optional) commit.');
}
protected function defineReturnType() {
diff --git a/src/applications/diffusion/conduit/DiffusionCreateCommentConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionCreateCommentConduitAPIMethod.php
--- a/src/applications/diffusion/conduit/DiffusionCreateCommentConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionCreateCommentConduitAPIMethod.php
@@ -12,9 +12,15 @@
}
public function getMethodDescription() {
- return 'Add a comment to a Diffusion commit. By specifying an action of '.
- '"concern", "accept", "resign", or "close", auditing actions can '.
- 'be triggered. Defaults to "comment".';
+ return pht(
+ 'Add a comment to a Diffusion commit. By specifying an action '.
+ 'of "%s", "%s", "%s", or "%s", auditing actions can '.
+ 'be triggered. Defaults to "%s".',
+ 'concern',
+ 'accept',
+ 'resign',
+ 'close',
+ 'comment');
}
protected function defineParamTypes() {
@@ -32,9 +38,9 @@
protected function defineErrorTypes() {
return array(
- 'ERR_BAD_COMMIT' => 'No commit found with that PHID',
- 'ERR_BAD_ACTION' => 'Invalid action type',
- 'ERR_MISSING_MESSAGE' => 'Message is required',
+ 'ERR_BAD_COMMIT' => pht('No commit found with that PHID.'),
+ 'ERR_BAD_ACTION' => pht('Invalid action type.'),
+ 'ERR_MISSING_MESSAGE' => pht('Message is required.'),
);
}
diff --git a/src/applications/diffusion/conduit/DiffusionDiffQueryConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionDiffQueryConduitAPIMethod.php
--- a/src/applications/diffusion/conduit/DiffusionDiffQueryConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionDiffQueryConduitAPIMethod.php
@@ -10,9 +10,9 @@
}
public function getMethodDescription() {
- return
+ return pht(
'Get diff information from a repository for a specific path at an '.
- '(optional) commit.';
+ '(optional) commit.');
}
protected function defineReturnType() {
diff --git a/src/applications/diffusion/conduit/DiffusionExistsQueryConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionExistsQueryConduitAPIMethod.php
--- a/src/applications/diffusion/conduit/DiffusionExistsQueryConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionExistsQueryConduitAPIMethod.php
@@ -8,7 +8,7 @@
}
public function getMethodDescription() {
- return 'Determine if code exists in a version control system.';
+ return pht('Determine if code exists in a version control system.');
}
protected function defineReturnType() {
@@ -51,7 +51,7 @@
list($err, $stdout) = $repository->execLocalCommand(
'id --rev %s',
$commit);
- return !$err;
+ return !$err;
}
}
diff --git a/src/applications/diffusion/conduit/DiffusionFileContentQueryConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionFileContentQueryConduitAPIMethod.php
--- a/src/applications/diffusion/conduit/DiffusionFileContentQueryConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionFileContentQueryConduitAPIMethod.php
@@ -8,7 +8,7 @@
}
public function getMethodDescription() {
- return 'Retrieve file content from a repository.';
+ return pht('Retrieve file content from a repository.');
}
protected function defineReturnType() {
diff --git a/src/applications/diffusion/conduit/DiffusionGetCommitsConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionGetCommitsConduitAPIMethod.php
--- a/src/applications/diffusion/conduit/DiffusionGetCommitsConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionGetCommitsConduitAPIMethod.php
@@ -16,7 +16,7 @@
}
public function getMethodStatusDescription() {
- return pht('Obsoleted by diffusion.querycommits.');
+ return pht('Obsoleted by %s.', 'diffusion.querycommits');
}
protected function defineParamTypes() {
diff --git a/src/applications/diffusion/conduit/DiffusionGetLintMessagesConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionGetLintMessagesConduitAPIMethod.php
--- a/src/applications/diffusion/conduit/DiffusionGetLintMessagesConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionGetLintMessagesConduitAPIMethod.php
@@ -12,7 +12,7 @@
}
public function getMethodDescription() {
- return 'Get lint messages for existing code.';
+ return pht('Get lint messages for existing code.');
}
protected function defineParamTypes() {
diff --git a/src/applications/diffusion/conduit/DiffusionGetRecentCommitsByPathConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionGetRecentCommitsByPathConduitAPIMethod.php
--- a/src/applications/diffusion/conduit/DiffusionGetRecentCommitsByPathConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionGetRecentCommitsByPathConduitAPIMethod.php
@@ -10,7 +10,8 @@
}
public function getMethodDescription() {
- return 'Get commit identifiers for recent commits affecting a given path.';
+ return pht(
+ 'Get commit identifiers for recent commits affecting a given path.');
}
protected function defineParamTypes() {
diff --git a/src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php
--- a/src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php
@@ -10,8 +10,9 @@
}
public function getMethodDescription() {
- return 'Returns history information for a repository at a specific '.
- 'commit and path.';
+ return pht(
+ 'Returns history information for a repository at a specific '.
+ 'commit and path.');
}
protected function defineReturnType() {
diff --git a/src/applications/diffusion/conduit/DiffusionMergedCommitsQueryConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionMergedCommitsQueryConduitAPIMethod.php
--- a/src/applications/diffusion/conduit/DiffusionMergedCommitsQueryConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionMergedCommitsQueryConduitAPIMethod.php
@@ -8,8 +8,8 @@
}
public function getMethodDescription() {
- return
- 'Merged commit information for a specific commit in a repository.';
+ return pht(
+ 'Merged commit information for a specific commit in a repository.');
}
protected function defineReturnType() {
diff --git a/src/applications/diffusion/conduit/DiffusionQueryConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionQueryConduitAPIMethod.php
--- a/src/applications/diffusion/conduit/DiffusionQueryConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionQueryConduitAPIMethod.php
@@ -13,7 +13,7 @@
public function getMethodStatusDescription() {
return pht(
- 'See T2784 - migrating diffusion working copy calls to conduit methods. '.
+ 'See T2784 - migrating Diffusion working copy calls to conduit methods. '.
'Until that task is completed (and possibly after) these methods are '.
'unstable.');
}
diff --git a/src/applications/diffusion/conduit/DiffusionRawDiffQueryConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionRawDiffQueryConduitAPIMethod.php
--- a/src/applications/diffusion/conduit/DiffusionRawDiffQueryConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionRawDiffQueryConduitAPIMethod.php
@@ -8,9 +8,9 @@
}
public function getMethodDescription() {
- return
+ return pht(
'Get raw diff information from a repository for a specific commit at an '.
- '(optional) path.';
+ '(optional) path.');
}
protected function defineReturnType() {
diff --git a/src/applications/diffusion/conduit/DiffusionRefsQueryConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionRefsQueryConduitAPIMethod.php
--- a/src/applications/diffusion/conduit/DiffusionRefsQueryConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionRefsQueryConduitAPIMethod.php
@@ -8,8 +8,8 @@
}
public function getMethodDescription() {
- return
- 'Query a git repository for ref information at a specific commit.';
+ return pht(
+ 'Query a git repository for ref information at a specific commit.');
}
protected function defineReturnType() {
diff --git a/src/applications/diffusion/conduit/DiffusionSearchQueryConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionSearchQueryConduitAPIMethod.php
--- a/src/applications/diffusion/conduit/DiffusionSearchQueryConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionSearchQueryConduitAPIMethod.php
@@ -8,7 +8,7 @@
}
public function getMethodDescription() {
- return 'Search (grep) a repository at a specific path and commit.';
+ return pht('Search (grep) a repository at a specific path and commit.');
}
protected function defineReturnType() {
@@ -27,7 +27,7 @@
protected function defineCustomErrorTypes() {
return array(
- 'ERR-GREP-COMMAND' => 'Grep command failed.',
+ 'ERR-GREP-COMMAND' => pht('Grep command failed.'),
);
}
diff --git a/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php b/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php
--- a/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php
+++ b/src/applications/diffusion/config/PhabricatorDiffusionConfigOptions.php
@@ -35,9 +35,10 @@
pht('Attach Patches'),
pht('Do Not Attach Patches'),
))
- ->setDescription(pht(
- 'Set this to true if you want patches to be attached to commit '.
- 'notifications from Diffusion.')),
+ ->setDescription(
+ pht(
+ 'Set this to true if you want patches to be attached to commit '.
+ 'notifications from Diffusion.')),
$this->newOption('metamta.diffusion.inline-patches', 'int', 0)
->setSummary(pht('Include patches in Diffusion mail as body text.'))
->setDescription(
@@ -63,10 +64,11 @@
$this->newOption('bugtraq.url', 'string', null)
->addExample('https://bugs.php.net/%BUGID%', pht('PHP bugs'))
->addExample('/%BUGID%', pht('Local Maniphest URL'))
- ->setDescription(pht(
- 'URL of external bug tracker used by Diffusion. %s will be '.
+ ->setDescription(
+ pht(
+ 'URL of external bug tracker used by Diffusion. %s will be '.
'substituted by the bug ID.',
- '%BUGID%')),
+ '%BUGID%')),
$this->newOption('bugtraq.logregex', 'list<regex>', array())
->addExample(array('/\B#([1-9]\d*)\b/'), pht('Issue #123'))
->addExample(
@@ -74,8 +76,9 @@
pht('Issue #123, #456'))
->addExample(array('/(?<!#)\b(T[1-9]\d*)\b/'), pht('Task T123'))
->addExample('/[A-Z]{2,}-\d+/', pht('JIRA-1234'))
- ->setDescription(pht(
- 'Regular expression to link external bug tracker. See '.
+ ->setDescription(
+ pht(
+ 'Regular expression to link external bug tracker. See '.
'http://tortoisesvn.net/docs/release/TortoiseSVN_en/'.
'tsvn-dug-bugtracker.html for further explanation.')),
$this->newOption('diffusion.allow-http-auth', 'bool', false)
diff --git a/src/applications/diffusion/controller/DiffusionBrowseDirectoryController.php b/src/applications/diffusion/controller/DiffusionBrowseDirectoryController.php
--- a/src/applications/diffusion/controller/DiffusionBrowseDirectoryController.php
+++ b/src/applications/diffusion/controller/DiffusionBrowseDirectoryController.php
@@ -98,7 +98,9 @@
array(
'title' => array(
nonempty(basename($drequest->getPath()), '/'),
- $drequest->getRepository()->getCallsign().' Repository',
+ pht(
+ '%s Repository',
+ $drequest->getRepository()->getCallsign()),
),
));
}
diff --git a/src/applications/diffusion/controller/DiffusionBrowseFileController.php b/src/applications/diffusion/controller/DiffusionBrowseFileController.php
--- a/src/applications/diffusion/controller/DiffusionBrowseFileController.php
+++ b/src/applications/diffusion/controller/DiffusionBrowseFileController.php
@@ -124,13 +124,15 @@
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 @@
$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;
}
diff --git a/src/applications/diffusion/controller/DiffusionBrowseSearchController.php b/src/applications/diffusion/controller/DiffusionBrowseSearchController.php
--- a/src/applications/diffusion/controller/DiffusionBrowseSearchController.php
+++ b/src/applications/diffusion/controller/DiffusionBrowseSearchController.php
@@ -33,7 +33,9 @@
array(
'title' => array(
nonempty(basename($drequest->getPath()), '/'),
- $drequest->getRepository()->getCallsign().' Repository',
+ pht(
+ '%s Repository',
+ $drequest->getRepository()->getCallsign()),
),
));
}
diff --git a/src/applications/diffusion/controller/DiffusionCommitBranchesController.php b/src/applications/diffusion/controller/DiffusionCommitBranchesController.php
--- a/src/applications/diffusion/controller/DiffusionCommitBranchesController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitBranchesController.php
@@ -39,6 +39,6 @@
}
return id(new AphrontAjaxResponse())
- ->setContent($branch_links ? implode(', ', $branch_links) : 'None');
+ ->setContent($branch_links ? implode(', ', $branch_links) : pht('None'));
}
}
diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php
--- a/src/applications/diffusion/controller/DiffusionCommitController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitController.php
@@ -83,10 +83,12 @@
$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();
@@ -280,7 +282,7 @@
$vcs_supports_directory_changes = false;
break;
default:
- throw new Exception('Unknown VCS.');
+ throw new Exception(pht('Unknown VCS.'));
}
$references = array();
@@ -901,8 +903,8 @@
$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)));
}
diff --git a/src/applications/diffusion/controller/DiffusionCommitTagsController.php b/src/applications/diffusion/controller/DiffusionCommitTagsController.php
--- a/src/applications/diffusion/controller/DiffusionCommitTagsController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitTagsController.php
@@ -51,7 +51,7 @@
'action' => 'tags',
)),
),
- pht("More Tags\xE2\x80\xA6"));
+ pht('More Tags')."\xE2\x80\xA6");
}
return id(new AphrontAjaxResponse())
diff --git a/src/applications/diffusion/controller/DiffusionController.php b/src/applications/diffusion/controller/DiffusionController.php
--- a/src/applications/diffusion/controller/DiffusionController.php
+++ b/src/applications/diffusion/controller/DiffusionController.php
@@ -11,7 +11,7 @@
protected function getDiffusionRequest() {
if (!$this->diffusionRequest) {
- throw new Exception('No Diffusion request object!');
+ throw new Exception(pht('No Diffusion request object!'));
}
return $this->diffusionRequest;
}
diff --git a/src/applications/diffusion/controller/DiffusionExternalController.php b/src/applications/diffusion/controller/DiffusionExternalController.php
--- a/src/applications/diffusion/controller/DiffusionExternalController.php
+++ b/src/applications/diffusion/controller/DiffusionExternalController.php
@@ -75,9 +75,11 @@
->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()];
diff --git a/src/applications/diffusion/controller/DiffusionHistoryController.php b/src/applications/diffusion/controller/DiffusionHistoryController.php
--- a/src/applications/diffusion/controller/DiffusionHistoryController.php
+++ b/src/applications/diffusion/controller/DiffusionHistoryController.php
@@ -168,6 +168,4 @@
return $view;
}
-
-
}
diff --git a/src/applications/diffusion/controller/DiffusionInlineCommentController.php b/src/applications/diffusion/controller/DiffusionInlineCommentController.php
--- a/src/applications/diffusion/controller/DiffusionInlineCommentController.php
+++ b/src/applications/diffusion/controller/DiffusionInlineCommentController.php
@@ -33,7 +33,7 @@
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 @@
$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;
}
diff --git a/src/applications/diffusion/controller/DiffusionPathValidateController.php b/src/applications/diffusion/controller/DiffusionPathValidateController.php
--- a/src/applications/diffusion/controller/DiffusionPathValidateController.php
+++ b/src/applications/diffusion/controller/DiffusionPathValidateController.php
@@ -58,7 +58,7 @@
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');
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryController.php b/src/applications/diffusion/controller/DiffusionRepositoryController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryController.php
@@ -60,8 +60,7 @@
}
} 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 @@
$button->setTag('a');
$button->setIcon($icon);
$button->setHref($drequest->generateURI(
- array(
- 'action' => 'branches',
- )));
+ array(
+ 'action' => 'branches',
+ )));
$header->addActionLink($button);
$panel->setHeader($header);
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryCreateController.php b/src/applications/diffusion/controller/DiffusionRepositoryCreateController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryCreateController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryCreateController.php
@@ -483,7 +483,7 @@
$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 @@
"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');
@@ -734,8 +734,7 @@
->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);
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditActionsController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditActionsController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryEditActionsController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryEditActionsController.php
@@ -75,8 +75,7 @@
"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 ".
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryEditBasicController.php
@@ -152,19 +152,25 @@
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');
}
}
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditBranchesController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditBranchesController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryEditBranchesController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryEditBranchesController.php
@@ -126,20 +126,20 @@
'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 @@
$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 @@
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))
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryEditDeleteController.php
@@ -30,8 +30,9 @@
$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(
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditEncodingController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditEncodingController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryEditEncodingController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryEditEncodingController.php
@@ -104,8 +104,7 @@
Phabricator handles text encodings.
EOT
,
- PhabricatorEnv::getDoclink(
- 'User Guide: UTF-8 and Character Encoding'));
+ PhabricatorEnv::getDoclink('User Guide: UTF-8 and Character Encoding'));
}
}
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryEditMainController.php
@@ -811,8 +811,9 @@
->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)));
}
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditStorageController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditStorageController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryEditStorageController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryEditStorageController.php
@@ -57,10 +57,11 @@
->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')));
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryEditSubversionController.php b/src/applications/diffusion/controller/DiffusionRepositoryEditSubversionController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryEditSubversionController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryEditSubversionController.php
@@ -84,11 +84,11 @@
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')
diff --git a/src/applications/diffusion/controller/DiffusionRepositoryNewController.php b/src/applications/diffusion/controller/DiffusionRepositoryNewController.php
--- a/src/applications/diffusion/controller/DiffusionRepositoryNewController.php
+++ b/src/applications/diffusion/controller/DiffusionRepositoryNewController.php
@@ -53,11 +53,11 @@
'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'))
diff --git a/src/applications/diffusion/controller/DiffusionServeController.php b/src/applications/diffusion/controller/DiffusionServeController.php
--- a/src/applications/diffusion/controller/DiffusionServeController.php
+++ b/src/applications/diffusion/controller/DiffusionServeController.php
@@ -342,7 +342,11 @@
// 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 @@
$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);
diff --git a/src/applications/diffusion/data/DiffusionGitBranch.php b/src/applications/diffusion/data/DiffusionGitBranch.php
--- a/src/applications/diffusion/data/DiffusionGitBranch.php
+++ b/src/applications/diffusion/data/DiffusionGitBranch.php
@@ -42,7 +42,10 @@
continue;
}
if (!preg_match('/^ *(\S+)\s+([a-z0-9]{40})/', $line, $matches)) {
- throw new Exception("Failed to parse {$line}!");
+ throw new Exception(
+ pht(
+ 'Failed to parse %s!',
+ $line));
}
$remote_branch = $matches[1];
@@ -57,7 +60,9 @@
$matches = null;
if (!preg_match('#^([^/]+)/(.*)$#', $remote_branch, $matches)) {
throw new Exception(
- "Failed to parse remote branch '{$remote_branch}'!");
+ pht(
+ "Failed to parse remote branch '%s'!",
+ $remote_branch));
}
$remote_name = $matches[1];
$branch_name = $matches[2];
@@ -84,7 +89,10 @@
foreach ($lines as $line) {
$matches = null;
if (!preg_match($regex, $line, $matches)) {
- throw new Exception("Failed to parse {$line}!");
+ throw new Exception(
+ pht(
+ 'Failed to parse %s!',
+ $line));
}
$branch = $matches[1];
diff --git a/src/applications/diffusion/data/DiffusionRepositoryTag.php b/src/applications/diffusion/data/DiffusionRepositoryTag.php
--- a/src/applications/diffusion/data/DiffusionRepositoryTag.php
+++ b/src/applications/diffusion/data/DiffusionRepositoryTag.php
@@ -72,7 +72,7 @@
public function getMessage() {
if ($this->message === false) {
- throw new Exception('Message is not attached!');
+ throw new Exception(pht('Message is not attached!'));
}
return $this->message;
}
diff --git a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
--- a/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
+++ b/src/applications/diffusion/engine/DiffusionCommitHookEngine.php
@@ -697,7 +697,10 @@
private function findMercurialChangegroupRefUpdates() {
$hg_node = getenv('HG_NODE');
if (!$hg_node) {
- throw new Exception(pht('Expected HG_NODE in environment!'));
+ throw new Exception(
+ pht(
+ 'Expected %s in environment!',
+ 'HG_NODE'));
}
// NOTE: We need to make sure this is passed to subprocesses, or they won't
diff --git a/src/applications/diffusion/exception/DiffusionSetupException.php b/src/applications/diffusion/exception/DiffusionSetupException.php
--- a/src/applications/diffusion/exception/DiffusionSetupException.php
+++ b/src/applications/diffusion/exception/DiffusionSetupException.php
@@ -3,7 +3,7 @@
final class DiffusionSetupException extends AphrontUsageException {
public function __construct($message) {
- parent::__construct('Diffusion Setup Exception', $message);
+ parent::__construct(pht('Diffusion Setup Exception'), $message);
}
}
diff --git a/src/applications/diffusion/protocol/DiffusionMercurialWireProtocol.php b/src/applications/diffusion/protocol/DiffusionMercurialWireProtocol.php
--- a/src/applications/diffusion/protocol/DiffusionMercurialWireProtocol.php
+++ b/src/applications/diffusion/protocol/DiffusionMercurialWireProtocol.php
@@ -65,7 +65,7 @@
// on the side of caution and throw if we don't get any data here. This
// either indicates a mangled command from the client or a programming
// error in our code.
- throw new Exception("Expected nonempty 'cmds' specification!");
+ throw new Exception(pht("Expected nonempty '%s' specification!", 'cmds'));
}
// For "batch" we get a "cmds" argument like:
diff --git a/src/applications/diffusion/protocol/DiffusionSubversionWireProtocol.php b/src/applications/diffusion/protocol/DiffusionSubversionWireProtocol.php
--- a/src/applications/diffusion/protocol/DiffusionSubversionWireProtocol.php
+++ b/src/applications/diffusion/protocol/DiffusionSubversionWireProtocol.php
@@ -93,7 +93,7 @@
$this->state = 'item';
}
} else {
- throw new Exception("Invalid state '{$this->state}'!");
+ throw new Exception(pht("Invalid state '%s'!", $this->state));
}
}
@@ -124,7 +124,10 @@
$out[] = self::serializeStruct($value);
break;
default:
- throw new Exception("Unknown SVN wire protocol structure '{$type}'!");
+ throw new Exception(
+ pht(
+ "Unknown SVN wire protocol structure '%s'!",
+ $type));
}
if ($type != 'list') {
$out[] = ' ';
@@ -139,7 +142,9 @@
if (empty($struct[0]['type']) || ($struct[0]['type'] != 'word')) {
// This isn't what we expect; fail defensively.
throw new Exception(
- pht("Unexpected command structure, expected '( word ... )'."));
+ pht(
+ "Unexpected command structure, expected '%s'.",
+ '( word ... )'));
}
switch ($struct[0]['value']) {
diff --git a/src/applications/diffusion/query/DiffusionCommitQuery.php b/src/applications/diffusion/query/DiffusionCommitQuery.php
--- a/src/applications/diffusion/query/DiffusionCommitQuery.php
+++ b/src/applications/diffusion/query/DiffusionCommitQuery.php
@@ -144,7 +144,9 @@
public function getIdentifierMap() {
if ($this->identifierMap === null) {
throw new Exception(
- 'You must execute() the query before accessing the identifier map.');
+ pht(
+ 'You must %s the query before accessing the identifier map.',
+ 'execute()'));
}
return $this->identifierMap;
}
@@ -491,8 +493,10 @@
self::AUDIT_STATUS_PARTIAL,
);
throw new Exception(
- "Unknown audit status '{$status}'! Valid statuses are: ".
- implode(', ', $valid));
+ pht(
+ "Unknown audit status '%s'! Valid statuses are: %s.",
+ $status,
+ implode(', ', $valid)));
}
}
diff --git a/src/applications/diffusion/query/DiffusionLintCountQuery.php b/src/applications/diffusion/query/DiffusionLintCountQuery.php
--- a/src/applications/diffusion/query/DiffusionLintCountQuery.php
+++ b/src/applications/diffusion/query/DiffusionLintCountQuery.php
@@ -23,11 +23,19 @@
public function execute() {
if (!$this->paths) {
- throw new Exception(pht('Call withPaths() before execute()!'));
+ throw new Exception(
+ pht(
+ 'Call %s before %s!',
+ 'withPaths()',
+ __FUNCTION__.'()'));
}
if (!$this->branchIDs) {
- throw new Exception(pht('Call withBranchIDs() before execute()!'));
+ throw new Exception(
+ pht(
+ 'Call %s before %s!',
+ 'withBranchIDs()',
+ __FUNCTION__.'()'));
}
$conn_r = id(new PhabricatorRepositoryCommit())->establishConnection('r');
diff --git a/src/applications/diffusion/query/DiffusionQuery.php b/src/applications/diffusion/query/DiffusionQuery.php
--- a/src/applications/diffusion/query/DiffusionQuery.php
+++ b/src/applications/diffusion/query/DiffusionQuery.php
@@ -32,7 +32,7 @@
$name = idx($map, $repository->getVersionControlSystem());
if (!$name) {
- throw new Exception('Unsupported VCS!');
+ throw new Exception(pht('Unsupported VCS!'));
}
$class = str_replace('Diffusion', 'Diffusion'.$name, $base_class);
diff --git a/src/applications/diffusion/query/filecontent/DiffusionGitFileContentQuery.php b/src/applications/diffusion/query/filecontent/DiffusionGitFileContentQuery.php
--- a/src/applications/diffusion/query/filecontent/DiffusionGitFileContentQuery.php
+++ b/src/applications/diffusion/query/filecontent/DiffusionGitFileContentQuery.php
@@ -45,8 +45,10 @@
// 8220d5d54f6d5d5552a636576cbe9c35f15b65b2
// (Andrew Gallagher 2010-12-03 324)
// // Add the lines for trailing context
- preg_match('/^\s*?(\S+?)\s*\(\s*(.*?)\s+\d{4}-\d{2}-\d{2}\s+\d+\)(.*)?$/',
- $line, $m);
+ preg_match(
+ '/^\s*?(\S+?)\s*\(\s*(.*?)\s+\d{4}-\d{2}-\d{2}\s+\d+\)(.*)?$/',
+ $line,
+ $m);
$rev_id = $m[1];
$author = $m[2];
$text = idx($m, 3);
diff --git a/src/applications/diffusion/query/filecontent/DiffusionSvnFileContentQuery.php b/src/applications/diffusion/query/filecontent/DiffusionSvnFileContentQuery.php
--- a/src/applications/diffusion/query/filecontent/DiffusionSvnFileContentQuery.php
+++ b/src/applications/diffusion/query/filecontent/DiffusionSvnFileContentQuery.php
@@ -26,9 +26,10 @@
// nuked; Diffusion will think it still exists and try to grab content
// at HEAD.
throw new Exception(
- 'Failed to retrieve file content from Subversion. The file may '.
- 'have been recently deleted, or the Diffusion cache may be out of '.
- 'date.');
+ pht(
+ 'Failed to retrieve file content from Subversion. The file may '.
+ 'have been recently deleted, or the Diffusion cache may be out of '.
+ 'date.'));
} else {
throw $ex;
}
diff --git a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitQuery.php b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitQuery.php
--- a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitQuery.php
+++ b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelCommitQuery.php
@@ -18,7 +18,9 @@
protected function executeQuery() {
if (!strlen($this->identifier)) {
throw new Exception(
- pht('You must provide an identifier with withIdentifier()!'));
+ pht(
+ 'You must provide an identifier with %s!',
+ 'withIdentifier()'));
}
$type = $this->getRepository()->getVersionControlSystem();
diff --git a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelParentsQuery.php b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelParentsQuery.php
--- a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelParentsQuery.php
+++ b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelParentsQuery.php
@@ -13,7 +13,9 @@
protected function executeQuery() {
if (!strlen($this->identifier)) {
throw new Exception(
- pht('You must provide an identifier with withIdentifier()!'));
+ pht(
+ 'You must provide an identifier with %s!',
+ 'withIdentifier()'));
}
$type = $this->getRepository()->getVersionControlSystem();
diff --git a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelQuery.php b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelQuery.php
--- a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelQuery.php
+++ b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelQuery.php
@@ -17,7 +17,11 @@
public function execute() {
if (!$this->getRepository()) {
- throw new Exception('Call setRepository() before execute()!');
+ throw new Exception(
+ pht(
+ 'Call %s before %s!',
+ 'setRepository()',
+ __FUNCTION__.'()'));
}
return $this->executeQuery();
diff --git a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelResolveRefsQuery.php b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelResolveRefsQuery.php
--- a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelResolveRefsQuery.php
+++ b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelResolveRefsQuery.php
@@ -112,7 +112,10 @@
$lines = explode("\n", rtrim($stdout, "\n"));
if (count($lines) !== count($unresolved)) {
- throw new Exception('Unexpected line count from `git cat-file`!');
+ throw new Exception(
+ pht(
+ 'Unexpected line count from `%s`!',
+ 'git cat-file'));
}
$hits = array();
@@ -122,7 +125,11 @@
foreach ($lines as $ref => $line) {
$parts = explode(' ', $line);
if (count($parts) < 2) {
- throw new Exception("Failed to parse `git cat-file` output: {$line}");
+ throw new Exception(
+ pht(
+ 'Failed to parse `%s` output: %s',
+ 'git cat-file',
+ $line));
}
list($identifier, $type) = $parts;
@@ -143,7 +150,10 @@
break;
default:
throw new Exception(
- "Unexpected object type from `git cat-file`: {$line}");
+ pht(
+ 'Unexpected object type from `%s`: %s',
+ 'git cat-file',
+ $line));
}
$hits[] = array(
@@ -177,7 +187,10 @@
$alternate = $identifier;
$identifier = idx($tag_map, $ref);
if (!$identifier) {
- throw new Exception("Failed to look up tag '{$ref}'!");
+ throw new Exception(
+ pht(
+ "Failed to look up tag '%s'!",
+ $ref));
}
}
diff --git a/src/applications/diffusion/query/pathid/__tests__/DiffusionPathQueryTestCase.php b/src/applications/diffusion/query/pathid/__tests__/DiffusionPathQueryTestCase.php
--- a/src/applications/diffusion/query/pathid/__tests__/DiffusionPathQueryTestCase.php
+++ b/src/applications/diffusion/query/pathid/__tests__/DiffusionPathQueryTestCase.php
@@ -6,19 +6,19 @@
$this->assertEqual(
'/',
DiffusionPathIDQuery::getParentPath('/'),
- 'Parent of /');
+ pht('Parent of %s', '/'));
$this->assertEqual(
'/',
DiffusionPathIDQuery::getParentPath('x.txt'),
- 'Parent of x.txt');
+ pht('Parent of %s', 'x.txt'));
$this->assertEqual(
'/a',
DiffusionPathIDQuery::getParentPath('/a/b'),
- 'Parent of /a/b');
+ pht('Parent of %s', '/a/b'));
$this->assertEqual(
'/a',
DiffusionPathIDQuery::getParentPath('/a///b'),
- 'Parent of /a///b');
+ pht('Parent of %s', '/a///b'));
}
public function testExpandEdgeCases() {
diff --git a/src/applications/diffusion/request/DiffusionGitRequest.php b/src/applications/diffusion/request/DiffusionGitRequest.php
--- a/src/applications/diffusion/request/DiffusionGitRequest.php
+++ b/src/applications/diffusion/request/DiffusionGitRequest.php
@@ -17,7 +17,7 @@
if ($this->repository) {
return $this->repository->getDefaultBranch();
}
- throw new Exception('Unable to determine branch!');
+ throw new Exception(pht('Unable to determine branch!'));
}
}
diff --git a/src/applications/diffusion/request/DiffusionMercurialRequest.php b/src/applications/diffusion/request/DiffusionMercurialRequest.php
--- a/src/applications/diffusion/request/DiffusionMercurialRequest.php
+++ b/src/applications/diffusion/request/DiffusionMercurialRequest.php
@@ -19,7 +19,7 @@
return $this->repository->getDefaultBranch();
}
- throw new Exception('Unable to determine branch!');
+ throw new Exception(pht('Unable to determine branch!'));
}
}
diff --git a/src/applications/diffusion/request/DiffusionRequest.php b/src/applications/diffusion/request/DiffusionRequest.php
--- a/src/applications/diffusion/request/DiffusionRequest.php
+++ b/src/applications/diffusion/request/DiffusionRequest.php
@@ -175,7 +175,7 @@
$class = idx($map, $repository->getVersionControlSystem());
if (!$class) {
- throw new Exception('Unknown version control system!');
+ throw new Exception(pht('Unknown version control system!'));
}
$object = new $class();
@@ -208,7 +208,9 @@
$user = idx($data, 'user');
if (!$user) {
throw new Exception(
- 'You must provide a PhabricatorUser in the dictionary!');
+ pht(
+ 'You must provide a %s in the dictionary!',
+ 'PhabricatorUser'));
}
$this->setUser($user);
}
@@ -420,7 +422,7 @@
if (!$data) {
$data = new PhabricatorRepositoryCommitData();
$data->setCommitMessage(
- '(This commit has not been fully parsed yet.)');
+ pht('(This commit has not been fully parsed yet.)'));
}
$this->repositoryCommitData = $data;
}
@@ -544,12 +546,16 @@
if ($req_callsign && !strlen($callsign)) {
throw new Exception(
- "Diffusion URI action '{$action}' requires callsign!");
+ pht(
+ "Diffusion URI action '%s' requires callsign!",
+ $action));
}
if ($req_commit && !strlen($commit)) {
throw new Exception(
- "Diffusion URI action '{$action}' requires commit!");
+ pht(
+ "Diffusion URI action '%s' requires commit!",
+ $action));
}
switch ($action) {
@@ -587,7 +593,7 @@
$uri = "/r{$callsign}{$commit}";
break;
default:
- throw new Exception("Unknown Diffusion URI action '{$action}'!");
+ throw new Exception(pht("Unknown Diffusion URI action '%s'!", $action));
}
if ($action == 'rendering-ref') {
@@ -674,7 +680,7 @@
// Prevent any hyjinx since we're ultimately shipping this to the
// filesystem under a lot of workflows.
if ($part == '..') {
- throw new Exception('Invalid path URI.');
+ throw new Exception(pht('Invalid path URI.'));
}
}
@@ -700,21 +706,27 @@
$host = php_uname('n');
$callsign = $this->getRepository()->getCallsign();
throw new DiffusionSetupException(
- "The clone of this repository ('{$callsign}') on the local machine ".
- "('{$host}') could not be read. Ensure that the repository is in a ".
- "location where the web server has read permissions.");
+ pht(
+ "The clone of this repository ('%s') on the local machine ('%s') ".
+ "could not be read. Ensure that the repository is in a ".
+ "location where the web server has read permissions.",
+ $callsign,
+ $host));
}
protected function raiseCloneException() {
$host = php_uname('n');
$callsign = $this->getRepository()->getCallsign();
throw new DiffusionSetupException(
- "The working copy for this repository ('{$callsign}') hasn't been ".
- "cloned yet on this machine ('{$host}'). Make sure you've started the ".
- "Phabricator daemons. If this problem persists for longer than a clone ".
- "should take, check the daemon logs (in the Daemon Console) to see if ".
- "there were errors cloning the repository. Consult the 'Diffusion User ".
- "Guide' in the documentation for help setting up repositories.");
+ pht(
+ "The working copy for this repository ('%s') hasn't been cloned yet ".
+ "on this machine ('%s'). Make sure you've started the Phabricator ".
+ "daemons. If this problem persists for longer than a clone should ".
+ "take, check the daemon logs (in the Daemon Console) to see if there ".
+ "were errors cloning the repository. Consult the 'Diffusion User ".
+ "Guide' in the documentation for help setting up repositories.",
+ $callsign,
+ $host));
}
private function queryStableCommit() {
diff --git a/src/applications/diffusion/request/__tests__/DiffusionURITestCase.php b/src/applications/diffusion/request/__tests__/DiffusionURITestCase.php
--- a/src/applications/diffusion/request/__tests__/DiffusionURITestCase.php
+++ b/src/applications/diffusion/request/__tests__/DiffusionURITestCase.php
@@ -67,7 +67,7 @@
$this->assertEqual(
$expect,
$actual,
- "Parsing '{$input}'");
+ pht("Parsing '%s'", $input));
}
}
diff --git a/src/applications/diffusion/ssh/DiffusionMercurialServeSSHWorkflow.php b/src/applications/diffusion/ssh/DiffusionMercurialServeSSHWorkflow.php
--- a/src/applications/diffusion/ssh/DiffusionMercurialServeSSHWorkflow.php
+++ b/src/applications/diffusion/ssh/DiffusionMercurialServeSSHWorkflow.php
@@ -35,11 +35,11 @@
$args = $this->getArgs();
if (!$args->getArg('stdio')) {
- throw new Exception('Expected `hg ... --stdio`!');
+ throw new Exception(pht('Expected `%s`!', 'hg ... --stdio'));
}
if ($args->getArg('command') !== array('serve')) {
- throw new Exception('Expected `hg ... serve`!');
+ throw new Exception(pht('Expected `%s`!', 'hg ... serve'));
}
if ($this->shouldProxy()) {
diff --git a/src/applications/diffusion/ssh/DiffusionMercurialWireClientSSHProtocolChannel.php b/src/applications/diffusion/ssh/DiffusionMercurialWireClientSSHProtocolChannel.php
--- a/src/applications/diffusion/ssh/DiffusionMercurialWireClientSSHProtocolChannel.php
+++ b/src/applications/diffusion/ssh/DiffusionMercurialWireClientSSHProtocolChannel.php
@@ -207,7 +207,7 @@
break;
}
} else {
- throw new Exception("Bad parser state '{$this->state}'!");
+ throw new Exception(pht("Bad parser state '%s'!", $this->state));
}
}
diff --git a/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php b/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php
--- a/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php
+++ b/src/applications/diffusion/ssh/DiffusionSSHWorkflow.php
@@ -154,8 +154,7 @@
if (!preg_match($regex, $path, $matches)) {
throw new Exception(
pht(
- 'Unrecognized repository path "%s". Expected a path like '.
- '"%s".',
+ 'Unrecognized repository path "%s". Expected a path like "%s".',
$path,
'/diffusion/X/'));
}
diff --git a/src/applications/diffusion/ssh/DiffusionSubversionServeSSHWorkflow.php b/src/applications/diffusion/ssh/DiffusionSubversionServeSSHWorkflow.php
--- a/src/applications/diffusion/ssh/DiffusionSubversionServeSSHWorkflow.php
+++ b/src/applications/diffusion/ssh/DiffusionSubversionServeSSHWorkflow.php
@@ -83,7 +83,8 @@
if (!$exec_channel->isOpenForReading()) {
throw new Exception(
pht(
- 'svnserve subprocess exited before emitting a protocol frame.'));
+ '%s subprocess exited before emitting a protocol frame.',
+ 'svnserve'));
}
}
@@ -141,7 +142,7 @@
$args = $this->getArgs();
if (!$args->getArg('tunnel')) {
- throw new Exception('Expected `svnserve -t`!');
+ throw new Exception(pht('Expected `%s`!', 'svnserve -t'));
}
if ($this->shouldProxy()) {
@@ -350,8 +351,9 @@
if ($proto !== 'svn+ssh') {
throw new Exception(
pht(
- 'Protocol for URI "%s" MUST be "svn+ssh".',
- $uri_string));
+ 'Protocol for URI "%s" MUST be "%s".',
+ $uri_string,
+ 'svn+ssh'));
}
$path = $uri->getPath();
@@ -360,7 +362,8 @@
if (preg_match('(/\\.\\./)', $path)) {
throw new Exception(
pht(
- 'String "/../" is invalid in path specification "%s".',
+ 'String "%s" is invalid in path specification "%s".',
+ '/../',
$uri_string));
}
diff --git a/src/applications/diffusion/ssh/__tests__/DiffusionMercurialWireSSHTestCase.php b/src/applications/diffusion/ssh/__tests__/DiffusionMercurialWireSSHTestCase.php
--- a/src/applications/diffusion/ssh/__tests__/DiffusionMercurialWireSSHTestCase.php
+++ b/src/applications/diffusion/ssh/__tests__/DiffusionMercurialWireSSHTestCase.php
@@ -50,7 +50,7 @@
$this->assertTrue(
($caught instanceof Exception),
- "No extra messages for '{$file}'.");
+ pht("No extra messages for '%s'.", $file));
}
}
diff --git a/src/applications/diffusion/view/DiffusionEmptyResultView.php b/src/applications/diffusion/view/DiffusionEmptyResultView.php
--- a/src/applications/diffusion/view/DiffusionEmptyResultView.php
+++ b/src/applications/diffusion/view/DiffusionEmptyResultView.php
@@ -55,7 +55,7 @@
$title = pht('Path Was Deleted');
$body = pht(
'This path does not exist at %s. It was deleted in %s and last %s '.
- 'at %s.',
+ 'at %s.',
$commit,
self::linkCommit($drequest->getRepository(), $deleted),
$browse,
@@ -66,14 +66,15 @@
$subdir = $drequest->getRepository()->getDetail('svn-subpath');
$title = pht('Directory Not Tracked');
$body =
- pht("This repository is configured to track only one subdirectory ".
- "of the entire repository ('%s'), ".
- "but you aren't looking at something in that subdirectory, so no ".
- "information is available.", $subdir);
+ pht(
+ "This repository is configured to track only one subdirectory ".
+ "of the entire repository ('%s'), but you aren't looking at ".
+ "something in that subdirectory, so no information is available.",
+ $subdir);
$severity = PHUIInfoView::SEVERITY_WARNING;
break;
default:
- throw new Exception("Unknown failure reason: $reason");
+ throw new Exception(pht('Unknown failure reason: %s', $reason));
}
$error_view = new PHUIInfoView();
diff --git a/src/applications/diffusion/view/DiffusionView.php b/src/applications/diffusion/view/DiffusionView.php
--- a/src/applications/diffusion/view/DiffusionView.php
+++ b/src/applications/diffusion/view/DiffusionView.php
@@ -13,8 +13,11 @@
return $this->diffusionRequest;
}
- final public function linkChange($change_type, $file_type, $path = null,
- $commit_identifier = null) {
+ final public function linkChange(
+ $change_type,
+ $file_type,
+ $path = null,
+ $commit_identifier = null) {
$text = DifferentialChangeType::getFullNameForChangeType($change_type);
if ($change_type == DifferentialChangeType::TYPE_CHILD) {
diff --git a/src/applications/diviner/atom/DivinerAtom.php b/src/applications/diviner/atom/DivinerAtom.php
--- a/src/applications/diviner/atom/DivinerAtom.php
+++ b/src/applications/diviner/atom/DivinerAtom.php
@@ -96,7 +96,10 @@
public function getDocblockText() {
if ($this->docblockText === null) {
throw new Exception(
- pht('Call %s before %s!', 'setDocblockRaw()', 'getDocblockText()'));
+ pht(
+ 'Call %s before %s!',
+ 'setDocblockRaw()',
+ __FUNCTION__.'()'));
}
return $this->docblockText;
}
@@ -104,7 +107,10 @@
public function getDocblockMeta() {
if ($this->docblockMeta === null) {
throw new Exception(
- pht('Call %s before %s!', 'setDocblockRaw()', 'getDocblockMeta()'));
+ pht(
+ 'Call %s before %s!',
+ 'setDocblockRaw()',
+ __FUNCTION__.'()'));
}
return $this->docblockMeta;
}
@@ -398,7 +404,7 @@
case self::TYPE_METHOD:
return pht('This method is not documented.');
default:
- phlog("Need translation for '{$type}'.");
+ phlog(pht("Need translation for '%s'.", $type));
return pht('This %s is not documented.', $type);
}
}
@@ -429,7 +435,7 @@
case self::TYPE_METHOD:
return pht('Method');
default:
- phlog("Need translation for '{$type}'.");
+ phlog(pht("Need translation for '%s'.", $type));
return ucwords($type);
}
}
diff --git a/src/applications/doorkeeper/view/DoorkeeperTagView.php b/src/applications/doorkeeper/view/DoorkeeperTagView.php
--- a/src/applications/doorkeeper/view/DoorkeeperTagView.php
+++ b/src/applications/doorkeeper/view/DoorkeeperTagView.php
@@ -12,7 +12,11 @@
public function render() {
$xobj = $this->xobj;
if (!$xobj) {
- throw new Exception('Call setExternalObject() before render()!');
+ throw new Exception(
+ pht(
+ 'Call %s before %s!',
+ 'setExternalObject()',
+ __FUNCTION__.'()'));
}
$tag_id = celerity_generate_unique_node_id();
diff --git a/src/applications/doorkeeper/worker/DoorkeeperAsanaFeedWorker.php b/src/applications/doorkeeper/worker/DoorkeeperAsanaFeedWorker.php
--- a/src/applications/doorkeeper/worker/DoorkeeperAsanaFeedWorker.php
+++ b/src/applications/doorkeeper/worker/DoorkeeperAsanaFeedWorker.php
@@ -65,7 +65,7 @@
$phid_aid_map = $this->lookupAsanaUserIDs($all_phids);
if (!$phid_aid_map) {
throw new PhabricatorWorkerPermanentFailureException(
- 'No related users have linked Asana accounts.');
+ pht('No related users have linked Asana accounts.'));
}
$owner_asana_id = idx($phid_aid_map, $owner_phid);
@@ -86,8 +86,9 @@
if (!$oauth_token) {
throw new PhabricatorWorkerPermanentFailureException(
- 'Unable to find any Asana user with valid credentials to '.
- 'pull an OAuth token out of.');
+ pht(
+ 'Unable to find any Asana user with valid credentials to '.
+ 'pull an OAuth token out of.'));
}
$etype_main = PhabricatorObjectHasAsanaTaskEdgeType::EDGECONST;
@@ -124,21 +125,23 @@
$parent_ref = head($refs);
if (!$parent_ref) {
throw new PhabricatorWorkerPermanentFailureException(
- 'DoorkeeperExternalObject could not be loaded.');
+ pht('%s could not be loaded.', 'DoorkeeperExternalObject'));
}
if ($parent_ref->getSyncFailed()) {
throw new Exception(
- 'Synchronization of parent task from Asana failed!');
+ pht('Synchronization of parent task from Asana failed!'));
} else if (!$parent_ref->getIsVisible()) {
- $this->log("Skipping main task update, object is no longer visible.\n");
+ $this->log(
+ "%s\n",
+ pht('Skipping main task update, object is no longer visible.'));
$extra_data['gone'] = true;
} else {
$edge_cursor = idx($main_edge['data'], 'cursor', 0);
// TODO: This probably breaks, very rarely, on 32-bit systems.
if ($edge_cursor <= $story->getChronologicalKey()) {
- $this->log("Updating main task.\n");
+ $this->log("%s\n", pht('Updating main task.'));
$task_id = $parent_ref->getObjectID();
$this->makeAsanaAPICall(
@@ -148,7 +151,8 @@
$main_data);
} else {
$this->log(
- "Skipping main task update, cursor is ahead of the story.\n");
+ "%s\n",
+ pht('Skipping main task update, cursor is ahead of the story.'));
}
}
} else {
@@ -240,8 +244,10 @@
if (!$parent_ref->getIsVisible()) {
throw new PhabricatorWorkerPermanentFailureException(
- 'DoorkeeperExternalObject has no visible object on the other side; '.
- 'this likely indicates the Asana task has been deleted.');
+ pht(
+ '%s has no visible object on the other side; this '.
+ 'likely indicates the Asana task has been deleted.',
+ 'DoorkeeperExternalObject'));
}
// Now, handle the subtasks.
@@ -264,7 +270,7 @@
foreach ($refs as $ref) {
if ($ref->getSyncFailed()) {
throw new Exception(
- 'Synchronization of child task from Asana failed!');
+ pht('Synchronization of child task from Asana failed!'));
}
if (!$ref->getIsVisible()) {
$ref->getExternalObject()->delete();
@@ -283,8 +289,10 @@
}
$this->log(
- "Removing subtask edge to %s, foreign object is not visible.\n",
- $sub_phid);
+ "%s\n",
+ pht(
+ 'Removing subtask edge to %s, foreign object is not visible.',
+ $sub_phid));
$sub_editor->removeEdge($src_phid, $etype_sub, $sub_phid);
unset($sub_edges[$sub_phid]);
}
@@ -448,7 +456,7 @@
$provider = PhabricatorAsanaAuthProvider::getAsanaProvider();
if (!$provider) {
throw new PhabricatorWorkerPermanentFailureException(
- 'No Asana provider configured.');
+ pht('No Asana provider configured.'));
}
$this->provider = $provider;
}
@@ -501,10 +509,12 @@
private function getSynchronizationWarning() {
return
- "\xE2\x9A\xA0 DO NOT EDIT THIS TASK \xE2\x9A\xA0\n".
- "\xE2\x98\xA0 Your changes will not be reflected in Phabricator.\n".
- "\xE2\x98\xA0 Your changes will be destroyed the next time state ".
- "is synchronized.";
+ "\xE2\x9A\xA0 ".pht('DO NOT EDIT THIS TASK')." \xE2\x9A\xA0\n".
+ "\xE2\x98\xA0 ".
+ pht('Your changes will not be reflected in Phabricator.')."\n".
+ "\xE2\x98\xA0 ".
+ pht(
+ 'Your changes will be destroyed the next time state is synchronized.');
}
private function lookupAsanaUserIDs($all_phids) {
diff --git a/src/applications/doorkeeper/worker/DoorkeeperFeedWorker.php b/src/applications/doorkeeper/worker/DoorkeeperFeedWorker.php
--- a/src/applications/doorkeeper/worker/DoorkeeperFeedWorker.php
+++ b/src/applications/doorkeeper/worker/DoorkeeperFeedWorker.php
@@ -158,21 +158,23 @@
*/
final protected function doWork() {
if (PhabricatorEnv::getEnvConfig('phabricator.silent')) {
- $this->log(pht('Phabricator is running in silent mode.'));
+ $this->log("%s\n", pht('Phabricator is running in silent mode.'));
return;
}
if (!$this->isEnabled()) {
- $this->log("Doorkeeper worker '%s' is not enabled.\n", get_class($this));
+ $this->log(
+ "%s\n",
+ pht("Doorkeeper worker '%s' is not enabled.", get_class($this)));
return;
}
$publisher = $this->loadPublisher();
if (!$publisher) {
- $this->log("Story is about an unsupported object type.\n");
+ $this->log("%s\n", pht('Story is about an unsupported object type.'));
return;
} else {
- $this->log("Using publisher '%s'.\n", get_class($publisher));
+ $this->log("%s\n", pht("Using publisher '%s'.", get_class($publisher)));
}
$this->publishFeedStory();
diff --git a/src/applications/doorkeeper/worker/DoorkeeperJIRAFeedWorker.php b/src/applications/doorkeeper/worker/DoorkeeperJIRAFeedWorker.php
--- a/src/applications/doorkeeper/worker/DoorkeeperJIRAFeedWorker.php
+++ b/src/applications/doorkeeper/worker/DoorkeeperJIRAFeedWorker.php
@@ -34,7 +34,9 @@
$object->getPHID(),
PhabricatorJiraIssueHasObjectEdgeType::EDGECONST);
if (!$jira_issue_phids) {
- $this->log("Story is about an object with no linked JIRA issues.\n");
+ $this->log(
+ "%s\n",
+ pht('Story is about an object with no linked JIRA issues.'));
return;
}
@@ -44,13 +46,17 @@
->execute();
if (!$xobjs) {
- $this->log("Story object has no corresponding external JIRA objects.\n");
+ $this->log(
+ "%s\n",
+ pht('Story object has no corresponding external JIRA objects.'));
return;
}
$try_users = $this->findUsersToPossess();
if (!$try_users) {
- $this->log("No users to act on linked JIRA objects.\n");
+ $this->log(
+ "%s\n",
+ pht('No users to act on linked JIRA objects.'));
return;
}
@@ -89,9 +95,11 @@
} catch (HTTPFutureResponseStatus $ex) {
phlog($ex);
$this->log(
- "Failed to update object %s using user %s.\n",
- $xobj->getObjectID(),
- $account->getUserPHID());
+ "%s\n",
+ pht(
+ 'Failed to update object %s using user %s.',
+ $xobj->getObjectID(),
+ $account->getUserPHID()));
}
}
}
@@ -113,7 +121,7 @@
$provider = PhabricatorJIRAAuthProvider::getJIRAProvider();
if (!$provider) {
throw new PhabricatorWorkerPermanentFailureException(
- 'No JIRA provider configured.');
+ pht('No JIRA provider configured.'));
}
$this->provider = $provider;
}
diff --git a/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
--- a/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
+++ b/src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
@@ -36,7 +36,7 @@
$lease = idx($query, $lease_id);
if (!$lease) {
- throw new Exception("No such lease '{$lease_id}'!");
+ throw new Exception(pht("No such lease '%d'!", $lease_id));
}
return $lease;
@@ -45,7 +45,7 @@
protected function getInstance() {
if (!$this->instance) {
throw new Exception(
- 'Attach the blueprint instance to the implementation.');
+ pht('Attach the blueprint instance to the implementation.'));
}
return $this->instance;
@@ -158,7 +158,7 @@
$this->log('Allocated Lease');
} else {
$resource->killTransaction();
- $this->log('Failed to Allocate Lease');
+ $this->log(pht('Failed to Allocate Lease'));
}
if ($allocation_exception) {
@@ -287,7 +287,7 @@
$lease->saveTransaction();
if (!$released) {
- throw new Exception('Unable to release lease: lease not active!');
+ throw new Exception(pht('Unable to release lease: lease not active!'));
}
}
@@ -428,9 +428,12 @@
if (!($resource instanceof DrydockResource)) {
throw new Exception(
- "Blueprint '{$blueprint}' is not properly implemented: ".
- "executeAllocateResource() must return an object of type ".
- "DrydockResource or throw, but returned something else.");
+ pht(
+ "Blueprint '%s' is not properly implemented: %s must return an ".
+ "object of type %s or throw, but returned something else.",
+ $blueprint,
+ 'executeAllocateResource()',
+ 'DrydockResource'));
}
$current_status = $resource->getStatus();
@@ -439,10 +442,14 @@
$current_name = DrydockResourceStatus::getNameForStatus($current_status);
$req_name = DrydockResourceStatus::getNameForStatus($req_status);
throw new Exception(
- "Blueprint '{$blueprint}' is not properly implemented: ".
- "executeAllocateResource() must return a DrydockResource with ".
- "status '{$req_name}', but returned one with status ".
- "'{$current_name}'.");
+ pht(
+ "Blueprint '%s' is not properly implemented: %s must return a %s ".
+ "with status '%s', but returned one with status '%s'.",
+ $blueprint,
+ 'executeAllocateResource()',
+ 'DrydockResource',
+ $req_name,
+ $current_name));
}
}
@@ -452,7 +459,7 @@
if (($this->activeResource !== null) ||
($this->activeLease !== null)) {
- throw new Exception('There is already an active resource or lease!');
+ throw new Exception(pht('There is already an active resource or lease!'));
}
$this->activeResource = $resource;
diff --git a/src/applications/drydock/blueprint/DrydockPreallocatedHostBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockPreallocatedHostBlueprintImplementation.php
--- a/src/applications/drydock/blueprint/DrydockPreallocatedHostBlueprintImplementation.php
+++ b/src/applications/drydock/blueprint/DrydockPreallocatedHostBlueprintImplementation.php
@@ -84,7 +84,9 @@
// inaccurate sanity checking since we can't safely escape the path.
if (preg_match('/^[A-Z]\\:\\\\[a-zA-Z0-9\\\\\\ ]/', $full_path) === 0) {
throw new Exception(
- 'Unsafe path detected for Windows platform: "'.$full_path.'".');
+ pht(
+ 'Unsafe path detected for Windows platform: "%s".',
+ $full_path));
}
$cmd->execx('mkdir %C', $full_path);
}
@@ -120,7 +122,7 @@
));
}
- throw new Exception("No interface of type '{$type}'.");
+ throw new Exception(pht("No interface of type '%s'.", $type));
}
}
diff --git a/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php b/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php
--- a/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php
+++ b/src/applications/drydock/blueprint/DrydockWorkingCopyBlueprintImplementation.php
@@ -37,7 +37,9 @@
$repository_id = $lease->getAttribute('repositoryID');
if (!$repository_id) {
throw new Exception(
- "Lease is missing required 'repositoryID' attribute.");
+ pht(
+ "Lease is missing required '%s' attribute.",
+ 'repositoryID'));
}
$repository = id(new PhabricatorRepositoryQuery())
@@ -47,14 +49,16 @@
if (!$repository) {
throw new Exception(
- "Repository '{$repository_id}' does not exist!");
+ pht(
+ "Repository '%s' does not exist!",
+ $repository_id));
}
switch ($repository->getVersionControlSystem()) {
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
break;
default:
- throw new Exception('Unsupported VCS!');
+ throw new Exception(pht('Unsupported VCS!'));
}
// TODO: Policy stuff here too.
@@ -108,7 +112,7 @@
->getInterface($type);
}
- throw new Exception("No interface of type '{$type}'.");
+ throw new Exception(pht("No interface of type '%s'.", $type));
}
}
diff --git a/src/applications/drydock/constants/DrydockResourceStatus.php b/src/applications/drydock/constants/DrydockResourceStatus.php
--- a/src/applications/drydock/constants/DrydockResourceStatus.php
+++ b/src/applications/drydock/constants/DrydockResourceStatus.php
@@ -17,7 +17,7 @@
self::STATUS_DESTROYED => pht('Destroyed'),
);
- return idx($map, $status, 'Unknown');
+ return idx($map, $status, pht('Unknown'));
}
public static function getAllStatuses() {
diff --git a/src/applications/drydock/controller/DrydockConsoleController.php b/src/applications/drydock/controller/DrydockConsoleController.php
--- a/src/applications/drydock/controller/DrydockConsoleController.php
+++ b/src/applications/drydock/controller/DrydockConsoleController.php
@@ -43,24 +43,19 @@
->setHeader(pht('Resources'))
->setHref($this->getApplicationURI('resource/'))
->addAttribute(
- pht(
- 'View and manage resources Drydock has built, like hosts.')));
+ pht('View and manage resources Drydock has built, like hosts.')));
$menu->addItem(
id(new PHUIObjectItemView())
->setHeader(pht('Leases'))
->setHref($this->getApplicationURI('lease/'))
- ->addAttribute(
- pht(
- 'Manage leases on resources.')));
+ ->addAttribute(pht('Manage leases on resources.')));
$menu->addItem(
id(new PHUIObjectItemView())
->setHeader(pht('Logs'))
->setHref($this->getApplicationURI('log/'))
- ->addAttribute(
- pht(
- 'View logs.')));
+ ->addAttribute(pht('View logs.')));
$crumbs = $this->buildApplicationCrumbs();
diff --git a/src/applications/drydock/controller/DrydockLeaseReleaseController.php b/src/applications/drydock/controller/DrydockLeaseReleaseController.php
--- a/src/applications/drydock/controller/DrydockLeaseReleaseController.php
+++ b/src/applications/drydock/controller/DrydockLeaseReleaseController.php
@@ -27,8 +27,11 @@
$dialog = id(new AphrontDialogView())
->setUser($user)
->setTitle(pht('Lease Not Active'))
- ->appendChild(phutil_tag('p', array(), pht(
- 'You can only release "active" leases.')))
+ ->appendChild(
+ phutil_tag(
+ 'p',
+ array(),
+ pht('You can only release "active" leases.')))
->addCancelButton($lease_uri);
return id(new AphrontDialogResponse())->setDialog($dialog);
@@ -38,10 +41,14 @@
$dialog = id(new AphrontDialogView())
->setUser($user)
->setTitle(pht('Really release lease?'))
- ->appendChild(phutil_tag('p', array(), pht(
- 'Releasing a lease may cause trouble for the lease holder and '.
- 'trigger cleanup of the underlying resource. It can not be '.
- 'undone. Continue?')))
+ ->appendChild(
+ phutil_tag(
+ 'p',
+ array(),
+ pht(
+ 'Releasing a lease may cause trouble for the lease holder and '.
+ 'trigger cleanup of the underlying resource. It can not be '.
+ 'undone. Continue?')))
->addSubmitButton(pht('Release Lease'))
->addCancelButton($lease_uri);
diff --git a/src/applications/drydock/interface/command/DrydockSSHCommandInterface.php b/src/applications/drydock/interface/command/DrydockSSHCommandInterface.php
--- a/src/applications/drydock/interface/command/DrydockSSHCommandInterface.php
+++ b/src/applications/drydock/interface/command/DrydockSSHCommandInterface.php
@@ -17,14 +17,15 @@
->executeOne();
if ($credential === null) {
- throw new Exception(pht(
- 'There is no credential with ID %d.',
- $this->getConfig('credential')));
+ throw new Exception(
+ pht(
+ 'There is no credential with ID %d.',
+ $this->getConfig('credential')));
}
if ($credential->getProvidesType() !==
PassphraseCredentialTypeSSHPrivateKey::PROVIDES_TYPE) {
- throw new Exception('Only private key credentials are supported.');
+ throw new Exception(pht('Only private key credentials are supported.'));
}
$this->passphraseSSHKey = PassphraseSSHKey::loadFromPHID(
diff --git a/src/applications/drydock/interface/filesystem/DrydockSFTPFilesystemInterface.php b/src/applications/drydock/interface/filesystem/DrydockSFTPFilesystemInterface.php
--- a/src/applications/drydock/interface/filesystem/DrydockSFTPFilesystemInterface.php
+++ b/src/applications/drydock/interface/filesystem/DrydockSFTPFilesystemInterface.php
@@ -17,7 +17,7 @@
if ($credential->getProvidesType() !==
PassphraseCredentialTypeSSHPrivateKey::PROVIDES_TYPE) {
- throw new Exception('Only private key credentials are supported.');
+ throw new Exception(pht('Only private key credentials are supported.'));
}
$this->passphraseSSHKey = PassphraseSSHKey::loadFromPHID(
diff --git a/src/applications/drydock/management/DrydockManagementCloseWorkflow.php b/src/applications/drydock/management/DrydockManagementCloseWorkflow.php
--- a/src/applications/drydock/management/DrydockManagementCloseWorkflow.php
+++ b/src/applications/drydock/management/DrydockManagementCloseWorkflow.php
@@ -6,7 +6,7 @@
protected function didConstruct() {
$this
->setName('close')
- ->setSynopsis('Close a resource.')
+ ->setSynopsis(pht('Close a resource.'))
->setArguments(
array(
array(
@@ -22,7 +22,7 @@
$ids = $args->getArg('ids');
if (!$ids) {
throw new PhutilArgumentUsageException(
- 'Specify one or more resource IDs to close.');
+ pht('Specify one or more resource IDs to close.'));
}
$viewer = $this->getViewer();
@@ -35,12 +35,12 @@
foreach ($ids as $id) {
$resource = idx($resources, $id);
if (!$resource) {
- $console->writeErr("Resource %d does not exist!\n", $id);
+ $console->writeErr("%s\n", pht('Resource %d does not exist!', $id));
} else if ($resource->getStatus() != DrydockResourceStatus::STATUS_OPEN) {
- $console->writeErr("Resource %d is not 'open'!\n", $id);
+ $console->writeErr("%s\n", pht("Resource %d is not 'open'!", $id));
} else {
$resource->closeResource();
- $console->writeErr("Closed resource %d.\n", $id);
+ $console->writeErr("%s\n", pht('Closed resource %d.', $id));
}
}
diff --git a/src/applications/drydock/management/DrydockManagementCreateResourceWorkflow.php b/src/applications/drydock/management/DrydockManagementCreateResourceWorkflow.php
--- a/src/applications/drydock/management/DrydockManagementCreateResourceWorkflow.php
+++ b/src/applications/drydock/management/DrydockManagementCreateResourceWorkflow.php
@@ -6,23 +6,23 @@
protected function didConstruct() {
$this
->setName('create-resource')
- ->setSynopsis('Create a resource manually.')
+ ->setSynopsis(pht('Create a resource manually.'))
->setArguments(
array(
array(
'name' => 'name',
'param' => 'resource_name',
- 'help' => 'Resource name.',
+ 'help' => pht('Resource name.'),
),
array(
'name' => 'blueprint',
'param' => 'blueprint_id',
- 'help' => 'Blueprint ID.',
+ 'help' => pht('Blueprint ID.'),
),
array(
'name' => 'attributes',
'param' => 'name=value,...',
- 'help' => 'Resource attributes.',
+ 'help' => pht('Resource attributes.'),
),
));
}
@@ -33,13 +33,17 @@
$resource_name = $args->getArg('name');
if (!$resource_name) {
throw new PhutilArgumentUsageException(
- 'Specify a resource name with `--name`.');
+ pht(
+ 'Specify a resource name with `%s`.',
+ '--name'));
}
$blueprint_id = $args->getArg('blueprint');
if (!$blueprint_id) {
throw new PhutilArgumentUsageException(
- 'Specify a blueprint ID with `--blueprint`.');
+ pht(
+ 'Specify a blueprint ID with `%s`.',
+ '--blueprint'));
}
$attributes = $args->getArg('attributes');
@@ -57,7 +61,7 @@
->executeOne();
if (!$blueprint) {
throw new PhutilArgumentUsageException(
- 'Specified blueprint does not exist.');
+ pht('Specified blueprint does not exist.'));
}
$resource = id(new DrydockResource())
@@ -70,7 +74,7 @@
}
$resource->save();
- $console->writeOut("Created Resource %s\n", $resource->getID());
+ $console->writeOut("%s\n", pht('Created Resource %s', $resource->getID()));
return 0;
}
diff --git a/src/applications/drydock/management/DrydockManagementLeaseWorkflow.php b/src/applications/drydock/management/DrydockManagementLeaseWorkflow.php
--- a/src/applications/drydock/management/DrydockManagementLeaseWorkflow.php
+++ b/src/applications/drydock/management/DrydockManagementLeaseWorkflow.php
@@ -6,18 +6,18 @@
protected function didConstruct() {
$this
->setName('lease')
- ->setSynopsis('Lease a resource.')
+ ->setSynopsis(pht('Lease a resource.'))
->setArguments(
array(
array(
'name' => 'type',
'param' => 'resource_type',
- 'help' => 'Resource type.',
+ 'help' => pht('Resource type.'),
),
array(
'name' => 'attributes',
'param' => 'name=value,...',
- 'help' => 'Resource specficiation.',
+ 'help' => pht('Resource specficiation.'),
),
));
}
@@ -28,7 +28,9 @@
$resource_type = $args->getArg('type');
if (!$resource_type) {
throw new PhutilArgumentUsageException(
- 'Specify a resource type with `--type`.');
+ pht(
+ 'Specify a resource type with `%s`.',
+ '--type'));
}
$attributes = $args->getArg('attributes');
@@ -49,7 +51,7 @@
->queueForActivation()
->waitUntilActive();
- $console->writeOut("Acquired Lease %s\n", $lease->getID());
+ $console->writeOut("%s\n", pht('Acquired Lease %s', $lease->getID()));
return 0;
}
diff --git a/src/applications/drydock/management/DrydockManagementReleaseWorkflow.php b/src/applications/drydock/management/DrydockManagementReleaseWorkflow.php
--- a/src/applications/drydock/management/DrydockManagementReleaseWorkflow.php
+++ b/src/applications/drydock/management/DrydockManagementReleaseWorkflow.php
@@ -6,7 +6,7 @@
protected function didConstruct() {
$this
->setName('release')
- ->setSynopsis('Release a lease.')
+ ->setSynopsis(pht('Release a lease.'))
->setArguments(
array(
array(
@@ -22,7 +22,7 @@
$ids = $args->getArg('ids');
if (!$ids) {
throw new PhutilArgumentUsageException(
- 'Specify one or more lease IDs to release.');
+ pht('Specify one or more lease IDs to release.'));
}
$viewer = $this->getViewer();
@@ -35,15 +35,15 @@
foreach ($ids as $id) {
$lease = idx($leases, $id);
if (!$lease) {
- $console->writeErr("Lease %d does not exist!\n", $id);
+ $console->writeErr("%s\n", pht('Lease %d does not exist!', $id));
} else if ($lease->getStatus() != DrydockLeaseStatus::STATUS_ACTIVE) {
- $console->writeErr("Lease %d is not 'active'!\n", $id);
+ $console->writeErr("%s\n", pht("Lease %d is not 'active'!", $id));
} else {
$resource = $lease->getResource();
$blueprint = $resource->getBlueprint();
$blueprint->releaseLease($resource, $lease);
- $console->writeErr("Released lease %d.\n", $id);
+ $console->writeErr("%s\n", pht('Released lease %d.', $id));
}
}
diff --git a/src/applications/drydock/storage/DrydockBlueprint.php b/src/applications/drydock/storage/DrydockBlueprint.php
--- a/src/applications/drydock/storage/DrydockBlueprint.php
+++ b/src/applications/drydock/storage/DrydockBlueprint.php
@@ -56,7 +56,9 @@
DrydockBlueprintImplementation::getAllBlueprintImplementations();
if (!isset($implementations[$class])) {
throw new Exception(
- "Invalid class name for blueprint (got '".$class."')");
+ pht(
+ "Invalid class name for blueprint (got '%s')",
+ $class));
}
return id(new $class())->attachInstance($this);
}
@@ -148,5 +150,4 @@
}
-
}
diff --git a/src/applications/drydock/storage/DrydockLease.php b/src/applications/drydock/storage/DrydockLease.php
--- a/src/applications/drydock/storage/DrydockLease.php
+++ b/src/applications/drydock/storage/DrydockLease.php
@@ -100,7 +100,7 @@
public function queueForActivation() {
if ($this->getID()) {
throw new Exception(
- 'Only new leases may be queued for activation!');
+ pht('Only new leases may be queued for activation!'));
}
$this->setStatus(DrydockLeaseStatus::STATUS_PENDING);
@@ -143,8 +143,9 @@
private function assertActive() {
if (!$this->isActive()) {
throw new Exception(
- 'Lease is not active! You can not interact with resources through '.
- 'an inactive lease.');
+ pht(
+ 'Lease is not active! You can not interact with resources through '.
+ 'an inactive lease.'));
}
}
@@ -164,16 +165,16 @@
unset($unresolved[$key]);
break;
case DrydockLeaseStatus::STATUS_RELEASED:
- throw new Exception('Lease has already been released!');
+ throw new Exception(pht('Lease has already been released!'));
case DrydockLeaseStatus::STATUS_EXPIRED:
- throw new Exception('Lease has already expired!');
+ throw new Exception(pht('Lease has already expired!'));
case DrydockLeaseStatus::STATUS_BROKEN:
- throw new Exception('Lease has been broken!');
+ throw new Exception(pht('Lease has been broken!'));
case DrydockLeaseStatus::STATUS_PENDING:
case DrydockLeaseStatus::STATUS_ACQUIRING:
break;
default:
- throw new Exception('Unknown status??');
+ throw new Exception(pht('Unknown status??'));
}
}
diff --git a/src/applications/drydock/worker/DrydockAllocatorWorker.php b/src/applications/drydock/worker/DrydockAllocatorWorker.php
--- a/src/applications/drydock/worker/DrydockAllocatorWorker.php
+++ b/src/applications/drydock/worker/DrydockAllocatorWorker.php
@@ -39,7 +39,7 @@
protected function doWork() {
$lease = $this->loadLease();
- $this->logToDrydock('Allocating Lease');
+ $this->logToDrydock(pht('Allocating Lease'));
try {
$this->allocateLease($lease);
@@ -147,8 +147,10 @@
$lease->save();
$this->logToDrydock(
- "There are no resources of type '{$type}' available, and no ".
- "blueprints which can allocate new ones.");
+ pht(
+ "There are no resources of type '%s' available, and no ".
+ "blueprints which can allocate new ones.",
+ $type));
return;
}
@@ -174,7 +176,7 @@
// and then switch them to "OPEN" only after the allocating lease gets
// its grubby mitts on the resource. This might make more sense but
// is a bit messy.
- throw new Exception('Lost an allocation race?');
+ throw new Exception(pht('Lost an allocation race?'));
}
}
diff --git a/src/applications/fact/controller/PhabricatorFactChartController.php b/src/applications/fact/controller/PhabricatorFactChartController.php
--- a/src/applications/fact/controller/PhabricatorFactChartController.php
+++ b/src/applications/fact/controller/PhabricatorFactChartController.php
@@ -32,7 +32,7 @@
if (!$points) {
// NOTE: Raphael crashes Safari if you hand it series with no points.
- throw new Exception('No data to show!');
+ throw new Exception(pht('No data to show!'));
}
// Limit amount of data passed to browser.
diff --git a/src/applications/fact/daemon/PhabricatorFactDaemon.php b/src/applications/fact/daemon/PhabricatorFactDaemon.php
--- a/src/applications/fact/daemon/PhabricatorFactDaemon.php
+++ b/src/applications/fact/daemon/PhabricatorFactDaemon.php
@@ -15,7 +15,7 @@
}
$this->processAggregates();
- $this->log('Zzz...');
+ $this->log(pht('Zzz...'));
$this->sleep(60 * 5);
}
}
@@ -35,7 +35,7 @@
}
public function processIteratorWithCursor($iterator_name, $iterator) {
- $this->log("Processing cursor '{$iterator_name}'.");
+ $this->log(pht("Processing cursor '%s'.", $iterator_name));
$cursor = id(new PhabricatorFactCursor())->loadOneWhere(
'name = %s',
@@ -73,7 +73,7 @@
$raw_facts = array();
foreach ($iterator as $key => $object) {
$phid = $object->getPHID();
- $this->log("Processing {$phid}...");
+ $this->log(pht('Processing %s...', $phid));
$raw_facts[$phid] = $this->computeRawFacts($object);
if (count($raw_facts) > self::RAW_FACT_BUFFER_LIMIT) {
$this->updateRawFacts($raw_facts);
@@ -91,7 +91,7 @@
}
public function processAggregates() {
- $this->log('Processing aggregates.');
+ $this->log(pht('Processing aggregates.'));
$facts = $this->computeAggregateFacts();
$this->updateAggregateFacts($facts);
diff --git a/src/applications/fact/engine/PhabricatorFactCountEngine.php b/src/applications/fact/engine/PhabricatorFactCountEngine.php
--- a/src/applications/fact/engine/PhabricatorFactCountEngine.php
+++ b/src/applications/fact/engine/PhabricatorFactCountEngine.php
@@ -10,9 +10,9 @@
foreach ($fact_types as $type) {
if (!strncmp($type, '+N:', 3)) {
if ($type == '+N:*') {
- $name = 'Total Objects';
+ $name = pht('Total Objects');
} else {
- $name = 'Total Objects of type '.substr($type, 3);
+ $name = pht('Total Objects of type %s', substr($type, 3));
}
$results[] = id(new PhabricatorFactSimpleSpec($type))
@@ -22,9 +22,9 @@
if (!strncmp($type, 'N:', 2)) {
if ($type == 'N:*') {
- $name = 'Objects';
+ $name = pht('Objects');
} else {
- $name = 'Objects of type '.substr($type, 2);
+ $name = pht('Objects of type %s', substr($type, 2));
}
$results[] = id(new PhabricatorFactSimpleSpec($type))
->setName($name)
diff --git a/src/applications/fact/engine/PhabricatorFactLastUpdatedEngine.php b/src/applications/fact/engine/PhabricatorFactLastUpdatedEngine.php
--- a/src/applications/fact/engine/PhabricatorFactLastUpdatedEngine.php
+++ b/src/applications/fact/engine/PhabricatorFactLastUpdatedEngine.php
@@ -10,7 +10,7 @@
foreach ($fact_types as $type) {
if ($type == 'updated') {
$results[] = id(new PhabricatorFactSimpleSpec($type))
- ->setName('Facts Last Updated')
+ ->setName(pht('Facts Last Updated'))
->setUnit(PhabricatorFactSimpleSpec::UNIT_EPOCH);
}
}
diff --git a/src/applications/fact/extract/PhabricatorFactUpdateIterator.php b/src/applications/fact/extract/PhabricatorFactUpdateIterator.php
--- a/src/applications/fact/extract/PhabricatorFactUpdateIterator.php
+++ b/src/applications/fact/extract/PhabricatorFactUpdateIterator.php
@@ -2,7 +2,7 @@
/**
* Iterate over objects by update time in a stable way. This iterator only works
- * for "normal" Lisk objects: objects with an autoincrement ID and a
+ * for "normal" Lisk objects: objects with an auto-increment ID and a
* dateModified column.
*/
final class PhabricatorFactUpdateIterator extends PhutilBufferedIterator {
diff --git a/src/applications/fact/management/PhabricatorFactManagementAnalyzeWorkflow.php b/src/applications/fact/management/PhabricatorFactManagementAnalyzeWorkflow.php
--- a/src/applications/fact/management/PhabricatorFactManagementAnalyzeWorkflow.php
+++ b/src/applications/fact/management/PhabricatorFactManagementAnalyzeWorkflow.php
@@ -13,15 +13,15 @@
'name' => 'iterator',
'param' => 'name',
'repeat' => true,
- 'help' => 'Process only iterator __name__.',
+ 'help' => pht('Process only iterator __name__.'),
),
array(
'name' => 'all',
- 'help' => 'Analyze from the beginning, ignoring cursors.',
+ 'help' => pht('Analyze from the beginning, ignoring cursors.'),
),
array(
'name' => 'skip-aggregates',
- 'help' => 'Skip analysis of aggreate facts.',
+ 'help' => pht('Skip analysis of aggregate facts.'),
),
));
}
diff --git a/src/applications/fact/management/PhabricatorFactManagementCursorsWorkflow.php b/src/applications/fact/management/PhabricatorFactManagementCursorsWorkflow.php
--- a/src/applications/fact/management/PhabricatorFactManagementCursorsWorkflow.php
+++ b/src/applications/fact/management/PhabricatorFactManagementCursorsWorkflow.php
@@ -16,7 +16,7 @@
'name' => 'reset',
'param' => 'cursor',
'repeat' => true,
- 'help' => 'Reset cursor __cursor__.',
+ 'help' => pht('Reset cursor __cursor__.'),
),
));
}
diff --git a/src/applications/fact/spec/PhabricatorFactSpec.php b/src/applications/fact/spec/PhabricatorFactSpec.php
--- a/src/applications/fact/spec/PhabricatorFactSpec.php
+++ b/src/applications/fact/spec/PhabricatorFactSpec.php
@@ -33,8 +33,9 @@
}
public function getName() {
- $type = $this->getType();
- return "Fact ({$type})";
+ return pht(
+ 'Fact (%s)',
+ $this->getType());
}
public function formatValueForDisplay(PhabricatorUser $user, $value) {
diff --git a/src/applications/feed/conduit/FeedPublishConduitAPIMethod.php b/src/applications/feed/conduit/FeedPublishConduitAPIMethod.php
--- a/src/applications/feed/conduit/FeedPublishConduitAPIMethod.php
+++ b/src/applications/feed/conduit/FeedPublishConduitAPIMethod.php
@@ -11,7 +11,7 @@
}
public function getMethodDescription() {
- return 'Publish a story to the feed.';
+ return pht('Publish a story to the feed.');
}
protected function defineParamTypes() {
diff --git a/src/applications/feed/conduit/FeedQueryConduitAPIMethod.php b/src/applications/feed/conduit/FeedQueryConduitAPIMethod.php
--- a/src/applications/feed/conduit/FeedQueryConduitAPIMethod.php
+++ b/src/applications/feed/conduit/FeedQueryConduitAPIMethod.php
@@ -11,7 +11,7 @@
}
public function getMethodDescription() {
- return 'Query the feed for stories';
+ return pht('Query the feed for stories');
}
private function getDefaultLimit() {
@@ -30,10 +30,10 @@
private function getSupportedViewTypes() {
return array(
- 'html' => 'Full HTML presentation of story',
- 'data' => 'Dictionary with various data of the story',
- 'html-summary' => 'Story contains only the title of the story',
- 'text' => 'Simple one-line plain text representation of story',
+ 'html' => pht('Full HTML presentation of story'),
+ 'data' => pht('Dictionary with various data of the story'),
+ 'html-summary' => pht('Story contains only the title of the story'),
+ 'text' => pht('Simple one-line plain text representation of story'),
);
}
@@ -44,7 +44,9 @@
return array(
'ERR-UNKNOWN-TYPE' =>
- 'Unsupported view type, possibles are: '.$view_types,
+ pht(
+ 'Unsupported view type, possibles are: %s',
+ $view_types),
);
}
diff --git a/src/applications/feed/query/PhabricatorFeedQuery.php b/src/applications/feed/query/PhabricatorFeedQuery.php
--- a/src/applications/feed/query/PhabricatorFeedQuery.php
+++ b/src/applications/feed/query/PhabricatorFeedQuery.php
@@ -67,7 +67,8 @@
$keys = $this->chronologicalKeys;
foreach ($keys as $key) {
if (!ctype_digit($key)) {
- throw new Exception("Key '{$key}' is not a valid chronological key!");
+ throw new Exception(
+ pht("Key '%s' is not a valid chronological key!", $key));
}
}
diff --git a/src/applications/feed/story/PhabricatorFeedStory.php b/src/applications/feed/story/PhabricatorFeedStory.php
--- a/src/applications/feed/story/PhabricatorFeedStory.php
+++ b/src/applications/feed/story/PhabricatorFeedStory.php
@@ -215,7 +215,7 @@
case PhabricatorApplicationTransaction::TARGET_TEXT:
break;
default:
- throw new Exception('Unknown rendering target: '.$target);
+ throw new Exception(pht('Unknown rendering target: %s', $target));
break;
}
}
@@ -229,7 +229,9 @@
$object = idx($this->objects, $phid);
if (!$object) {
throw new Exception(
- "Story is asking for an object it did not request ('{$phid}')!");
+ pht(
+ "Story is asking for an object it did not request ('%s')!",
+ $phid));
}
return $object;
}
@@ -237,7 +239,7 @@
public function getPrimaryObject() {
$phid = $this->getPrimaryObjectPHID();
if (!$phid) {
- throw new Exception('Story has no primary object!');
+ throw new Exception(pht('Story has no primary object!'));
}
return $this->getObject($phid);
}
@@ -308,7 +310,7 @@
$handle = new PhabricatorObjectHandle();
$handle->setPHID($phid);
- $handle->setName("Unloaded Object '{$phid}'");
+ $handle->setName(pht("Unloaded Object '%s'", $phid));
return $handle;
}
@@ -454,7 +456,7 @@
*/
public function getPolicy($capability) {
// If this story's primary object is a policy-aware object, use its policy
- // to control story visiblity.
+ // to control story visibility.
$primary_phid = $this->getPrimaryObjectPHID();
if (isset($this->objects[$primary_phid])) {
diff --git a/src/applications/feed/story/PhabricatorFeedStoryPhriction.php b/src/applications/feed/story/PhabricatorFeedStoryPhriction.php
--- a/src/applications/feed/story/PhabricatorFeedStoryPhriction.php
+++ b/src/applications/feed/story/PhabricatorFeedStoryPhriction.php
@@ -86,8 +86,12 @@
$action = $this->getValue('action');
$verb = PhrictionActionConstants::getActionPastTenseVerb($action);
- $text = "{$author_name} {$verb} the document".
- " {$document_title} {$document_uri}";
+ $text = pht(
+ '%s %s the document %s %s',
+ $author_name,
+ $verb,
+ $document_title,
+ $document_uri);
return $text;
}
diff --git a/src/applications/feed/worker/FeedPushWorker.php b/src/applications/feed/worker/FeedPushWorker.php
--- a/src/applications/feed/worker/FeedPushWorker.php
+++ b/src/applications/feed/worker/FeedPushWorker.php
@@ -13,7 +13,7 @@
if (!$story) {
throw new PhabricatorWorkerPermanentFailureException(
- 'Feed story does not exist.');
+ pht('Feed story does not exist.'));
}
return $story;
diff --git a/src/applications/files/application/PhabricatorFilesApplication.php b/src/applications/files/application/PhabricatorFilesApplication.php
--- a/src/applications/files/application/PhabricatorFilesApplication.php
+++ b/src/applications/files/application/PhabricatorFilesApplication.php
@@ -59,8 +59,7 @@
protected function getCustomCapabilities() {
return array(
FilesDefaultViewCapability::CAPABILITY => array(
- 'caption' => pht(
- 'Default view policy for newly created files.'),
+ 'caption' => pht('Default view policy for newly created files.'),
),
);
}
diff --git a/src/applications/files/conduit/FileConduitAPIMethod.php b/src/applications/files/conduit/FileConduitAPIMethod.php
--- a/src/applications/files/conduit/FileConduitAPIMethod.php
+++ b/src/applications/files/conduit/FileConduitAPIMethod.php
@@ -74,8 +74,7 @@
if ($chunk->getDataFilePHID()) {
throw new Exception(
- pht(
- 'Chunk has already been uploaded.'));
+ pht('Chunk has already been uploaded.'));
}
return $chunk;
diff --git a/src/applications/files/conduit/FileDownloadConduitAPIMethod.php b/src/applications/files/conduit/FileDownloadConduitAPIMethod.php
--- a/src/applications/files/conduit/FileDownloadConduitAPIMethod.php
+++ b/src/applications/files/conduit/FileDownloadConduitAPIMethod.php
@@ -7,7 +7,7 @@
}
public function getMethodDescription() {
- return 'Download a file from the server.';
+ return pht('Download a file from the server.');
}
protected function defineParamTypes() {
@@ -22,7 +22,7 @@
protected function defineErrorTypes() {
return array(
- 'ERR-BAD-PHID' => 'No such file exists.',
+ 'ERR-BAD-PHID' => pht('No such file exists.'),
);
}
diff --git a/src/applications/files/conduit/FileInfoConduitAPIMethod.php b/src/applications/files/conduit/FileInfoConduitAPIMethod.php
--- a/src/applications/files/conduit/FileInfoConduitAPIMethod.php
+++ b/src/applications/files/conduit/FileInfoConduitAPIMethod.php
@@ -7,7 +7,7 @@
}
public function getMethodDescription() {
- return 'Get information about a file.';
+ return pht('Get information about a file.');
}
protected function defineParamTypes() {
@@ -23,7 +23,7 @@
protected function defineErrorTypes() {
return array(
- 'ERR-NOT-FOUND' => 'No such file exists.',
+ 'ERR-NOT-FOUND' => pht('No such file exists.'),
);
}
diff --git a/src/applications/files/conduit/FileUploadConduitAPIMethod.php b/src/applications/files/conduit/FileUploadConduitAPIMethod.php
--- a/src/applications/files/conduit/FileUploadConduitAPIMethod.php
+++ b/src/applications/files/conduit/FileUploadConduitAPIMethod.php
@@ -7,7 +7,7 @@
}
public function getMethodDescription() {
- return 'Upload a file to the server.';
+ return pht('Upload a file to the server.');
}
protected function defineParamTypes() {
diff --git a/src/applications/files/conduit/FileUploadHashConduitAPIMethod.php b/src/applications/files/conduit/FileUploadHashConduitAPIMethod.php
--- a/src/applications/files/conduit/FileUploadHashConduitAPIMethod.php
+++ b/src/applications/files/conduit/FileUploadHashConduitAPIMethod.php
@@ -8,7 +8,7 @@
}
public function getMethodDescription() {
- return 'Upload a file to the server using content hash.';
+ return pht('Upload a file to the server using content hash.');
}
protected function defineParamTypes() {
diff --git a/src/applications/files/config/PhabricatorFilesConfigOptions.php b/src/applications/files/config/PhabricatorFilesConfigOptions.php
--- a/src/applications/files/config/PhabricatorFilesConfigOptions.php
+++ b/src/applications/files/config/PhabricatorFilesConfigOptions.php
@@ -101,35 +101,37 @@
pht('Configure which MIME types are viewable in the browser.'))
->setDescription(
pht(
- 'Configure which uploaded file types may be viewed directly '.
- 'in the browser. Other file types will be downloaded instead '.
- 'of displayed. This is mainly a usability consideration, since '.
- 'browsers tend to freak out when viewing enormous binary files.'.
+ "Configure which uploaded file types may be viewed directly ".
+ "in the browser. Other file types will be downloaded instead ".
+ "of displayed. This is mainly a usability consideration, since ".
+ "browsers tend to freak out when viewing enormous binary files.".
"\n\n".
- 'The keys in this map are vieweable MIME types; the values are '.
- 'the MIME types they are delivered as when they are viewed in '.
- 'the browser.')),
+ "The keys in this map are viewable MIME types; the values are ".
+ "the MIME types they are delivered as when they are viewed in ".
+ "the browser.")),
$this->newOption('files.image-mime-types', 'set', $image_default)
->setLocked(true)
->setSummary(pht('Configure which MIME types are images.'))
->setDescription(
pht(
- 'List of MIME types which can be used as the `src` for an '.
- '`<img />` tag.')),
+ 'List of MIME types which can be used as the `%s` for an `%s` tag.',
+ 'src',
+ '<img />')),
$this->newOption('files.audio-mime-types', 'set', $audio_default)
->setLocked(true)
->setSummary(pht('Configure which MIME types are audio.'))
->setDescription(
pht(
- 'List of MIME types which can be used to render an '.
- '`<audio />` tag.')),
+ 'List of MIME types which can be used to render an `%s` tag.',
+ '<audio />')),
$this->newOption('files.icon-mime-types', 'wild', $icon_default)
->setLocked(true)
->setSummary(pht('Configure which MIME types map to which icons.'))
->setDescription(
pht(
'Map of MIME type to icon name. MIME types which can not be '.
- 'found default to icon `doc_files`.')),
+ 'found default to icon `%s`.',
+ 'doc_files')),
$this->newOption('storage.mysql-engine.max-size', 'int', 1000000)
->setSummary(
pht(
@@ -161,15 +163,15 @@
'string',
null)
->setLocked(true)
- ->setLockedMessage(pht(
- 'This configuration is deprecated. See description for details.'))
+ ->setLockedMessage(
+ pht('This configuration is deprecated. See description for details.'))
->setSummary(pht('DEPRECATED - Allow uploaded files via email.'))
->setDescription(
pht(
- 'This config has been deprecated in favor of [[ '.
- '/applications/view/PhabricatorFilesApplication/ | '.
- 'application settings ]], which allow for multiple email '.
- 'addresses and other functionality.')),
+ 'This config has been deprecated in favor of [[%s | '.
+ 'application settings]], which allow for multiple email '.
+ 'addresses and other functionality.',
+ '/applications/view/PhabricatorFilesApplication/')),
$this->newOption(
'metamta.files.subject-prefix',
'string',
@@ -185,8 +187,9 @@
pht(
'This option will use Imagemagick to rescale images, so animated '.
'GIFs can be thumbnailed and set as profile pictures. Imagemagick '.
- 'must be installed and the "convert" binary must be available to '.
- 'the webserver for this to work.')),
+ 'must be installed and the "%s" binary must be available to '.
+ 'the webserver for this to work.',
+ 'convert')),
);
}
diff --git a/src/applications/files/controller/PhabricatorFileDataController.php b/src/applications/files/controller/PhabricatorFileDataController.php
--- a/src/applications/files/controller/PhabricatorFileDataController.php
+++ b/src/applications/files/controller/PhabricatorFileDataController.php
@@ -227,7 +227,11 @@
private function getFile() {
if (!$this->file) {
- throw new Exception(pht('Call loadFile() before getFile()!'));
+ throw new Exception(
+ pht(
+ 'Call %s before %s!',
+ 'loadFile()',
+ __FUNCTION__.'()'));
}
return $this->file;
}
diff --git a/src/applications/files/controller/PhabricatorFileDeleteController.php b/src/applications/files/controller/PhabricatorFileDeleteController.php
--- a/src/applications/files/controller/PhabricatorFileDeleteController.php
+++ b/src/applications/files/controller/PhabricatorFileDeleteController.php
@@ -37,11 +37,13 @@
$dialog = new AphrontDialogView();
$dialog->setUser($user);
- $dialog->setTitle('Really delete file?');
+ $dialog->setTitle(pht('Really delete file?'));
$dialog->appendChild(hsprintf(
- "<p>Permanently delete '%s'? This action can not be undone.</p>",
- $file->getName()));
- $dialog->addSubmitButton('Delete');
+ '<p>%s</p>',
+ pht(
+ "Permanently delete '%s'? This action can not be undone.",
+ $file->getName())));
+ $dialog->addSubmitButton(pht('Delete'));
$dialog->addCancelButton($file->getInfoURI());
return id(new AphrontDialogResponse())->setDialog($dialog);
diff --git a/src/applications/files/controller/PhabricatorFileTransformController.php b/src/applications/files/controller/PhabricatorFileTransformController.php
--- a/src/applications/files/controller/PhabricatorFileTransformController.php
+++ b/src/applications/files/controller/PhabricatorFileTransformController.php
@@ -125,7 +125,7 @@
$suffix = '.p100';
break;
default:
- throw new Exception('Unsupported transformation type!');
+ throw new Exception(pht('Unsupported transformation type!'));
}
$path = celerity_get_resource_uri(
diff --git a/src/applications/files/engine/PhabricatorLocalDiskFileStorageEngine.php b/src/applications/files/engine/PhabricatorLocalDiskFileStorageEngine.php
--- a/src/applications/files/engine/PhabricatorLocalDiskFileStorageEngine.php
+++ b/src/applications/files/engine/PhabricatorLocalDiskFileStorageEngine.php
@@ -102,8 +102,10 @@
if (!$root || $root == '/' || $root[0] != '/') {
throw new PhabricatorFileStorageConfigurationException(
- "Malformed local disk storage root. You must provide an absolute ".
- "path, and can not use '/' as the root.");
+ pht(
+ "Malformed local disk storage root. You must provide an absolute ".
+ "path, and can not use '%s' as the root.",
+ '/'));
}
return rtrim($root, '/');
@@ -123,7 +125,9 @@
// we're only accessing local storage just in case.
if (!preg_match('@^[a-f0-9]{2}/[a-f0-9]{2}/[a-f0-9]{28}\z@', $handle)) {
throw new Exception(
- "Local disk filesystem handle '{$handle}' is malformed!");
+ pht(
+ "Local disk filesystem handle '%s' is malformed!",
+ $handle));
}
$root = $this->getLocalDiskFileStorageRoot();
return $root.'/'.$handle;
diff --git a/src/applications/files/engine/PhabricatorMySQLFileStorageEngine.php b/src/applications/files/engine/PhabricatorMySQLFileStorageEngine.php
--- a/src/applications/files/engine/PhabricatorMySQLFileStorageEngine.php
+++ b/src/applications/files/engine/PhabricatorMySQLFileStorageEngine.php
@@ -87,7 +87,7 @@
private function loadFromMySQLFileStorage($handle) {
$blob = id(new PhabricatorFileStorageBlob())->load($handle);
if (!$blob) {
- throw new Exception("Unable to load MySQL blob file '{$handle}'!");
+ throw new Exception(pht("Unable to load MySQL blob file '%s'!", $handle));
}
return $blob;
}
diff --git a/src/applications/files/engine/PhabricatorS3FileStorageEngine.php b/src/applications/files/engine/PhabricatorS3FileStorageEngine.php
--- a/src/applications/files/engine/PhabricatorS3FileStorageEngine.php
+++ b/src/applications/files/engine/PhabricatorS3FileStorageEngine.php
@@ -136,7 +136,9 @@
$bucket = PhabricatorEnv::getEnvConfig('storage.s3.bucket');
if (!$bucket) {
throw new PhabricatorFileStorageConfigurationException(
- "No 'storage.s3.bucket' specified!");
+ pht(
+ "No '%s' specified!",
+ 'storage.s3.bucket'));
}
return $bucket;
}
diff --git a/src/applications/files/engine/PhabricatorTestStorageEngine.php b/src/applications/files/engine/PhabricatorTestStorageEngine.php
--- a/src/applications/files/engine/PhabricatorTestStorageEngine.php
+++ b/src/applications/files/engine/PhabricatorTestStorageEngine.php
@@ -39,7 +39,7 @@
if (isset(self::$storage[$handle])) {
return self::$storage[$handle];
}
- throw new Exception("No such file with handle '{$handle}'!");
+ throw new Exception(pht("No such file with handle '%s'!", $handle));
}
public function deleteFile($handle) {
diff --git a/src/applications/files/exception/PhabricatorFileUploadException.php b/src/applications/files/exception/PhabricatorFileUploadException.php
--- a/src/applications/files/exception/PhabricatorFileUploadException.php
+++ b/src/applications/files/exception/PhabricatorFileUploadException.php
@@ -4,25 +4,26 @@
public function __construct($code) {
$map = array(
- UPLOAD_ERR_INI_SIZE =>
- pht("Uploaded file is too large: current limit is %s. To adjust ".
- "this limit change 'upload_max_filesize' in php.ini.",
- ini_get('upload_max_filesize')),
- UPLOAD_ERR_FORM_SIZE =>
- 'File is too large.',
- UPLOAD_ERR_PARTIAL =>
- 'File was only partially transferred, upload did not complete.',
- UPLOAD_ERR_NO_FILE =>
- 'No file was uploaded.',
- UPLOAD_ERR_NO_TMP_DIR =>
- 'Unable to write file: temporary directory does not exist.',
- UPLOAD_ERR_CANT_WRITE =>
- 'Unable to write file: failed to write to temporary directory.',
- UPLOAD_ERR_EXTENSION =>
- 'Unable to upload: a PHP extension stopped the upload.',
+ 'UPLOAD_ERR_INI_SIZE' => pht(
+ "Uploaded file is too large: current limit is %s. To adjust ".
+ "this limit change '%s' in php.ini.",
+ ini_get('upload_max_filesize'),
+ 'upload_max_filesize'),
+ 'UPLOAD_ERR_FORM_SIZE' => pht(
+ 'File is too large.'),
+ 'UPLOAD_ERR_PARTIAL' => pht(
+ 'File was only partially transferred, upload did not complete.'),
+ 'UPLOAD_ERR_NO_FILE' => pht(
+ 'No file was uploaded.'),
+ 'UPLOAD_ERR_NO_TMP_DIR' => pht(
+ 'Unable to write file: temporary directory does not exist.'),
+ 'UPLOAD_ERR_CANT_WRITE' => pht(
+ 'Unable to write file: failed to write to temporary directory.'),
+ 'UPLOAD_ERR_EXTENSION' => pht(
+ 'Unable to upload: a PHP extension stopped the upload.'),
);
- $message = idx($map, $code, 'Upload failed: unknown error.');
+ $message = idx($map, $code, pht('Upload failed: unknown error.'));
parent::__construct($message, $code);
}
}
diff --git a/src/applications/files/mail/FileCreateMailReceiver.php b/src/applications/files/mail/FileCreateMailReceiver.php
--- a/src/applications/files/mail/FileCreateMailReceiver.php
+++ b/src/applications/files/mail/FileCreateMailReceiver.php
@@ -20,7 +20,8 @@
if (empty($attachment_phids)) {
throw new PhabricatorMetaMTAReceivedMailProcessingException(
MetaMTAReceivedMailStatus::STATUS_UNHANDLED_EXCEPTION,
- 'Ignoring email to create files that did not include attachments.');
+ pht(
+ 'Ignoring email to create files that did not include attachments.'));
}
$first_phid = head($attachment_phids);
$mail->setRelatedPHID($first_phid);
diff --git a/src/applications/files/mail/FileMailReceiver.php b/src/applications/files/mail/FileMailReceiver.php
--- a/src/applications/files/mail/FileMailReceiver.php
+++ b/src/applications/files/mail/FileMailReceiver.php
@@ -3,8 +3,8 @@
final class FileMailReceiver extends PhabricatorObjectMailReceiver {
public function isEnabled() {
- $app_class = 'PhabricatorFilesApplication';
- return PhabricatorApplication::isClassInstalled($app_class);
+ return PhabricatorApplication::isClassInstalled(
+ 'PhabricatorFilesApplication');
}
protected function getObjectPattern() {
diff --git a/src/applications/files/mail/FileReplyHandler.php b/src/applications/files/mail/FileReplyHandler.php
--- a/src/applications/files/mail/FileReplyHandler.php
+++ b/src/applications/files/mail/FileReplyHandler.php
@@ -5,7 +5,7 @@
public function validateMailReceiver($mail_receiver) {
if (!($mail_receiver instanceof PhabricatorFile)) {
- throw new Exception('Mail receiver is not a PhabricatorFile.');
+ throw new Exception(pht('Mail receiver is not a %s.', 'PhabricatorFile'));
}
}
diff --git a/src/applications/files/management/PhabricatorFilesManagementCatWorkflow.php b/src/applications/files/management/PhabricatorFilesManagementCatWorkflow.php
--- a/src/applications/files/management/PhabricatorFilesManagementCatWorkflow.php
+++ b/src/applications/files/management/PhabricatorFilesManagementCatWorkflow.php
@@ -6,8 +6,7 @@
protected function didConstruct() {
$this
->setName('cat')
- ->setSynopsis(
- pht('Print the contents of a file.'))
+ ->setSynopsis(pht('Print the contents of a file.'))
->setArguments(
array(
array(
@@ -33,10 +32,10 @@
$names = $args->getArg('names');
if (count($names) > 1) {
throw new PhutilArgumentUsageException(
- pht('Specify exactly one file to print, like "F123".'));
+ pht('Specify exactly one file to print, like "%s".', 'F123'));
} else if (!$names) {
throw new PhutilArgumentUsageException(
- pht('Specify a file to print, like "F123".'));
+ pht('Specify a file to print, like "%s".', 'F123'));
}
$file = head($this->loadFilesWithNames($names));
diff --git a/src/applications/files/management/PhabricatorFilesManagementCompactWorkflow.php b/src/applications/files/management/PhabricatorFilesManagementCompactWorkflow.php
--- a/src/applications/files/management/PhabricatorFilesManagementCompactWorkflow.php
+++ b/src/applications/files/management/PhabricatorFilesManagementCompactWorkflow.php
@@ -34,8 +34,9 @@
if (!$iterator) {
throw new PhutilArgumentUsageException(
pht(
- 'Either specify a list of files to compact, or use `--all` '.
- 'to compact all files.'));
+ 'Either specify a list of files to compact, or use `%s` '.
+ 'to compact all files.',
+ '--all'));
}
$is_dry_run = $args->getArg('dry-run');
diff --git a/src/applications/files/management/PhabricatorFilesManagementEnginesWorkflow.php b/src/applications/files/management/PhabricatorFilesManagementEnginesWorkflow.php
--- a/src/applications/files/management/PhabricatorFilesManagementEnginesWorkflow.php
+++ b/src/applications/files/management/PhabricatorFilesManagementEnginesWorkflow.php
@@ -6,7 +6,7 @@
protected function didConstruct() {
$this
->setName('engines')
- ->setSynopsis('List available storage engines.')
+ ->setSynopsis(pht('List available storage engines.'))
->setArguments(array());
}
@@ -15,7 +15,7 @@
$engines = PhabricatorFile::buildAllEngines();
if (!$engines) {
- throw new Exception('No storage engines are available.');
+ throw new Exception(pht('No storage engines are available.'));
}
foreach ($engines as $engine) {
diff --git a/src/applications/files/management/PhabricatorFilesManagementMigrateWorkflow.php b/src/applications/files/management/PhabricatorFilesManagementMigrateWorkflow.php
--- a/src/applications/files/management/PhabricatorFilesManagementMigrateWorkflow.php
+++ b/src/applications/files/management/PhabricatorFilesManagementMigrateWorkflow.php
@@ -6,21 +6,21 @@
protected function didConstruct() {
$this
->setName('migrate')
- ->setSynopsis('Migrate files between storage engines.')
+ ->setSynopsis(pht('Migrate files between storage engines.'))
->setArguments(
array(
array(
'name' => 'engine',
'param' => 'storage_engine',
- 'help' => 'Migrate to the named storage engine.',
+ 'help' => pht('Migrate to the named storage engine.'),
),
array(
'name' => 'dry-run',
- 'help' => 'Show what would be migrated.',
+ 'help' => pht('Show what would be migrated.'),
),
array(
'name' => 'all',
- 'help' => 'Migrate all files.',
+ 'help' => pht('Migrate all files.'),
),
array(
'name' => 'names',
@@ -35,8 +35,11 @@
$engine_id = $args->getArg('engine');
if (!$engine_id) {
throw new PhutilArgumentUsageException(
- 'Specify an engine to migrate to with `--engine`. '.
- 'Use `files engines` to get a list of engines.');
+ pht(
+ 'Specify an engine to migrate to with `%s`. '.
+ 'Use `%s` to get a list of engines.',
+ '--engine',
+ 'files engines'));
}
$engine = PhabricatorFile::buildEngine($engine_id);
@@ -44,8 +47,10 @@
$iterator = $this->buildIterator($args);
if (!$iterator) {
throw new PhutilArgumentUsageException(
- 'Either specify a list of files to migrate, or use `--all` '.
- 'to migrate all files.');
+ pht(
+ 'Either specify a list of files to migrate, or use `%s` '.
+ 'to migrate all files.',
+ '--all'));
}
$is_dry_run = $args->getArg('dry-run');
@@ -57,39 +62,45 @@
if ($file->getStorageEngine() == $engine_id) {
$console->writeOut(
- "%s: Already stored on '%s'\n",
- $fid,
- $engine_id);
+ "%s\n",
+ pht(
+ "%s: Already stored on '%s'",
+ $fid,
+ $engine_id));
continue;
}
if ($is_dry_run) {
$console->writeOut(
- "%s: Would migrate from '%s' to '%s' (dry run)\n",
- $fid,
- $file->getStorageEngine(),
- $engine_id);
+ "%s\n",
+ pht(
+ "%s: Would migrate from '%s' to '%s' (dry run)",
+ $fid,
+ $file->getStorageEngine(),
+ $engine_id));
continue;
}
$console->writeOut(
- "%s: Migrating from '%s' to '%s'...",
- $fid,
- $file->getStorageEngine(),
- $engine_id);
+ "%s\n",
+ pht(
+ "%s: Migrating from '%s' to '%s'...",
+ $fid,
+ $file->getStorageEngine(),
+ $engine_id));
try {
$file->migrateToEngine($engine);
- $console->writeOut("done.\n");
+ $console->writeOut("%s\n", pht('Done.'));
} catch (Exception $ex) {
- $console->writeOut("failed!\n");
+ $console->writeOut("%s\n", pht('Failed!'));
$console->writeErr("%s\n", (string)$ex);
$failed[] = $file;
}
}
if ($failed) {
- $console->writeOut("**Failures!**\n");
+ $console->writeOut("**%s**\n", pht('Failures!'));
$ids = array();
foreach ($failed as $file) {
$ids[] = 'F'.$file->getID();
@@ -98,7 +109,7 @@
return 1;
} else {
- $console->writeOut("**Success!**\n");
+ $console->writeOut("**%s**\n", pht('Success!'));
return 0;
}
}
diff --git a/src/applications/files/management/PhabricatorFilesManagementPurgeWorkflow.php b/src/applications/files/management/PhabricatorFilesManagementPurgeWorkflow.php
--- a/src/applications/files/management/PhabricatorFilesManagementPurgeWorkflow.php
+++ b/src/applications/files/management/PhabricatorFilesManagementPurgeWorkflow.php
@@ -6,16 +6,16 @@
protected function didConstruct() {
$this
->setName('purge')
- ->setSynopsis('Delete files with missing data.')
+ ->setSynopsis(pht('Delete files with missing data.'))
->setArguments(
array(
array(
'name' => 'all',
- 'help' => 'Update all files.',
+ 'help' => pht('Update all files.'),
),
array(
'name' => 'dry-run',
- 'help' => 'Show what would be updated.',
+ 'help' => pht('Show what would be updated.'),
),
array(
'name' => 'names',
@@ -30,8 +30,10 @@
$iterator = $this->buildIterator($args);
if (!$iterator) {
throw new PhutilArgumentUsageException(
- 'Either specify a list of files to purge, or use `--all` '.
- 'to purge all files.');
+ pht(
+ 'Either specify a list of files to purge, or use `%s` '.
+ 'to purge all files.',
+ '--all'));
}
$is_dry_run = $args->getArg('dry-run');
@@ -48,17 +50,17 @@
if ($okay) {
$console->writeOut(
- "%s: File data is OK, not purging.\n",
- $fid);
+ "%s\n",
+ pht('%s: File data is OK, not purging.', $fid));
} else {
if ($is_dry_run) {
$console->writeOut(
- "%s: Would purge (dry run).\n",
- $fid);
+ "%s\n",
+ pht('%s: Would purge (dry run).', $fid));
} else {
$console->writeOut(
- "%s: Purging.\n",
- $fid);
+ "%s\n",
+ pht('%s: Purging.', $fid));
$file->delete();
}
}
diff --git a/src/applications/files/management/PhabricatorFilesManagementRebuildWorkflow.php b/src/applications/files/management/PhabricatorFilesManagementRebuildWorkflow.php
--- a/src/applications/files/management/PhabricatorFilesManagementRebuildWorkflow.php
+++ b/src/applications/files/management/PhabricatorFilesManagementRebuildWorkflow.php
@@ -6,24 +6,24 @@
protected function didConstruct() {
$this
->setName('rebuild')
- ->setSynopsis('Rebuild metadata of old files.')
+ ->setSynopsis(pht('Rebuild metadata of old files.'))
->setArguments(
array(
array(
'name' => 'all',
- 'help' => 'Update all files.',
+ 'help' => pht('Update all files.'),
),
array(
'name' => 'dry-run',
- 'help' => 'Show what would be updated.',
+ 'help' => pht('Show what would be updated.'),
),
array(
'name' => 'rebuild-mime',
- 'help' => 'Rebuild MIME information.',
+ 'help' => pht('Rebuild MIME information.'),
),
array(
'name' => 'rebuild-dimensions',
- 'help' => 'Rebuild image dimension information.',
+ 'help' => pht('Rebuild image dimension information.'),
),
array(
'name' => 'names',
@@ -38,8 +38,10 @@
$iterator = $this->buildIterator($args);
if (!$iterator) {
throw new PhutilArgumentUsageException(
- 'Either specify a list of files to update, or use `--all` '.
- 'to update all files.');
+ pht(
+ 'Either specify a list of files to update, or use `%s` '.
+ 'to update all files.',
+ '--all'));
}
$update = array(
@@ -68,22 +70,28 @@
if ($new_type == $file->getMimeType()) {
$console->writeOut(
- "%s: Mime type not changed (%s).\n",
- $fid,
- $new_type);
+ "%s\n",
+ pht(
+ '%s: Mime type not changed (%s).',
+ $fid,
+ $new_type));
} else {
if ($is_dry_run) {
$console->writeOut(
- "%s: Would update Mime type: '%s' -> '%s'.\n",
- $fid,
- $file->getMimeType(),
- $new_type);
+ "%s\n",
+ pht(
+ "%s: Would update Mime type: '%s' -> '%s'.",
+ $fid,
+ $file->getMimeType(),
+ $new_type));
} else {
$console->writeOut(
- "%s: Updating Mime type: '%s' -> '%s'.\n",
- $fid,
- $file->getMimeType(),
- $new_type);
+ "%s\n",
+ pht(
+ "%s: Updating Mime type: '%s' -> '%s'.",
+ $fid,
+ $file->getMimeType(),
+ $new_type));
$file->setMimeType($new_type);
$file->save();
}
@@ -93,8 +101,8 @@
if ($update['dimensions']) {
if (!$file->isViewableImage()) {
$console->writeOut(
- "%s: Not an image file.\n",
- $fid);
+ "%s\n",
+ pht('%s: Not an image file.', $fid));
continue;
}
@@ -103,27 +111,26 @@
$image_height = idx($metadata, PhabricatorFile::METADATA_IMAGE_HEIGHT);
if ($image_width && $image_height) {
$console->writeOut(
- "%s: Image dimensions already exist.\n",
- $fid);
+ "%s\n",
+ pht('%s: Image dimensions already exist.', $fid));
continue;
}
if ($is_dry_run) {
$console->writeOut(
- "%s: Would update file dimensions (dry run)\n",
- $fid);
+ "%s\n",
+ pht('%s: Would update file dimensions (dry run)', $fid));
continue;
}
$console->writeOut(
- '%s: Updating metadata... ',
- $fid);
+ pht('%s: Updating metadata... ', $fid));
try {
$file->updateDimensions();
- $console->writeOut("done.\n");
+ $console->writeOut("%s\n", pht('Done.'));
} catch (Exception $ex) {
- $console->writeOut("failed!\n");
+ $console->writeOut("%s\n", pht('Failed!'));
$console->writeErr("%s\n", (string)$ex);
$failed[] = $file;
}
@@ -131,7 +138,7 @@
}
if ($failed) {
- $console->writeOut("**Failures!**\n");
+ $console->writeOut("**%s**\n", pht('Failures!'));
$ids = array();
foreach ($failed as $file) {
$ids[] = 'F'.$file->getID();
@@ -140,7 +147,7 @@
return 1;
} else {
- $console->writeOut("**Success!**\n");
+ $console->writeOut("**%s**\n", pht('Success!'));
return 0;
}
diff --git a/src/applications/files/management/PhabricatorFilesManagementWorkflow.php b/src/applications/files/management/PhabricatorFilesManagementWorkflow.php
--- a/src/applications/files/management/PhabricatorFilesManagementWorkflow.php
+++ b/src/applications/files/management/PhabricatorFilesManagementWorkflow.php
@@ -9,7 +9,9 @@
if ($args->getArg('all')) {
if ($names) {
throw new PhutilArgumentUsageException(
- 'Specify either a list of files or `--all`, but not both.');
+ pht(
+ 'Specify either a list of files or `%s`, but not both.',
+ '--all'));
}
return new LiskMigrationIterator(new PhabricatorFile());
}
@@ -33,7 +35,9 @@
foreach ($names as $name) {
if (empty($files[$name])) {
throw new PhutilArgumentUsageException(
- "No file '{$name}' exists!");
+ pht(
+ "No file '%s' exists!",
+ $name));
}
}
diff --git a/src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php b/src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php
--- a/src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php
+++ b/src/applications/files/markup/PhabricatorEmbedFileRemarkupRule.php
@@ -130,9 +130,9 @@
'class' => $image_class,
'sigil' => 'lightboxable',
'meta' => array(
- 'phid' => $file->getPHID(),
- 'uri' => $file->getBestURI(),
- 'dUri' => $file->getDownloadURI(),
+ 'phid' => $file->getPHID(),
+ 'uri' => $file->getBestURI(),
+ 'dUri' => $file->getDownloadURI(),
'viewable' => true,
),
),
diff --git a/src/applications/files/query/PhabricatorFileQuery.php b/src/applications/files/query/PhabricatorFileQuery.php
--- a/src/applications/files/query/PhabricatorFileQuery.php
+++ b/src/applications/files/query/PhabricatorFileQuery.php
@@ -84,8 +84,11 @@
empty($spec['originalPHID']) ||
empty($spec['transform'])) {
throw new Exception(
- "Transform specification must be a dictionary with keys ".
- "'originalPHID' and 'transform'!");
+ pht(
+ "Transform specification must be a dictionary with keys ".
+ "'%s' and '%s'!",
+ 'originalPHID',
+ 'transform'));
}
}
diff --git a/src/applications/files/storage/PhabricatorFile.php b/src/applications/files/storage/PhabricatorFile.php
--- a/src/applications/files/storage/PhabricatorFile.php
+++ b/src/applications/files/storage/PhabricatorFile.php
@@ -141,7 +141,7 @@
public static function readUploadedFileData($spec) {
if (!$spec) {
- throw new Exception('No file was uploaded!');
+ throw new Exception(pht('No file was uploaded!'));
}
$err = idx($spec, 'error');
@@ -152,14 +152,14 @@
$tmp_name = idx($spec, 'tmp_name');
$is_valid = @is_uploaded_file($tmp_name);
if (!$is_valid) {
- throw new Exception('File is not an uploaded file.');
+ throw new Exception(pht('File is not an uploaded file.'));
}
$file_data = Filesystem::readFile($tmp_name);
$file_size = idx($spec, 'size');
if (strlen($file_data) != $file_size) {
- throw new Exception('File size disagrees with uploaded size.');
+ throw new Exception(pht('File size disagrees with uploaded size.'));
}
return $file_data;
@@ -346,7 +346,7 @@
if (!$data_handle) {
throw new PhutilAggregateException(
- 'All storage engines failed to write file:',
+ pht('All storage engines failed to write file:'),
$exceptions);
}
@@ -393,7 +393,7 @@
public function migrateToEngine(PhabricatorFileStorageEngine $engine) {
if (!$this->getID() || !$this->getStorageHandle()) {
throw new Exception(
- "You can not migrate a file which hasn't yet been saved.");
+ pht("You can not migrate a file which hasn't yet been saved."));
}
$data = $this->loadFileData();
@@ -434,17 +434,23 @@
if (!$data_handle || strlen($data_handle) > 255) {
// This indicates an improperly implemented storage engine.
throw new PhabricatorFileStorageConfigurationException(
- "Storage engine '{$engine_class}' executed writeFile() but did ".
- "not return a valid handle ('{$data_handle}') to the data: it ".
- "must be nonempty and no longer than 255 characters.");
+ pht(
+ "Storage engine '%s' executed %s but did not return a valid ".
+ "handle ('%s') to the data: it must be nonempty and no longer ".
+ "than 255 characters.",
+ $engine_class,
+ 'writeFile()',
+ $data_handle));
}
$engine_identifier = $engine->getEngineIdentifier();
if (!$engine_identifier || strlen($engine_identifier) > 32) {
throw new PhabricatorFileStorageConfigurationException(
- "Storage engine '{$engine_class}' returned an improper engine ".
- "identifier '{$engine_identifier}': it must be nonempty ".
- "and no longer than 32 characters.");
+ pht(
+ "Storage engine '%s' returned an improper engine identifier '{%s}': ".
+ "it must be nonempty and no longer than 32 characters.",
+ $engine_class,
+ $engine_identifier));
}
return array($engine_identifier, $data_handle);
@@ -524,8 +530,7 @@
if (isset($redirects[$location])) {
throw new Exception(
- pht(
- 'Encountered loop while following redirects.'));
+ pht('Encountered loop while following redirects.'));
}
$redirects[$location] = $location;
@@ -662,7 +667,7 @@
$data = $data;
break;
default:
- throw new Exception('Unknown storage format.');
+ throw new Exception(pht('Unknown storage format.'));
}
return $data;
@@ -685,7 +690,7 @@
public function getViewURI() {
if (!$this->getPHID()) {
throw new Exception(
- 'You must save a file before you can generate a view URI.');
+ pht('You must save a file before you can generate a view URI.'));
}
return $this->getCDNURI(null);
@@ -735,7 +740,7 @@
public function getCDNURIWithToken() {
if (!$this->getPHID()) {
throw new Exception(
- 'You must save a file before you can generate a CDN URI.');
+ pht('You must save a file before you can generate a CDN URI.'));
}
return $this->getCDNURI($this->generateOneTimeToken());
@@ -859,7 +864,7 @@
return function_exists('imagegif');
break;
default:
- throw new Exception('Unknown type matched as image MIME type.');
+ throw new Exception(pht('Unknown type matched as image MIME type.'));
}
}
@@ -894,7 +899,9 @@
}
throw new Exception(
- "Storage engine '{$engine_identifier}' could not be located!");
+ pht(
+ "Storage engine '%s' could not be located!",
+ $engine_identifier));
}
public static function buildAllEngines() {
@@ -938,21 +945,18 @@
public function updateDimensions($save = true) {
if (!$this->isViewableImage()) {
- throw new Exception(
- 'This file is not a viewable image.');
+ throw new Exception(pht('This file is not a viewable image.'));
}
if (!function_exists('imagecreatefromstring')) {
- throw new Exception(
- 'Cannot retrieve image information.');
+ throw new Exception(pht('Cannot retrieve image information.'));
}
$data = $this->loadFileData();
$img = imagecreatefromstring($data);
if ($img === false) {
- throw new Exception(
- 'Error when decoding image.');
+ throw new Exception(pht('Error when decoding image.'));
}
$this->metadata[self::METADATA_IMAGE_WIDTH] = imagesx($img);
@@ -1022,13 +1026,13 @@
// This is just a sanity check to prevent loading arbitrary files.
if (basename($name) != $name) {
- throw new Exception("Invalid builtin name '{$name}'!");
+ throw new Exception(pht("Invalid builtin name '%s'!", $name));
}
$path = $root.$name;
if (!Filesystem::pathExists($path)) {
- throw new Exception("Builtin '{$path}' does not exist!");
+ throw new Exception(pht("Builtin '%s' does not exist!", $path));
}
$data = Filesystem::readFile($path);
diff --git a/src/applications/files/view/PhabricatorGlobalUploadTargetView.php b/src/applications/files/view/PhabricatorGlobalUploadTargetView.php
--- a/src/applications/files/view/PhabricatorGlobalUploadTargetView.php
+++ b/src/applications/files/view/PhabricatorGlobalUploadTargetView.php
@@ -57,6 +57,6 @@
'class' => 'phabricator-global-upload-instructions',
'style' => 'display: none;',
),
- pht("\xE2\x87\xAA Drop Files to Upload"));
+ "\xE2\x87\xAA ".pht('Drop Files to Upload'));
}
}
diff --git a/src/applications/flag/query/PhabricatorFlagQuery.php b/src/applications/flag/query/PhabricatorFlagQuery.php
--- a/src/applications/flag/query/PhabricatorFlagQuery.php
+++ b/src/applications/flag/query/PhabricatorFlagQuery.php
@@ -115,7 +115,8 @@
case self::GROUP_NONE:
break;
default:
- throw new Exception("Unknown groupBy parameter: $this->groupBy");
+ throw new Exception(
+ pht('Unknown groupBy parameter: %s', $this->groupBy));
break;
}
diff --git a/src/applications/fund/editor/FundInitiativeEditor.php b/src/applications/fund/editor/FundInitiativeEditor.php
--- a/src/applications/fund/editor/FundInitiativeEditor.php
+++ b/src/applications/fund/editor/FundInitiativeEditor.php
@@ -131,7 +131,7 @@
->withPHIDs(array($xaction->getNewValue()))
->executeOne();
if (!$backer) {
- throw new Exception(pht('Unable to load FundBacker!'));
+ throw new Exception(pht('Unable to load %s!', 'FundBacker'));
}
$subx = array();
diff --git a/src/applications/fund/mail/FundInitiativeReplyHandler.php b/src/applications/fund/mail/FundInitiativeReplyHandler.php
--- a/src/applications/fund/mail/FundInitiativeReplyHandler.php
+++ b/src/applications/fund/mail/FundInitiativeReplyHandler.php
@@ -5,7 +5,7 @@
public function validateMailReceiver($mail_receiver) {
if (!($mail_receiver instanceof FundInitiative)) {
- throw new Exception('Mail receiver is not a FundInitiative!');
+ throw new Exception(pht('Mail receiver is not a %s!', 'FundInitiative'));
}
}
diff --git a/src/applications/fund/phortune/FundBackerCart.php b/src/applications/fund/phortune/FundBackerCart.php
--- a/src/applications/fund/phortune/FundBackerCart.php
+++ b/src/applications/fund/phortune/FundBackerCart.php
@@ -34,7 +34,9 @@
$initiative = $this->getInitiative();
if (!$initiative) {
throw new Exception(
- pht('Call setInitiative() before building a cart!'));
+ pht(
+ 'Call %s before building a cart!',
+ 'setInitiative()'));
}
$cart->setMetadataValue('initiativePHID', $initiative->getPHID());
diff --git a/src/applications/fund/phortune/FundBackerProduct.php b/src/applications/fund/phortune/FundBackerProduct.php
--- a/src/applications/fund/phortune/FundBackerProduct.php
+++ b/src/applications/fund/phortune/FundBackerProduct.php
@@ -86,7 +86,7 @@
->withPHIDs(array($purchase->getMetadataValue('backerPHID')))
->executeOne();
if (!$backer) {
- throw new Exception(pht('Unable to load FundBacker!'));
+ throw new Exception(pht('Unable to load %s!', 'FundBacker'));
}
// Load the actual backing user -- they may not be the curent viewer if this
@@ -124,7 +124,7 @@
->withPHIDs(array($purchase->getMetadataValue('backerPHID')))
->executeOne();
if (!$backer) {
- throw new Exception(pht('Unable to load FundBacker!'));
+ throw new Exception(pht('Unable to load %s!', 'FundBacker'));
}
$xactions = array();
diff --git a/src/applications/fund/search/FundInitiativeIndexer.php b/src/applications/fund/search/FundInitiativeIndexer.php
--- a/src/applications/fund/search/FundInitiativeIndexer.php
+++ b/src/applications/fund/search/FundInitiativeIndexer.php
@@ -13,7 +13,10 @@
->withPHIDs(array($phid))
->executeOne();
if (!$object) {
- throw new Exception("Unable to load object by phid '{$phid}'!");
+ throw new Exception(
+ pht(
+ "Unable to load object by PHID '%s'!",
+ $phid));
}
return $object;
}
diff --git a/src/applications/fund/storage/FundInitiative.php b/src/applications/fund/storage/FundInitiative.php
--- a/src/applications/fund/storage/FundInitiative.php
+++ b/src/applications/fund/storage/FundInitiative.php
@@ -143,8 +143,7 @@
}
public function describeAutomaticCapability($capability) {
- return pht(
- 'The owner of an initiative can always view and edit it.');
+ return pht('The owner of an initiative can always view and edit it.');
}
diff --git a/src/applications/harbormaster/controller/HarbormasterBuildActionController.php b/src/applications/harbormaster/controller/HarbormasterBuildActionController.php
--- a/src/applications/harbormaster/controller/HarbormasterBuildActionController.php
+++ b/src/applications/harbormaster/controller/HarbormasterBuildActionController.php
@@ -86,8 +86,7 @@
'This build is already restarting. You can not reissue a '.
'restart command to a restarting build.');
} else {
- $body = pht(
- 'You can not restart this build.');
+ $body = pht('You can not restart this build.');
}
}
break;
diff --git a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php
--- a/src/applications/harbormaster/controller/HarbormasterBuildViewController.php
+++ b/src/applications/harbormaster/controller/HarbormasterBuildViewController.php
@@ -183,7 +183,7 @@
}
$properties = new PHUIPropertyListView();
- $properties->addProperty('Build Target ID', $build_target->getID());
+ $properties->addProperty(pht('Build Target ID'), $build_target->getID());
$target_box->addPropertyList($properties, pht('Metadata'));
$targets[] = $target_box;
@@ -528,6 +528,4 @@
return $table;
}
-
-
}
diff --git a/src/applications/harbormaster/controller/HarbormasterPlanEditController.php b/src/applications/harbormaster/controller/HarbormasterPlanEditController.php
--- a/src/applications/harbormaster/controller/HarbormasterPlanEditController.php
+++ b/src/applications/harbormaster/controller/HarbormasterPlanEditController.php
@@ -75,7 +75,7 @@
->setUser($viewer)
->appendChild(
id(new AphrontFormTextControl())
- ->setLabel('Plan Name')
+ ->setLabel(pht('Plan Name'))
->setName('name')
->setError($e_name)
->setValue($v_name));
diff --git a/src/applications/harbormaster/controller/HarbormasterPlanViewController.php b/src/applications/harbormaster/controller/HarbormasterPlanViewController.php
--- a/src/applications/harbormaster/controller/HarbormasterPlanViewController.php
+++ b/src/applications/harbormaster/controller/HarbormasterPlanViewController.php
@@ -437,7 +437,7 @@
$icon_label = pht('Missing Dependency');
$has_conflicts = true;
$error = pht(
- 'This dependency specifies a build step which doesn\'t exist.');
+ "This dependency specifies a build step which doesn't exist.");
} else {
$bound = phutil_tag(
'strong',
diff --git a/src/applications/harbormaster/controller/HarbormasterStepDeleteController.php b/src/applications/harbormaster/controller/HarbormasterStepDeleteController.php
--- a/src/applications/harbormaster/controller/HarbormasterStepDeleteController.php
+++ b/src/applications/harbormaster/controller/HarbormasterStepDeleteController.php
@@ -22,7 +22,7 @@
->withIDs(array($id))
->executeOne();
if ($step === null) {
- throw new Exception('Build step not found!');
+ throw new Exception(pht('Build step not found!'));
}
$plan_id = $step->getBuildPlan()->getID();
@@ -43,8 +43,8 @@
'p',
array(),
pht(
- 'Are you sure you want to delete this '.
- 'step? This can\'t be undone!')));
+ "Are you sure you want to delete this step? ".
+ "This can't be undone!")));
return id(new AphrontDialogResponse())->setDialog($dialog);
}
diff --git a/src/applications/harbormaster/controller/HarbormasterStepEditController.php b/src/applications/harbormaster/controller/HarbormasterStepEditController.php
--- a/src/applications/harbormaster/controller/HarbormasterStepEditController.php
+++ b/src/applications/harbormaster/controller/HarbormasterStepEditController.php
@@ -213,8 +213,9 @@
$rows = array();
$rows[] = pht(
- 'The following variables can be used in most fields. To reference '.
- 'a variable, use `${name}` in a field.');
+ 'The following variables can be used in most fields. '.
+ 'To reference a variable, use `%s` in a field.',
+ '${name}');
$rows[] = pht('| Variable | Description |');
$rows[] = '|---|---|';
foreach ($variables as $name => $description) {
diff --git a/src/applications/harbormaster/editor/HarbormasterBuildTransactionEditor.php b/src/applications/harbormaster/editor/HarbormasterBuildTransactionEditor.php
--- a/src/applications/harbormaster/editor/HarbormasterBuildTransactionEditor.php
+++ b/src/applications/harbormaster/editor/HarbormasterBuildTransactionEditor.php
@@ -78,7 +78,7 @@
$issuable = $build->canResumeBuild();
break;
default:
- throw new Exception("Unknown command $command");
+ throw new Exception(pht('Unknown command %s', $command));
}
if (!$issuable) {
diff --git a/src/applications/harbormaster/management/HarbormasterManagementBuildWorkflow.php b/src/applications/harbormaster/management/HarbormasterManagementBuildWorkflow.php
--- a/src/applications/harbormaster/management/HarbormasterManagementBuildWorkflow.php
+++ b/src/applications/harbormaster/management/HarbormasterManagementBuildWorkflow.php
@@ -11,9 +11,9 @@
->setArguments(
array(
array(
- 'name' => 'plan',
- 'param' => 'id',
- 'help' => pht('ID of build plan to run.'),
+ 'name' => 'plan',
+ 'param' => 'id',
+ 'help' => pht('ID of build plan to run.'),
),
array(
'name' => 'buildable',
@@ -50,7 +50,9 @@
$plan_id = $args->getArg('plan');
if (!$plan_id) {
throw new PhutilArgumentUsageException(
- pht('Use --plan to specify a build plan to run.'));
+ pht(
+ 'Use %s to specify a build plan to run.',
+ '--plan'));
}
$plan = id(new HarbormasterBuildPlanQuery())
diff --git a/src/applications/harbormaster/step/HarbormasterCommandBuildStepImplementation.php b/src/applications/harbormaster/step/HarbormasterCommandBuildStepImplementation.php
--- a/src/applications/harbormaster/step/HarbormasterCommandBuildStepImplementation.php
+++ b/src/applications/harbormaster/step/HarbormasterCommandBuildStepImplementation.php
@@ -130,8 +130,8 @@
'type' => 'text',
'required' => true,
'caption' => pht(
- 'Under Windows, this is executed under PowerShell.'.
- 'Under UNIX, this is executed using the user\'s shell.'),
+ "Under Windows, this is executed under PowerShell. ".
+ "Under UNIX, this is executed using the user's shell."),
),
'hostartifact' => array(
'name' => pht('Host'),
diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuild.php b/src/applications/harbormaster/storage/build/HarbormasterBuild.php
--- a/src/applications/harbormaster/storage/build/HarbormasterBuild.php
+++ b/src/applications/harbormaster/storage/build/HarbormasterBuild.php
@@ -250,7 +250,7 @@
array($name))
->executeOne();
if ($artifact === null) {
- throw new Exception('Artifact not found!');
+ throw new Exception(pht('Artifact not found!'));
}
return $artifact;
}
diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuildArtifact.php b/src/applications/harbormaster/storage/build/HarbormasterBuildArtifact.php
--- a/src/applications/harbormaster/storage/build/HarbormasterBuildArtifact.php
+++ b/src/applications/harbormaster/storage/build/HarbormasterBuildArtifact.php
@@ -96,7 +96,9 @@
public function loadDrydockLease() {
if ($this->getArtifactType() !== self::TYPE_HOST) {
throw new Exception(
- '`loadDrydockLease` may only be called on host artifacts.');
+ pht(
+ '`%s` may only be called on host artifacts.',
+ __FUNCTION__));
}
$data = $this->getArtifactData();
@@ -106,12 +108,12 @@
$lease = id(new DrydockLease())->load(
$data['drydock-lease']);
if ($lease === null) {
- throw new Exception('Associated Drydock lease not found!');
+ throw new Exception(pht('Associated Drydock lease not found!'));
}
$resource = id(new DrydockResource())->load(
$lease->getResourceID());
if ($resource === null) {
- throw new Exception('Associated Drydock resource not found!');
+ throw new Exception(pht('Associated Drydock resource not found!'));
}
$lease->attachResource($resource);
@@ -121,7 +123,9 @@
public function loadPhabricatorFile() {
if ($this->getArtifactType() !== self::TYPE_FILE) {
throw new Exception(
- '`loadPhabricatorFile` may only be called on file artifacts.');
+ pht(
+ '`%s` may only be called on file artifacts.',
+ __FUNCTION__));
}
$data = $this->getArtifactData();
@@ -134,7 +138,7 @@
->withPHIDs(array($phid))
->executeOne();
if ($file === null) {
- throw new Exception('Associated file not found!');
+ throw new Exception(pht('Associated file not found!'));
}
return $file;
}
@@ -178,8 +182,7 @@
}
public function describeAutomaticCapability($capability) {
- return pht(
- 'Users must be able to see a buildable to see its artifacts.');
+ return pht('Users must be able to see a buildable to see its artifacts.');
}
}
diff --git a/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php b/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php
--- a/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php
+++ b/src/applications/harbormaster/storage/build/HarbormasterBuildLog.php
@@ -68,7 +68,8 @@
public function start() {
if ($this->getLive()) {
- throw new Exception('Live logging has already started for this log.');
+ throw new Exception(
+ pht('Live logging has already started for this log.'));
}
$this->setLive(1);
@@ -79,7 +80,8 @@
public function append($content) {
if (!$this->getLive()) {
- throw new Exception('Start logging before appending data to the log.');
+ throw new Exception(
+ pht('Start logging before appending data to the log.'));
}
if (strlen($content) === 0) {
return;
@@ -143,7 +145,7 @@
public function finalize($start = 0) {
if (!$this->getLive()) {
- throw new Exception('Start logging before finalizing it.');
+ throw new Exception(pht('Start logging before finalizing it.'));
}
// TODO: Encode the log contents in a gzipped format.
@@ -201,7 +203,7 @@
public function describeAutomaticCapability($capability) {
return pht(
- 'Users must be able to see a build target to view it\'s build log.');
+ "Users must be able to see a build target to view it's build log.");
}
diff --git a/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php b/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php
--- a/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php
+++ b/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php
@@ -305,7 +305,8 @@
$effect->setAction(self::ACTION_ADD_CC);
$effect->setTarget(array_keys($this->explicitCCs));
$effect->setReason(
- pht('CCs provided explicitly by revision author or carried over '.
+ pht(
+ 'CCs provided explicitly by revision author or carried over '.
'from a previous version of the revision.'));
$result[] = new HeraldApplyTranscript(
$effect,
@@ -346,8 +347,9 @@
$result[] = new HeraldApplyTranscript(
$effect,
true,
- pht('Added these addresses to CC list. '.
- 'Others could not be added.'));
+ pht(
+ 'Added these addresses to CC list. '.
+ 'Others could not be added.'));
}
$result[] = new HeraldApplyTranscript(
$failed,
diff --git a/src/applications/herald/controller/HeraldRuleController.php b/src/applications/herald/controller/HeraldRuleController.php
--- a/src/applications/herald/controller/HeraldRuleController.php
+++ b/src/applications/herald/controller/HeraldRuleController.php
@@ -270,7 +270,7 @@
if (!is_array($data) ||
!$data['conditions'] ||
!$data['actions']) {
- throw new Exception('Failed to decode rule data.');
+ throw new Exception(pht('Failed to decode rule data.'));
}
$conditions = array();
diff --git a/src/applications/herald/controller/HeraldTranscriptController.php b/src/applications/herald/controller/HeraldTranscriptController.php
--- a/src/applications/herald/controller/HeraldTranscriptController.php
+++ b/src/applications/herald/controller/HeraldTranscriptController.php
@@ -78,8 +78,10 @@
$notice = new PHUIInfoView();
$notice->setSeverity(PHUIInfoView::SEVERITY_NOTICE);
$notice->setTitle(pht('Dry Run'));
- $notice->appendChild(pht('This was a dry run to test Herald '.
- 'rules, no actions were executed.'));
+ $notice->appendChild(
+ pht(
+ 'This was a dry run to test Herald rules, '.
+ 'no actions were executed.'));
$nav->appendChild($notice);
}
@@ -133,7 +135,7 @@
// grabbed handles for everything, but be super liberal in what
// we accept here since we expect all sorts of weird issues as we
// version the system.
- $value[$key] = 'Unknown Object #'.$phid;
+ $value[$key] = pht('Unknown Object #%s', $phid);
}
}
sort($value);
@@ -210,7 +212,8 @@
// TODO: Also total hacks.
if (is_array($value)) {
foreach ($value as $phid) {
- if ($phid) { // TODO: Probably need to make sure this
+ if ($phid) {
+ // TODO: Probably need to make sure this
// "looks like" a PHID or decrease the level of hacks here;
// this used to be an is_numeric() check in Facebook land.
$phids[] = $phid;
diff --git a/src/applications/herald/storage/HeraldRule.php b/src/applications/herald/storage/HeraldRule.php
--- a/src/applications/herald/storage/HeraldRule.php
+++ b/src/applications/herald/storage/HeraldRule.php
@@ -133,7 +133,7 @@
assert_instances_of($children, 'HeraldDAO');
if (!$this->getID()) {
- throw new Exception('Save rule before saving children.');
+ throw new Exception(pht('Save rule before saving children.'));
}
foreach ($children as $child) {
diff --git a/src/applications/home/controller/PhabricatorHomeMainController.php b/src/applications/home/controller/PhabricatorHomeMainController.php
--- a/src/applications/home/controller/PhabricatorHomeMainController.php
+++ b/src/applications/home/controller/PhabricatorHomeMainController.php
@@ -143,8 +143,8 @@
if (!$tasks) {
return $this->renderMiniPanel(
- 'No "Unbreak Now!" Tasks',
- 'Nothing appears to be critically broken right now.');
+ pht('No "Unbreak Now!" Tasks'),
+ pht('Nothing appears to be critically broken right now.'));
}
$href = urisprintf(
@@ -190,10 +190,8 @@
if (!$tasks) {
return $this->renderMiniPanel(
- 'No "Needs Triage" Tasks',
- hsprintf(
- 'No tasks in <a href="/project/">projects you are a member of</a> '.
- 'need triage.'));
+ pht('No "Needs Triage" Tasks'),
+ pht('No tasks in projects you are a member of need triage.'));
}
$title = pht('Needs Triage');
@@ -228,8 +226,8 @@
if (!$blocking && !$active) {
return $this->renderMiniPanel(
- 'No Waiting Revisions',
- 'No revisions are waiting on you.');
+ pht('No Waiting Revisions'),
+ pht('No revisions are waiting on you.'));
}
$title = pht('Revisions Waiting on You');
@@ -283,8 +281,8 @@
if (!$tasks) {
return $this->renderMiniPanel(
- 'No Assigned Tasks',
- 'You have no assigned tasks.');
+ pht('No Assigned Tasks'),
+ pht('You have no assigned tasks.'));
}
$title = pht('Assigned Tasks');
@@ -360,8 +358,8 @@
if (!$commits) {
return $this->renderMinipanel(
- 'No Audits',
- 'No commits are waiting for you to audit them.');
+ pht('No Audits'),
+ pht('No commits are waiting for you to audit them.'));
}
$view = id(new PhabricatorAuditListView())
@@ -399,8 +397,8 @@
if (!$commits) {
return $this->renderMinipanel(
- 'No Problem Commits',
- 'No one has raised concerns with your commits.');
+ pht('No Problem Commits'),
+ pht('No one has raised concerns with your commits.'));
}
$view = id(new PhabricatorAuditListView())
diff --git a/src/applications/legalpad/controller/LegalpadDocumentEditController.php b/src/applications/legalpad/controller/LegalpadDocumentEditController.php
--- a/src/applications/legalpad/controller/LegalpadDocumentEditController.php
+++ b/src/applications/legalpad/controller/LegalpadDocumentEditController.php
@@ -167,8 +167,7 @@
->addCheckbox(
'requireSignature',
'requireSignature',
- pht(
- 'Should signing this document be required to use Phabricator?'),
+ pht('Should signing this document be required to use Phabricator?'),
$v_require_signature)
->setCaption($caption));
}
diff --git a/src/applications/legalpad/controller/LegalpadDocumentSignController.php b/src/applications/legalpad/controller/LegalpadDocumentSignController.php
--- a/src/applications/legalpad/controller/LegalpadDocumentSignController.php
+++ b/src/applications/legalpad/controller/LegalpadDocumentSignController.php
@@ -653,25 +653,22 @@
$name = idx($signature_data, 'name');
- $body = <<<EOBODY
-{$name}:
-
-This email address was used to sign a Legalpad document in Phabricator:
-
- {$doc_name}
-
-Please verify you own this email address and accept the agreement by clicking
-this link:
-
- {$link}
-
-Your signature is not valid until you complete this verification step.
-
-You can review the document here:
-
- {$doc_link}
-
-EOBODY;
+ $body = sprintf(
+ "%s:\n\n%s\n\n %s\n\n%s\n\n %s\n\n%s\n\n%s\n\n %s\n",
+ $name,
+ pht(
+ 'This email address was used to sign a Legalpad document '.
+ 'in Phabricator:'),
+ $doc_name,
+ pht(
+ 'Please verify you own this email address and accept the '.
+ 'agreement by clicking this link:'),
+ $link,
+ pht(
+ 'Your signature is not valid until you complete this '.
+ 'verification step.'),
+ pht('You can review the document here:'),
+ $doc_link);
id(new PhabricatorMetaMTAMail())
->addRawTos(array($email->getAddress()))
@@ -684,9 +681,10 @@
private function signInResponse() {
return id(new Aphront403Response())
- ->setForbiddenText(pht(
- 'The email address specified is associated with an account. '.
- 'Please login to that account and sign this document again.'));
+ ->setForbiddenText(
+ pht(
+ 'The email address specified is associated with an account. '.
+ 'Please login to that account and sign this document again.'));
}
}
diff --git a/src/applications/legalpad/controller/LegalpadDocumentSignatureVerificationController.php b/src/applications/legalpad/controller/LegalpadDocumentSignatureVerificationController.php
--- a/src/applications/legalpad/controller/LegalpadDocumentSignatureVerificationController.php
+++ b/src/applications/legalpad/controller/LegalpadDocumentSignatureVerificationController.php
@@ -38,9 +38,7 @@
if ($signature->isVerified()) {
return $this->newDialog()
->setTitle(pht('Signature Already Verified'))
- ->appendParagraph(
- pht(
- 'This signature has already been verified.'))
+ ->appendParagraph(pht('This signature has already been verified.'))
->addCancelButton('/', pht('Okay'));
}
diff --git a/src/applications/legalpad/mail/LegalpadMailReceiver.php b/src/applications/legalpad/mail/LegalpadMailReceiver.php
--- a/src/applications/legalpad/mail/LegalpadMailReceiver.php
+++ b/src/applications/legalpad/mail/LegalpadMailReceiver.php
@@ -3,8 +3,8 @@
final class LegalpadMailReceiver extends PhabricatorObjectMailReceiver {
public function isEnabled() {
- $app_class = 'PhabricatorLegalpadApplication';
- return PhabricatorApplication::isClassInstalled($app_class);
+ return PhabricatorApplication::isClassInstalled(
+ 'PhabricatorLegalpadApplication');
}
protected function getObjectPattern() {
diff --git a/src/applications/legalpad/mail/LegalpadReplyHandler.php b/src/applications/legalpad/mail/LegalpadReplyHandler.php
--- a/src/applications/legalpad/mail/LegalpadReplyHandler.php
+++ b/src/applications/legalpad/mail/LegalpadReplyHandler.php
@@ -5,7 +5,7 @@
public function validateMailReceiver($mail_receiver) {
if (!($mail_receiver instanceof LegalpadDocument)) {
- throw new Exception('Mail receiver is not a LegalpadDocument!');
+ throw new Exception(pht('Mail receiver is not a LegalpadDocument!'));
}
}
diff --git a/src/applications/legalpad/query/LegalpadDocumentSearchEngine.php b/src/applications/legalpad/query/LegalpadDocumentSearchEngine.php
--- a/src/applications/legalpad/query/LegalpadDocumentSearchEngine.php
+++ b/src/applications/legalpad/query/LegalpadDocumentSearchEngine.php
@@ -108,7 +108,6 @@
pht('Created After'),
'createdEnd',
pht('Created Before'));
-
}
protected function getURI($path) {
diff --git a/src/applications/legalpad/storage/LegalpadDocument.php b/src/applications/legalpad/storage/LegalpadDocument.php
--- a/src/applications/legalpad/storage/LegalpadDocument.php
+++ b/src/applications/legalpad/storage/LegalpadDocument.php
@@ -202,8 +202,7 @@
}
public function describeAutomaticCapability($capability) {
- return pht(
- 'The author of a document can always view and edit it.');
+ return pht('The author of a document can always view and edit it.');
}
diff --git a/src/applications/macro/conduit/MacroCreateMemeConduitAPIMethod.php b/src/applications/macro/conduit/MacroCreateMemeConduitAPIMethod.php
--- a/src/applications/macro/conduit/MacroCreateMemeConduitAPIMethod.php
+++ b/src/applications/macro/conduit/MacroCreateMemeConduitAPIMethod.php
@@ -28,7 +28,7 @@
protected function defineErrorTypes() {
return array(
- 'ERR-NOT-FOUND' => 'Macro was not found.',
+ 'ERR-NOT-FOUND' => pht('Macro was not found.'),
);
}
diff --git a/src/applications/macro/conduit/MacroQueryConduitAPIMethod.php b/src/applications/macro/conduit/MacroQueryConduitAPIMethod.php
--- a/src/applications/macro/conduit/MacroQueryConduitAPIMethod.php
+++ b/src/applications/macro/conduit/MacroQueryConduitAPIMethod.php
@@ -7,7 +7,7 @@
}
public function getMethodDescription() {
- return 'Retrieve image macro information.';
+ return pht('Retrieve image macro information.');
}
protected function defineParamTypes() {
diff --git a/src/applications/macro/controller/PhabricatorMacroDisableController.php b/src/applications/macro/controller/PhabricatorMacroDisableController.php
--- a/src/applications/macro/controller/PhabricatorMacroDisableController.php
+++ b/src/applications/macro/controller/PhabricatorMacroDisableController.php
@@ -44,10 +44,14 @@
$dialog
->setUser($request->getUser())
->setTitle(pht('Really disable macro?'))
- ->appendChild(phutil_tag('p', array(), pht(
- 'Really disable the much-beloved image macro %s? '.
- 'It will be sorely missed.',
- $macro->getName())))
+ ->appendChild(
+ phutil_tag(
+ 'p',
+ array(),
+ pht(
+ 'Really disable the much-beloved image macro %s? '.
+ 'It will be sorely missed.',
+ $macro->getName())))
->setSubmitURI($this->getApplicationURI('/disable/'.$this->id.'/'))
->addSubmitButton(pht('Disable'))
->addCancelButton($view_uri);
diff --git a/src/applications/macro/mail/PhabricatorMacroMailReceiver.php b/src/applications/macro/mail/PhabricatorMacroMailReceiver.php
--- a/src/applications/macro/mail/PhabricatorMacroMailReceiver.php
+++ b/src/applications/macro/mail/PhabricatorMacroMailReceiver.php
@@ -3,8 +3,8 @@
final class PhabricatorMacroMailReceiver extends PhabricatorObjectMailReceiver {
public function isEnabled() {
- $app_class = 'PhabricatorManiphestApplication';
- return PhabricatorApplication::isClassInstalled($app_class);
+ return PhabricatorApplication::isClassInstalled(
+ 'PhabricatorManiphestApplication');
}
protected function getObjectPattern() {
diff --git a/src/applications/macro/mail/PhabricatorMacroReplyHandler.php b/src/applications/macro/mail/PhabricatorMacroReplyHandler.php
--- a/src/applications/macro/mail/PhabricatorMacroReplyHandler.php
+++ b/src/applications/macro/mail/PhabricatorMacroReplyHandler.php
@@ -5,7 +5,8 @@
public function validateMailReceiver($mail_receiver) {
if (!($mail_receiver instanceof PhabricatorFileImageMacro)) {
- throw new Exception('Mail receiver is not a PhabricatorFileImageMacro!');
+ throw new Exception(
+ pht('Mail receiver is not a %s!', 'PhabricatorFileImageMacro'));
}
}
diff --git a/src/applications/macro/query/PhabricatorMacroQuery.php b/src/applications/macro/query/PhabricatorMacroQuery.php
--- a/src/applications/macro/query/PhabricatorMacroQuery.php
+++ b/src/applications/macro/query/PhabricatorMacroQuery.php
@@ -170,7 +170,7 @@
case self::STATUS_ANY:
break;
default:
- throw new Exception("Unknown status '{$this->status}'!");
+ throw new Exception(pht("Unknown status '%s'!", $this->status));
}
if ($this->dateCreatedAfter) {
@@ -201,7 +201,7 @@
->execute();
if (empty($flags)) {
- throw new PhabricatorEmptyQueryException('No matching flags.');
+ throw new PhabricatorEmptyQueryException(pht('No matching flags.'));
} else {
$where[] = qsprintf(
$conn,
diff --git a/src/applications/mailinglists/application/PhabricatorMailingListsApplication.php b/src/applications/mailinglists/application/PhabricatorMailingListsApplication.php
--- a/src/applications/mailinglists/application/PhabricatorMailingListsApplication.php
+++ b/src/applications/mailinglists/application/PhabricatorMailingListsApplication.php
@@ -3,7 +3,7 @@
final class PhabricatorMailingListsApplication extends PhabricatorApplication {
public function getName() {
- return 'Mailing Lists';
+ return pht('Mailing Lists');
}
public function getBaseURI() {
@@ -11,7 +11,7 @@
}
public function getShortDescription() {
- return 'Manage External Lists';
+ return pht('Manage External Lists');
}
public function getFontIcon() {
diff --git a/src/applications/maniphest/__tests__/ManiphestTaskTestCase.php b/src/applications/maniphest/__tests__/ManiphestTaskTestCase.php
--- a/src/applications/maniphest/__tests__/ManiphestTaskTestCase.php
+++ b/src/applications/maniphest/__tests__/ManiphestTaskTestCase.php
@@ -95,7 +95,7 @@
$t = array();
for ($ii = 1; $ii < 10; $ii++) {
- $t[$ii] = $this->newTask($viewer, "Task Block {$ii}");
+ $t[$ii] = $this->newTask($viewer, pht('Task Block %d', $ii));
// This makes sure this test remains meaningful if we begin assigning
// subpriorities when tasks are created.
@@ -124,7 +124,7 @@
$this->assertEqual(
9,
count($subpri),
- 'Expected subpriorities to be distributed.');
+ pht('Expected subpriorities to be distributed.'));
}
private function newTask(PhabricatorUser $viewer, $title) {
diff --git a/src/applications/maniphest/command/ManiphestAssignEmailCommand.php b/src/applications/maniphest/command/ManiphestAssignEmailCommand.php
--- a/src/applications/maniphest/command/ManiphestAssignEmailCommand.php
+++ b/src/applications/maniphest/command/ManiphestAssignEmailCommand.php
@@ -17,11 +17,13 @@
public function getCommandDescription() {
return pht(
- 'To assign a task to another user, provide their username. For example, '.
- 'to assign a task to `alincoln`, write `!assign alincoln`.'.
- "\n\n".
- 'If you omit the username or the username is not valid, this behaves '.
- 'like `!claim` and assigns the task to you instead.');
+ "To assign a task to another user, provide their username. For example, ".
+ "to assign a task to `%s`, write `%s`.\n\n".
+ "If you omit the username or the username is not valid, this behaves ".
+ "like `%s` and assigns the task to you instead.",
+ 'alincoln',
+ '!assign alincoln',
+ '!claim');
}
public function buildTransactions(
diff --git a/src/applications/maniphest/command/ManiphestPriorityEmailCommand.php b/src/applications/maniphest/command/ManiphestPriorityEmailCommand.php
--- a/src/applications/maniphest/command/ManiphestPriorityEmailCommand.php
+++ b/src/applications/maniphest/command/ManiphestPriorityEmailCommand.php
@@ -29,12 +29,12 @@
$table = implode("\n", $table);
return pht(
- 'To change the priority of a task, specify the desired priority, like '.
- '`!priority high`. This table shows the configured names for priority '.
- 'levels.'.
+ "To change the priority of a task, specify the desired priority, like ".
+ "`%s`. This table shows the configured names for priority levels.".
"\n\n%s\n\n".
- 'If you specify an invalid priority, the command is ignored. This '.
- 'command has no effect if you do not specify a priority.',
+ "If you specify an invalid priority, the command is ignored. This ".
+ "command has no effect if you do not specify a priority.",
+ '!priority high',
$table);
}
diff --git a/src/applications/maniphest/command/ManiphestStatusEmailCommand.php b/src/applications/maniphest/command/ManiphestStatusEmailCommand.php
--- a/src/applications/maniphest/command/ManiphestStatusEmailCommand.php
+++ b/src/applications/maniphest/command/ManiphestStatusEmailCommand.php
@@ -29,11 +29,11 @@
$table = implode("\n", $table);
return pht(
- 'To change the status of a task, specify the desired status, like '.
- '`!status invalid`. This table shows the configured names for statuses.'.
- "\n\n%s\n\n".
- 'If you specify an invalid status, the command is ignored. This '.
- 'command has no effect if you do not specify a status.',
+ "To change the status of a task, specify the desired status, like ".
+ "`%s`. This table shows the configured names for statuses.\n\n%s\n\n".
+ "If you specify an invalid status, the command is ignored. This ".
+ "command has no effect if you do not specify a status.",
+ '!status invalid',
$table);
}
diff --git a/src/applications/maniphest/conduit/ManiphestConduitAPIMethod.php b/src/applications/maniphest/conduit/ManiphestConduitAPIMethod.php
--- a/src/applications/maniphest/conduit/ManiphestConduitAPIMethod.php
+++ b/src/applications/maniphest/conduit/ManiphestConduitAPIMethod.php
@@ -9,7 +9,7 @@
protected function defineErrorTypes() {
return array(
- 'ERR-INVALID-PARAMETER' => 'Missing or malformed parameter.',
+ 'ERR-INVALID-PARAMETER' => pht('Missing or malformed parameter.'),
);
}
@@ -86,7 +86,7 @@
$valid_statuses = ManiphestTaskStatus::getTaskStatusMap();
if (!isset($valid_statuses[$status])) {
throw id(new ConduitException('ERR-INVALID-PARAMETER'))
- ->setErrorDescription('Status set to invalid value.');
+ ->setErrorDescription(pht('Status set to invalid value.'));
}
$changes[ManiphestTransaction::TYPE_STATUS] = $status;
}
@@ -97,7 +97,7 @@
$valid_priorities = ManiphestTaskPriority::getTaskPriorityMap();
if (!isset($valid_priorities[$priority])) {
throw id(new ConduitException('ERR-INVALID-PARAMETER'))
- ->setErrorDescription('Priority set to invalid value.');
+ ->setErrorDescription(pht('Priority set to invalid value.'));
}
$changes[ManiphestTransaction::TYPE_PRIORITY] = $priority;
}
@@ -313,7 +313,10 @@
unset($phid_groups[$phid_type]);
if (!empty($phid_groups)) {
throw id(new ConduitException('ERR-INVALID-PARAMETER'))
- ->setErrorDescription('One or more PHIDs were invalid for '.$field.'.');
+ ->setErrorDescription(
+ pht(
+ 'One or more PHIDs were invalid for %s.',
+ $field));
}
return true;
diff --git a/src/applications/maniphest/conduit/ManiphestCreateTaskConduitAPIMethod.php b/src/applications/maniphest/conduit/ManiphestCreateTaskConduitAPIMethod.php
--- a/src/applications/maniphest/conduit/ManiphestCreateTaskConduitAPIMethod.php
+++ b/src/applications/maniphest/conduit/ManiphestCreateTaskConduitAPIMethod.php
@@ -8,7 +8,7 @@
}
public function getMethodDescription() {
- return 'Create a new Maniphest task.';
+ return pht('Create a new Maniphest task.');
}
protected function defineParamTypes() {
@@ -21,7 +21,7 @@
protected function defineErrorTypes() {
return array(
- 'ERR-INVALID-PARAMETER' => 'Missing or malformed parameter.',
+ 'ERR-INVALID-PARAMETER' => pht('Missing or malformed parameter.'),
);
}
diff --git a/src/applications/maniphest/conduit/ManiphestGetTaskTransactionsConduitAPIMethod.php b/src/applications/maniphest/conduit/ManiphestGetTaskTransactionsConduitAPIMethod.php
--- a/src/applications/maniphest/conduit/ManiphestGetTaskTransactionsConduitAPIMethod.php
+++ b/src/applications/maniphest/conduit/ManiphestGetTaskTransactionsConduitAPIMethod.php
@@ -8,7 +8,7 @@
}
public function getMethodDescription() {
- return 'Retrieve Maniphest Task Transactions.';
+ return pht('Retrieve Maniphest task transactions.');
}
protected function defineParamTypes() {
diff --git a/src/applications/maniphest/conduit/ManiphestInfoConduitAPIMethod.php b/src/applications/maniphest/conduit/ManiphestInfoConduitAPIMethod.php
--- a/src/applications/maniphest/conduit/ManiphestInfoConduitAPIMethod.php
+++ b/src/applications/maniphest/conduit/ManiphestInfoConduitAPIMethod.php
@@ -7,7 +7,7 @@
}
public function getMethodDescription() {
- return 'Retrieve information about a Maniphest task, given its id.';
+ return pht('Retrieve information about a Maniphest task, given its ID.');
}
protected function defineParamTypes() {
@@ -22,7 +22,7 @@
protected function defineErrorTypes() {
return array(
- 'ERR_BAD_TASK' => 'No such maniphest task exists',
+ 'ERR_BAD_TASK' => pht('No such Maniphest task exists.'),
);
}
diff --git a/src/applications/maniphest/conduit/ManiphestQueryConduitAPIMethod.php b/src/applications/maniphest/conduit/ManiphestQueryConduitAPIMethod.php
--- a/src/applications/maniphest/conduit/ManiphestQueryConduitAPIMethod.php
+++ b/src/applications/maniphest/conduit/ManiphestQueryConduitAPIMethod.php
@@ -7,7 +7,7 @@
}
public function getMethodDescription() {
- return 'Execute complex searches for Maniphest tasks.';
+ return pht('Execute complex searches for Maniphest tasks.');
}
protected function defineParamTypes() {
diff --git a/src/applications/maniphest/conduit/ManiphestQueryStatusesConduitAPIMethod.php b/src/applications/maniphest/conduit/ManiphestQueryStatusesConduitAPIMethod.php
--- a/src/applications/maniphest/conduit/ManiphestQueryStatusesConduitAPIMethod.php
+++ b/src/applications/maniphest/conduit/ManiphestQueryStatusesConduitAPIMethod.php
@@ -8,7 +8,8 @@
}
public function getMethodDescription() {
- return 'Retrieve information about possible Maniphest Task status values.';
+ return pht(
+ 'Retrieve information about possible Maniphest task status values.');
}
protected function defineParamTypes() {
diff --git a/src/applications/maniphest/conduit/ManiphestUpdateConduitAPIMethod.php b/src/applications/maniphest/conduit/ManiphestUpdateConduitAPIMethod.php
--- a/src/applications/maniphest/conduit/ManiphestUpdateConduitAPIMethod.php
+++ b/src/applications/maniphest/conduit/ManiphestUpdateConduitAPIMethod.php
@@ -7,14 +7,14 @@
}
public function getMethodDescription() {
- return 'Update an existing Maniphest task.';
+ return pht('Update an existing Maniphest task.');
}
protected function defineErrorTypes() {
return array(
- 'ERR-BAD-TASK' => 'No such maniphest task exists.',
- 'ERR-INVALID-PARAMETER' => 'Missing or malformed parameter.',
- 'ERR-NO-EFFECT' => 'Update has no effect.',
+ 'ERR-BAD-TASK' => pht('No such Maniphest task exists.'),
+ 'ERR-INVALID-PARAMETER' => pht('Missing or malformed parameter.'),
+ 'ERR-NO-EFFECT' => pht('Update has no effect.'),
);
}
@@ -31,7 +31,11 @@
$phid = $request->getValue('phid');
if (($id && $phid) || (!$id && !$phid)) {
- throw new Exception("Specify exactly one of 'id' and 'phid'.");
+ throw new Exception(
+ pht(
+ "Specify exactly one of '%s' and '%s'.",
+ 'id',
+ 'phid'));
}
$query = id (new ManiphestTaskQuery())
diff --git a/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php b/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php
--- a/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php
+++ b/src/applications/maniphest/config/PhabricatorManiphestConfigOptions.php
@@ -278,7 +278,8 @@
' commands in email.'.
"\n\n".
'You can choose which priority is the default for newly created '.
- 'tasks with `maniphest.default-priority`.')),
+ 'tasks with `%s`.',
+ 'maniphest.default-priority')),
$this->newOption('maniphest.statuses', $status_type, $status_defaults)
->setSummary(pht('Configure Maniphest task statuses.'))
->setDescription($status_description)
@@ -289,8 +290,9 @@
pht(
'Choose a default priority for newly created tasks. You can '.
'review and adjust available priorities by using the '.
- '{{maniphest.priorities}} configuration option. The default value '.
- '(`90`) corresponds to the default "Needs Triage" priority.')),
+ '%s configuration option. The default value (`90`) '.
+ 'corresponds to the default "Needs Triage" priority.',
+ 'maniphest.priorities')),
$this->newOption(
'metamta.maniphest.subject-prefix',
'string',
@@ -306,8 +308,7 @@
->setSummary(pht('DEPRECATED - Allow filing bugs via email.'))
->setDescription(
pht(
- 'This config has been deprecated in favor of [[ '.
- '/applications/view/PhabricatorManiphestApplication/ | '.
+ 'This config has been deprecated in favor of [[ %s | '.
'application settings ]], which allow for multiple email '.
'addresses and other functionality.'."\n\n".
'You can configure an email address like '.
@@ -319,7 +320,8 @@
'address so it routed to Phabricator (if you\'ve already '.
'configured reply handlers, you\'re probably already done). See '.
'"Configuring Inbound Email" in the documentation for more '.
- 'information.')),
+ 'information.',
+ '/applications/view/PhabricatorManiphestApplication/')),
$this->newOption(
'metamta.maniphest.default-public-author',
'string',
@@ -331,22 +333,22 @@
'DEPRECATED - Username anonymous bugs are filed under.'))
->setDescription(
pht(
- 'This config has been deprecated in favor of [[ '.
- '/applications/view/PhabricatorManiphestApplication/ | '.
+ 'This config has been deprecated in favor of [[ %s |'.
'application settings ]], which allow for multiple email '.
'addresses each with its own default author, and other '.
'functionality.'."\n\n".
- 'If you enable `metamta.maniphest.public-create-email` and create '.
- 'an email address like "bugs@phabricator.example.com", it will '.
- 'default to rejecting mail which doesn\'t come from a known user. '.
- 'However, you might want to let anyone send email to this '.
- 'address; to do so, set a default author here (a Phabricator '.
- 'username). A typical use of this might be to create a "System '.
- 'Agent" user called "bugs" and use that name here. If you specify '.
- 'a valid username, mail will always be accepted and used to '.
- 'create a task, even if the sender is not a system user. The '.
- 'original email address will be stored in an `From Email` field '.
- 'on the task.')),
+ 'If you enable `%s` and create an email address like '.
+ '"bugs@phabricator.example.com", it will default to rejecting '.
+ 'mail which doesn\'t come from a known user. However, you might '.
+ 'want to let anyone send email to this address; to do so, set a '.
+ 'default author here (a Phabricator username). A typical use of '.
+ 'this might be to create a "System Agent" user called "bugs" '.
+ 'and use that name here. If you specify a valid username, mail '.
+ 'will always be accepted and used to create a task, even if the '.
+ 'sender is not a system user. The original email address will be '.
+ 'stored in an `From Email` field on the task.',
+ '/applications/view/PhabricatorManiphestApplication/',
+ 'metamta.maniphest.public-create-email')),
$this->newOption(
'maniphest.priorities.unbreak-now',
'int',
@@ -356,7 +358,8 @@
pht(
'Temporary setting. If set, this priority is used to populate the '.
'"Unbreak Now" panel on the home page. You should adjust this if '.
- 'you adjust priorities using `maniphest.priorities`.')),
+ 'you adjust priorities using `%s`.',
+ 'maniphest.priorities')),
$this->newOption(
'maniphest.priorities.needs-triage',
'int',
@@ -366,7 +369,8 @@
pht(
'Temporary setting. If set, this priority is used to populate the '.
'"Needs Triage" panel on the home page. You should adjust this if '.
- 'you adjust priorities using `maniphest.priorities`.')),
+ 'you adjust priorities using `%s`.',
+ 'maniphest.priorities')),
);
}
diff --git a/src/applications/maniphest/controller/ManiphestBatchEditController.php b/src/applications/maniphest/controller/ManiphestBatchEditController.php
--- a/src/applications/maniphest/controller/ManiphestBatchEditController.php
+++ b/src/applications/maniphest/controller/ManiphestBatchEditController.php
@@ -213,7 +213,7 @@
$xactions = array();
foreach ($actions as $action) {
if (empty($type_map[$action['action']])) {
- throw new Exception("Unknown batch edit action '{$action}'!");
+ throw new Exception(pht("Unknown batch edit action '%s'!", $action));
}
$type = $type_map[$action['action']];
diff --git a/src/applications/maniphest/controller/ManiphestExportController.php b/src/applications/maniphest/controller/ManiphestExportController.php
--- a/src/applications/maniphest/controller/ManiphestExportController.php
+++ b/src/applications/maniphest/controller/ManiphestExportController.php
@@ -30,8 +30,9 @@
'administrator install it from:');
$inst2 = pht(
- 'Your PHP "include_path" needs to be updated to include the '.
- 'PHPExcel Classes directory.');
+ 'Your PHP "%s" needs to be updated to include the '.
+ 'PHPExcel Classes directory.',
+ 'include_path');
$dialog->setTitle(pht('Excel Export Not Configured'));
$dialog->appendChild(hsprintf(
@@ -78,8 +79,11 @@
$dialog->setUser($user);
$dialog->setTitle(pht('Export Tasks to Excel'));
- $dialog->appendChild(phutil_tag('p', array(), pht(
- 'Do you want to export the query results to Excel?')));
+ $dialog->appendChild(
+ phutil_tag(
+ 'p',
+ array(),
+ pht('Do you want to export the query results to Excel?')));
$form = id(new PHUIFormLayoutView())
->appendChild(
@@ -97,7 +101,7 @@
$format = idx($formats, $request->getStr('excel-format'));
if ($format === null) {
- throw new Exception('Excel format object not found.');
+ throw new Exception(pht('Excel format object not found.'));
}
$saved->makeEphemeral();
diff --git a/src/applications/maniphest/controller/ManiphestReportController.php b/src/applications/maniphest/controller/ManiphestReportController.php
--- a/src/applications/maniphest/controller/ManiphestReportController.php
+++ b/src/applications/maniphest/controller/ManiphestReportController.php
@@ -607,8 +607,8 @@
array(
'sigil' => 'has-tooltip',
'meta' => array(
- 'tip' => pht('Oldest open task, excluding those with Low or '.
- 'Wishlist priority.'),
+ 'tip' => pht(
+ 'Oldest open task, excluding those with Low or Wishlist priority.'),
'size' => 200,
),
),
diff --git a/src/applications/maniphest/controller/ManiphestTransactionSaveController.php b/src/applications/maniphest/controller/ManiphestTransactionSaveController.php
--- a/src/applications/maniphest/controller/ManiphestTransactionSaveController.php
+++ b/src/applications/maniphest/controller/ManiphestTransactionSaveController.php
@@ -68,7 +68,7 @@
$transaction = null;
break;
default:
- throw new Exception('unknown action');
+ throw new Exception(pht("Unknown action '%s'!", $action));
}
if ($transaction) {
diff --git a/src/applications/maniphest/editor/ManiphestTransactionEditor.php b/src/applications/maniphest/editor/ManiphestTransactionEditor.php
--- a/src/applications/maniphest/editor/ManiphestTransactionEditor.php
+++ b/src/applications/maniphest/editor/ManiphestTransactionEditor.php
@@ -167,14 +167,18 @@
$board_phid = idx($xaction->getNewValue(), 'projectPHID');
if (!$board_phid) {
throw new Exception(
- pht("Expected 'projectPHID' in column transaction."));
+ pht(
+ "Expected '%s' in column transaction.",
+ 'projectPHID'));
}
$old_phids = idx($xaction->getOldValue(), 'columnPHIDs', array());
$new_phids = idx($xaction->getNewValue(), 'columnPHIDs', array());
if (count($new_phids) !== 1) {
throw new Exception(
- pht("Expected exactly one 'columnPHIDs' in column transaction."));
+ pht(
+ "Expected exactly one '%s' in column transaction.",
+ 'columnPHIDs'));
}
$columns = id(new PhabricatorProjectColumnQuery())
diff --git a/src/applications/maniphest/mail/ManiphestCreateMailReceiver.php b/src/applications/maniphest/mail/ManiphestCreateMailReceiver.php
--- a/src/applications/maniphest/mail/ManiphestCreateMailReceiver.php
+++ b/src/applications/maniphest/mail/ManiphestCreateMailReceiver.php
@@ -3,8 +3,8 @@
final class ManiphestCreateMailReceiver extends PhabricatorMailReceiver {
public function isEnabled() {
- $app_class = 'PhabricatorManiphestApplication';
- return PhabricatorApplication::isClassInstalled($app_class);
+ return PhabricatorApplication::isClassInstalled(
+ 'PhabricatorManiphestApplication');
}
public function canAcceptMail(PhabricatorMetaMTAReceivedMail $mail) {
diff --git a/src/applications/maniphest/mail/ManiphestReplyHandler.php b/src/applications/maniphest/mail/ManiphestReplyHandler.php
--- a/src/applications/maniphest/mail/ManiphestReplyHandler.php
+++ b/src/applications/maniphest/mail/ManiphestReplyHandler.php
@@ -5,7 +5,7 @@
public function validateMailReceiver($mail_receiver) {
if (!($mail_receiver instanceof ManiphestTask)) {
- throw new Exception('Mail receiver is not a ManiphestTask!');
+ throw new Exception(pht('Mail receiver is not a %s!', 'ManiphestTask'));
}
}
diff --git a/src/applications/maniphest/mail/ManiphestTaskMailReceiver.php b/src/applications/maniphest/mail/ManiphestTaskMailReceiver.php
--- a/src/applications/maniphest/mail/ManiphestTaskMailReceiver.php
+++ b/src/applications/maniphest/mail/ManiphestTaskMailReceiver.php
@@ -3,8 +3,8 @@
final class ManiphestTaskMailReceiver extends PhabricatorObjectMailReceiver {
public function isEnabled() {
- $app_class = 'PhabricatorManiphestApplication';
- return PhabricatorApplication::isClassInstalled($app_class);
+ return PhabricatorApplication::isClassInstalled(
+ 'PhabricatorManiphestApplication');
}
protected function getObjectPattern() {
diff --git a/src/applications/maniphest/query/ManiphestTaskQuery.php b/src/applications/maniphest/query/ManiphestTaskQuery.php
--- a/src/applications/maniphest/query/ManiphestTaskQuery.php
+++ b/src/applications/maniphest/query/ManiphestTaskQuery.php
@@ -487,7 +487,7 @@
default:
$constant = idx($map, $this->status);
if (!$constant) {
- throw new Exception("Unknown status query '{$this->status}'!");
+ throw new Exception(pht("Unknown status query '%s'!", $this->status));
}
return qsprintf(
$conn,
diff --git a/src/applications/maniphest/view/ManiphestTaskResultListView.php b/src/applications/maniphest/view/ManiphestTaskResultListView.php
--- a/src/applications/maniphest/view/ManiphestTaskResultListView.php
+++ b/src/applications/maniphest/view/ManiphestTaskResultListView.php
@@ -233,7 +233,7 @@
'disabled' => 'disabled',
'class' => 'disabled',
),
- pht("Batch Edit Selected \xC2\xBB"));
+ pht('Batch Edit Selected')." \xC2\xBB");
$export = javelin_tag(
'a',
diff --git a/src/applications/meta/controller/PhabricatorApplicationEmailCommandsController.php b/src/applications/meta/controller/PhabricatorApplicationEmailCommandsController.php
--- a/src/applications/meta/controller/PhabricatorApplicationEmailCommandsController.php
+++ b/src/applications/meta/controller/PhabricatorApplicationEmailCommandsController.php
@@ -42,37 +42,26 @@
"\n\n".
'In most cases, you can reply to email you receive from Phabricator '.
'to leave comments. You can also use **mail commands** to take a '.
- 'greater range of actions (like claming a task or requesting changes '.
+ 'greater range of actions (like claiming a task or requesting changes '.
'to a revision) without needing to log in to the web UI.'.
"\n\n".
'Mail commands are keywords which start with an exclamation point, '.
- 'like `!claim`. Some commands may take parameters, like '.
- '`!assign alincoln`.'.
+ 'like `%s`. Some commands may take parameters, like `%s`.'.
"\n\n".
'To use mail commands, write one command per line at the beginning '.
'or end of your mail message. For example, you could write this in a '.
'reply to task email to claim the task:'.
- "\n\n".
-
- "```\n".
- "!claim\n".
- "\n".
- "I'll take care of this.\n".
- "```\n".
-
- "\n\n".
+ "\n\n%s\n\n".
"When Phabricator receives your mail, it will process any commands ".
"first, then post the remaining message body as a comment. You can ".
"execute multiple commands at once:".
- "\n\n".
-
- "```\n".
- "!assign alincoln\n".
- "!close\n".
- "\n".
- "I just talked to @alincoln, and he showed me that he fixed this.\n".
- "```\n",
- PhabricatorEnv::getDoclink('Configuring Inbound Email'));
+ "\n\n%s",
+ PhabricatorEnv::getDoclink('Configuring Inbound Email'),
+ '!claim',
+ '!assign alincoln',
+ "```\n!claim\n\nI'll take care of this.\n```\n",
+ "```\n!assign alincoln\n!close\n\nI just talked to @alincoln, ".
+ "and he showed me that he fixed this.\n```\n");
$content[] = '= '.$spec['header'];
$content[] = $spec['summary'];
diff --git a/src/applications/meta/controller/PhabricatorApplicationUninstallController.php b/src/applications/meta/controller/PhabricatorApplicationUninstallController.php
--- a/src/applications/meta/controller/PhabricatorApplicationUninstallController.php
+++ b/src/applications/meta/controller/PhabricatorApplicationUninstallController.php
@@ -31,8 +31,8 @@
'phabricator.show-prototypes');
$dialog = id(new AphrontDialogView())
- ->setUser($user)
- ->addCancelButton($view_uri);
+ ->setUser($user)
+ ->addCancelButton($view_uri);
if ($selected->isPrototype() && !$prototypes_enabled) {
$dialog
@@ -52,14 +52,18 @@
if ($this->action == 'install') {
if ($selected->canUninstall()) {
- $dialog->setTitle('Confirmation')
- ->appendChild(
- 'Install '.$selected->getName().' application?')
- ->addSubmitButton('Install');
+ $dialog
+ ->setTitle('Confirmation')
+ ->appendChild(
+ pht(
+ 'Install %s application?',
+ $selected->getName()))
+ ->addSubmitButton('Install');
} else {
- $dialog->setTitle('Information')
- ->appendChild('You cannot install an installed application.');
+ $dialog
+ ->setTitle('Information')
+ ->appendChild('You cannot install an installed application.');
}
} else {
if ($selected->canUninstall()) {
@@ -86,10 +90,12 @@
->addSubmitButton(pht('Uninstall'));
}
} else {
- $dialog->setTitle('Information')
- ->appendChild(
- 'This application cannot be uninstalled,
- because it is required for Phabricator to work.');
+ $dialog
+ ->setTitle(pht('Information'))
+ ->appendChild(
+ pht(
+ 'This application cannot be uninstalled, '.
+ 'because it is required for Phabricator to work.'));
}
}
return id(new AphrontDialogResponse())->setDialog($dialog);
diff --git a/src/applications/metamta/adapter/PhabricatorMailImplementationTestAdapter.php b/src/applications/metamta/adapter/PhabricatorMailImplementationTestAdapter.php
--- a/src/applications/metamta/adapter/PhabricatorMailImplementationTestAdapter.php
+++ b/src/applications/metamta/adapter/PhabricatorMailImplementationTestAdapter.php
@@ -81,12 +81,12 @@
public function send() {
if (!empty($this->guts['fail-permanently'])) {
throw new PhabricatorMetaMTAPermanentFailureException(
- 'Unit Test (Permanent)');
+ pht('Unit Test (Permanent)'));
}
if (!empty($this->guts['fail-temporarily'])) {
throw new Exception(
- 'Unit Test (Temporary)');
+ pht('Unit Test (Temporary)'));
}
$this->guts['did-send'] = true;
diff --git a/src/applications/metamta/contentsource/PhabricatorContentSourceView.php b/src/applications/metamta/contentsource/PhabricatorContentSourceView.php
--- a/src/applications/metamta/contentsource/PhabricatorContentSourceView.php
+++ b/src/applications/metamta/contentsource/PhabricatorContentSourceView.php
@@ -26,7 +26,7 @@
array(
'class' => 'phabricator-content-source-view',
),
- "Via {$type}");
+ pht('Via %s', $type));
}
}
diff --git a/src/applications/metamta/controller/PhabricatorMetaMTASendGridReceiveController.php b/src/applications/metamta/controller/PhabricatorMetaMTASendGridReceiveController.php
--- a/src/applications/metamta/controller/PhabricatorMetaMTASendGridReceiveController.php
+++ b/src/applications/metamta/controller/PhabricatorMetaMTASendGridReceiveController.php
@@ -55,7 +55,7 @@
$received->processReceivedMail();
$response = new AphrontWebpageResponse();
- $response->setContent(pht("Got it! Thanks, SendGrid!\n"));
+ $response->setContent(pht('Got it! Thanks, SendGrid!')."\n");
return $response;
}
diff --git a/src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php
--- a/src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php
+++ b/src/applications/metamta/management/PhabricatorMailManagementListInboundWorkflow.php
@@ -6,7 +6,7 @@
protected function didConstruct() {
$this
->setName('list-inbound')
- ->setSynopsis('List inbound messages received by Phabricator.')
+ ->setSynopsis(pht('List inbound messages received by Phabricator.'))
->setExamples(
'**list-inbound**')
->setArguments(
@@ -15,7 +15,8 @@
'name' => 'limit',
'param' => 'N',
'default' => 100,
- 'help' => 'Show a specific number of messages (default 100).',
+ 'help' => pht(
+ 'Show a specific number of messages (default 100).'),
),
));
}
@@ -43,10 +44,10 @@
$table = id(new PhutilConsoleTable())
->setShowHeader(false)
- ->addColumn('id', array('title' => 'ID'))
- ->addColumn('author', array('title' => 'Author'))
- ->addColumn('phid', array('title' => 'Related PHID'))
- ->addColumn('subject', array('title' => 'Subject'));
+ ->addColumn('id', array('title' => pht('ID')))
+ ->addColumn('author', array('title' => pht('Author')))
+ ->addColumn('phid', array('title' => pht('Related PHID')))
+ ->addColumn('subject', array('title' => pht('Subject')));
foreach (array_reverse($mails) as $mail) {
$table->addRow(array(
diff --git a/src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php
--- a/src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php
+++ b/src/applications/metamta/management/PhabricatorMailManagementListOutboundWorkflow.php
@@ -6,7 +6,7 @@
protected function didConstruct() {
$this
->setName('list-outbound')
- ->setSynopsis('List outbound messages sent by Phabricator.')
+ ->setSynopsis(pht('List outbound messages sent by Phabricator.'))
->setExamples(
'**list-outbound**')
->setArguments(
@@ -15,7 +15,8 @@
'name' => 'limit',
'param' => 'N',
'default' => 100,
- 'help' => 'Show a specific number of messages (default 100).',
+ 'help' => pht(
+ 'Show a specific number of messages (default 100).'),
),
));
}
@@ -35,9 +36,9 @@
$table = id(new PhutilConsoleTable())
->setShowHeader(false)
- ->addColumn('id', array('title' => 'ID'))
- ->addColumn('status', array('title' => 'Status'))
- ->addColumn('subject', array('title' => 'Subject'));
+ ->addColumn('id', array('title' => pht('ID')))
+ ->addColumn('status', array('title' => pht('Status')))
+ ->addColumn('subject', array('title' => pht('Subject')));
foreach (array_reverse($mails) as $mail) {
$status = $mail->getStatus();
diff --git a/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
--- a/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
+++ b/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php
@@ -10,51 +10,50 @@
pht(
'Simulate sending mail. This may be useful to test your mail '.
'configuration, or while developing new mail adapters.'))
- ->setExamples(
- '**send-test** --to alincoln --subject hi < body.txt')
+ ->setExamples('**send-test** --to alincoln --subject hi < body.txt')
->setArguments(
array(
array(
'name' => 'from',
'param' => 'user',
- 'help' => 'Send mail from the specified user.',
+ 'help' => pht('Send mail from the specified user.'),
),
array(
'name' => 'to',
'param' => 'user',
- 'help' => 'Send mail "To:" the specified users.',
+ 'help' => pht('Send mail "To:" the specified users.'),
'repeat' => true,
),
array(
'name' => 'cc',
'param' => 'user',
- 'help' => 'Send mail which "Cc:"s the specified users.',
+ 'help' => pht('Send mail which "Cc:"s the specified users.'),
'repeat' => true,
),
array(
'name' => 'subject',
'param' => 'text',
- 'help' => 'Use the provided subject.',
+ 'help' => pht('Use the provided subject.'),
),
array(
'name' => 'tag',
'param' => 'text',
- 'help' => 'Add the given mail tags.',
+ 'help' => pht('Add the given mail tags.'),
'repeat' => true,
),
array(
'name' => 'attach',
'param' => 'file',
- 'help' => 'Attach a file.',
+ 'help' => pht('Attach a file.'),
'repeat' => true,
),
array(
'name' => 'html',
- 'help' => 'Send as HTML mail.',
+ 'help' => pht('Send as HTML mail.'),
),
array(
'name' => 'bulk',
- 'help' => 'Send with bulk headers.',
+ 'help' => pht('Send with bulk headers.'),
),
));
}
@@ -82,8 +81,9 @@
if (!$tos && !$ccs) {
throw new PhutilArgumentUsageException(
pht(
- 'Specify one or more users to send mail to with `--to` and '.
- '`--cc`.'));
+ 'Specify one or more users to send mail to with `%s` and `%s`.',
+ '--to',
+ '--cc'));
}
$names = array_merge($tos, $ccs);
@@ -131,8 +131,10 @@
if ($args->getArg('html')) {
$mail->setBody(
- pht('(This is a placeholder plaintext email body for a test message '.
- 'sent with --html.)'));
+ pht(
+ '(This is a placeholder plaintext email body for a test message '.
+ 'sent with %s.)',
+ '--html'));
$mail->setHTMLBody($body);
} else {
diff --git a/src/applications/metamta/management/PhabricatorMailManagementShowInboundWorkflow.php b/src/applications/metamta/management/PhabricatorMailManagementShowInboundWorkflow.php
--- a/src/applications/metamta/management/PhabricatorMailManagementShowInboundWorkflow.php
+++ b/src/applications/metamta/management/PhabricatorMailManagementShowInboundWorkflow.php
@@ -6,7 +6,7 @@
protected function didConstruct() {
$this
->setName('show-inbound')
- ->setSynopsis('Show diagnostic details about inbound mail.')
+ ->setSynopsis(pht('Show diagnostic details about inbound mail.'))
->setExamples(
'**show-inbound** --id 1 --id 2')
->setArguments(
@@ -14,7 +14,7 @@
array(
'name' => 'id',
'param' => 'id',
- 'help' => 'Show details about inbound mail with given ID.',
+ 'help' => pht('Show details about inbound mail with given ID.'),
'repeat' => true,
),
));
@@ -26,7 +26,9 @@
$ids = $args->getArg('id');
if (!$ids) {
throw new PhutilArgumentUsageException(
- "Use the '--id' flag to specify one or more messages to show.");
+ pht(
+ "Use the '%s' flag to specify one or more messages to show.",
+ '--id'));
}
$messages = id(new PhabricatorMetaMTAReceivedMail())->loadAllWhere(
@@ -38,8 +40,9 @@
$missing = array_diff_key($ids, $messages);
if ($missing) {
throw new PhutilArgumentUsageException(
- 'Some specified messages do not exist: '.
- implode(', ', array_keys($missing)));
+ pht(
+ 'Some specified messages do not exist: %s',
+ implode(', ', array_keys($missing))));
}
}
diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php
--- a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php
+++ b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php
@@ -390,7 +390,7 @@
if (!$force_send) {
if ($this->getStatus() != self::STATUS_QUEUE) {
- throw new Exception('Trying to send an already-sent mail!');
+ throw new Exception(pht('Trying to send an already-sent mail!'));
}
}
@@ -622,8 +622,9 @@
if (!$add_to && !$add_cc) {
$this->setStatus(self::STATUS_VOID);
$this->setMessage(
- 'Message has no valid recipients: all To/Cc are disabled, invalid, '.
- 'or configured not to receive this mail.');
+ pht(
+ 'Message has no valid recipients: all To/Cc are disabled, '.
+ 'invalid, or configured not to receive this mail.'));
return $this->save();
}
@@ -644,8 +645,9 @@
$this->setStatus(self::STATUS_VOID);
$this->setMessage(
pht(
- 'Phabricator is running in silent mode. See `phabricator.silent` '.
- 'in the configuration to change this setting.'));
+ 'Phabricator is running in silent mode. See `%s` '.
+ 'in the configuration to change this setting.',
+ 'phabricator.silent'));
return $this->save();
}
@@ -727,11 +729,11 @@
}
public static function getReadableStatus($status_code) {
- static $readable = array(
- self::STATUS_QUEUE => 'Queued for Delivery',
- self::STATUS_FAIL => 'Delivery Failed',
- self::STATUS_SENT => 'Sent',
- self::STATUS_VOID => 'Void',
+ $readable = array(
+ self::STATUS_QUEUE => pht('Queued for Delivery'),
+ self::STATUS_FAIL => pht('Delivery Failed'),
+ self::STATUS_SENT => pht('Sent'),
+ self::STATUS_VOID => pht('Void'),
);
$status_code = coalesce($status_code, '?');
return idx($readable, $status_code, $status_code);
diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php
--- a/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php
+++ b/src/applications/metamta/storage/PhabricatorMetaMTAReceivedMail.php
@@ -220,8 +220,8 @@
throw new PhabricatorMetaMTAReceivedMailProcessingException(
MetaMTAReceivedMailStatus::STATUS_FROM_PHABRICATOR,
pht(
- "Ignoring email with 'X-Phabricator-Sent-This-Message' header to ".
- "avoid loops."));
+ "Ignoring email with '%s' header to avoid loops.",
+ 'X-Phabricator-Sent-This-Message'));
}
/**
diff --git a/src/applications/multimeter/data/MultimeterControl.php b/src/applications/multimeter/data/MultimeterControl.php
--- a/src/applications/multimeter/data/MultimeterControl.php
+++ b/src/applications/multimeter/data/MultimeterControl.php
@@ -88,7 +88,10 @@
}
if ($this->sampleRate === null) {
- throw new Exception(pht('Call setSampleRate() before saving events!'));
+ throw new Exception(
+ pht(
+ 'Call %s before saving events!',
+ 'setSampleRate()'));
}
$this->addServiceEvents();
diff --git a/src/applications/notification/controller/PhabricatorNotificationStatusController.php b/src/applications/notification/controller/PhabricatorNotificationStatusController.php
--- a/src/applications/notification/controller/PhabricatorNotificationStatusController.php
+++ b/src/applications/notification/controller/PhabricatorNotificationStatusController.php
@@ -9,13 +9,13 @@
$status = $this->renderServerStatus($status);
} catch (Exception $ex) {
$status = new PHUIInfoView();
- $status->setTitle('Notification Server Issue');
+ $status->setTitle(pht('Notification Server Issue'));
$status->appendChild(hsprintf(
- 'Unable to determine server status. This probably means the server '.
- 'is not in great shape. The specific issue encountered was:'.
- '<br />'.
- '<br />'.
+ '%s<br /><br />'.
'<strong>%s</strong> %s',
+ pht(
+ 'Unable to determine server status. This probably means the server '.
+ 'is not in great shape. The specific issue encountered was:'),
get_class($ex),
phutil_escape_html_newlines($ex->getMessage())));
}
diff --git a/src/applications/notification/setup/PhabricatorAphlictSetupCheck.php b/src/applications/notification/setup/PhabricatorAphlictSetupCheck.php
--- a/src/applications/notification/setup/PhabricatorAphlictSetupCheck.php
+++ b/src/applications/notification/setup/PhabricatorAphlictSetupCheck.php
@@ -13,12 +13,10 @@
$status = PhabricatorNotificationClient::getServerStatus();
} catch (Exception $ex) {
$message = pht(
- 'Phabricator is configured to use a notification server, but '.
- 'is unable to connect to it. You should resolve this issue or '.
- 'disable the notification server. It may be helpful to double check '.
- 'your configuration or restart the server using the command below.'.
- "\n\n".
- "%s",
+ "Phabricator is configured to use a notification server, but is ".
+ "unable to connect to it. You should resolve this issue or disable ".
+ "the notification server. It may be helpful to double check your ".
+ "configuration or restart the server using the command below.\n\n%s",
phutil_tag(
'pre',
array(),
diff --git a/src/applications/nuance/controller/NuanceQueueViewController.php b/src/applications/nuance/controller/NuanceQueueViewController.php
--- a/src/applications/nuance/controller/NuanceQueueViewController.php
+++ b/src/applications/nuance/controller/NuanceQueueViewController.php
@@ -31,7 +31,7 @@
}
$crumbs = $this->buildApplicationCrumbs();
- $title = 'TODO';
+ $title = pht('TODO');
return $this->buildApplicationPage(
$crumbs,
diff --git a/src/applications/nuance/controller/NuanceRequestorEditController.php b/src/applications/nuance/controller/NuanceRequestorEditController.php
--- a/src/applications/nuance/controller/NuanceRequestorEditController.php
+++ b/src/applications/nuance/controller/NuanceRequestorEditController.php
@@ -38,7 +38,7 @@
}
$crumbs = $this->buildApplicationCrumbs();
- $title = 'TODO';
+ $title = pht('TODO');
return $this->buildApplicationPage(
$crumbs,
diff --git a/src/applications/nuance/source/NuancePhabricatorFormSourceDefinition.php b/src/applications/nuance/source/NuancePhabricatorFormSourceDefinition.php
--- a/src/applications/nuance/source/NuancePhabricatorFormSourceDefinition.php
+++ b/src/applications/nuance/source/NuancePhabricatorFormSourceDefinition.php
@@ -20,7 +20,7 @@
PhabricatorApplicationTransactionValidationException $ex = null) {
/* TODO - add a box to allow for custom fields to be defined here, so that
- * these NuanceSource objects made from this defintion can be used to
+ * these NuanceSource objects made from this definition can be used to
* capture arbitrary data */
return $form;
diff --git a/src/applications/oauthserver/PhabricatorOAuthServer.php b/src/applications/oauthserver/PhabricatorOAuthServer.php
--- a/src/applications/oauthserver/PhabricatorOAuthServer.php
+++ b/src/applications/oauthserver/PhabricatorOAuthServer.php
@@ -36,7 +36,11 @@
private function getUser() {
if (!$this->user) {
- throw new Exception('You must setUser before you can getUser!');
+ throw new Exception(
+ pht(
+ 'You must %s before you can %s!',
+ 'setUser',
+ __FUNCTION__));
}
return $this->user;
}
@@ -48,7 +52,11 @@
private function getClient() {
if (!$this->client) {
- throw new Exception('You must setClient before you can getClient!');
+ throw new Exception(
+ pht(
+ 'You must %s before you can %s!',
+ 'setClient',
+ __FUNCTION__));
}
return $this->client;
}
@@ -65,16 +73,16 @@
public function userHasAuthorizedClient(array $scope) {
$authorization = id(new PhabricatorOAuthClientAuthorization())->
- loadOneWhere('userPHID = %s AND clientPHID = %s',
- $this->getUser()->getPHID(),
- $this->getClient()->getPHID());
+ loadOneWhere(
+ 'userPHID = %s AND clientPHID = %s',
+ $this->getUser()->getPHID(),
+ $this->getClient()->getPHID());
if (empty($authorization)) {
return array(false, null);
}
if ($scope) {
- $missing_scope = array_diff_key($scope,
- $authorization->getScope());
+ $missing_scope = array_diff_key($scope, $authorization->getScope());
} else {
$missing_scope = false;
}
@@ -166,10 +174,10 @@
$must_be_used_by = $created_time + self::ACCESS_TOKEN_TIMEOUT;
$expired = time() > $must_be_used_by;
$authorization = id(new PhabricatorOAuthClientAuthorization())
- ->loadOneWhere(
- 'userPHID = %s AND clientPHID = %s',
- $token->getUserPHID(),
- $token->getClientPHID());
+ ->loadOneWhere(
+ 'userPHID = %s AND clientPHID = %s',
+ $token->getUserPHID(),
+ $token->getClientPHID());
if (!$authorization) {
return false;
diff --git a/src/applications/oauthserver/PhabricatorOAuthServerScope.php b/src/applications/oauthserver/PhabricatorOAuthServerScope.php
--- a/src/applications/oauthserver/PhabricatorOAuthServerScope.php
+++ b/src/applications/oauthserver/PhabricatorOAuthServerScope.php
@@ -60,10 +60,10 @@
$label = null;
switch ($scope) {
case self::SCOPE_OFFLINE_ACCESS:
- $label = 'Make access tokens granted to this client never expire.';
+ $label = pht('Make access tokens granted to this client never expire.');
break;
case self::SCOPE_WHOAMI:
- $label = 'Read access to Conduit method user.whoami.';
+ $label = pht('Read access to Conduit method %s.', 'user.whoami');
break;
}
diff --git a/src/applications/oauthserver/__tests__/PhabricatorOAuthServerTestCase.php b/src/applications/oauthserver/__tests__/PhabricatorOAuthServerTestCase.php
--- a/src/applications/oauthserver/__tests__/PhabricatorOAuthServerTestCase.php
+++ b/src/applications/oauthserver/__tests__/PhabricatorOAuthServerTestCase.php
@@ -18,7 +18,7 @@
$this->assertEqual(
$expected,
$result,
- "Validation of redirect URI '{$input}'");
+ pht("Validation of redirect URI '%s'", $input));
}
}
@@ -39,8 +39,10 @@
$this->assertEqual(
$expected,
$server->validateSecondaryRedirectURI($uri, $primary_uri),
- "Validation of redirect URI '{$input}' ".
- "relative to '{$primary_uri}'");
+ pht(
+ "Validation of redirect URI '%s' relative to '%s'",
+ $input,
+ $primary_uri));
}
$primary_uri = new PhutilURI('http://www.google.com/?auth');
@@ -57,8 +59,10 @@
$this->assertEqual(
$expected,
$server->validateSecondaryRedirectURI($uri, $primary_uri),
- "Validation of secondary redirect URI '{$input}' ".
- "relative to '{$primary_uri}'");
+ pht(
+ "Validation of secondary redirect URI '%s' relative to '%s'",
+ $input,
+ $primary_uri));
}
$primary_uri = new PhutilURI('https://secure.example.com/');
@@ -71,7 +75,7 @@
$this->assertEqual(
$expected,
$server->validateSecondaryRedirectURI($uri, $primary_uri),
- "Validation (https): {$input}");
+ pht('Validation (https): %s', $input));
}
$primary_uri = new PhutilURI('http://example.com/?z=2&y=3');
@@ -88,7 +92,7 @@
$this->assertEqual(
$expected,
$server->validateSecondaryRedirectURI($uri, $primary_uri),
- "Validation (params): {$input}");
+ pht('Validation (params): %s', $input));
}
}
diff --git a/src/applications/oauthserver/controller/PhabricatorOAuthServerController.php b/src/applications/oauthserver/controller/PhabricatorOAuthServerController.php
--- a/src/applications/oauthserver/controller/PhabricatorOAuthServerController.php
+++ b/src/applications/oauthserver/controller/PhabricatorOAuthServerController.php
@@ -12,17 +12,13 @@
$nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI('/oauthserver/'));
- $nav->addLabel('Clients');
- $nav->addFilter('client/create',
- 'Create Client');
+ $nav->addLabel(pht('Clients'));
+ $nav->addFilter('client/create', pht('Create Client'));
foreach ($this->getExtraClientFilters() as $filter) {
- $nav->addFilter($filter['url'],
- $filter['label']);
+ $nav->addFilter($filter['url'], $filter['label']);
}
- $nav->addFilter('client',
- 'My Clients');
- $nav->selectFilter($this->getFilter(),
- 'clientauthorization');
+ $nav->addFilter('client', pht('My Clients'));
+ $nav->selectFilter($this->getFilter(), 'clientauthorization');
$nav->appendChild($view);
diff --git a/src/applications/oauthserver/controller/PhabricatorOAuthServerTokenController.php b/src/applications/oauthserver/controller/PhabricatorOAuthServerTokenController.php
--- a/src/applications/oauthserver/controller/PhabricatorOAuthServerTokenController.php
+++ b/src/applications/oauthserver/controller/PhabricatorOAuthServerTokenController.php
@@ -26,25 +26,31 @@
if ($grant_type != 'authorization_code') {
$response->setError('unsupported_grant_type');
$response->setErrorDescription(
- 'Only grant_type authorization_code is supported.');
+ pht(
+ 'Only %s %s is supported.',
+ 'grant_type',
+ 'authorization_code'));
return $response;
}
if (!$code) {
$response->setError('invalid_request');
- $response->setErrorDescription(
- 'Required parameter code missing.');
+ $response->setErrorDescription(pht('Required parameter code missing.'));
return $response;
}
if (!$client_phid) {
$response->setError('invalid_request');
$response->setErrorDescription(
- 'Required parameter client_id missing.');
+ pht(
+ 'Required parameter %s missing.',
+ 'client_id'));
return $response;
}
if (!$client_secret) {
$response->setError('invalid_request');
$response->setErrorDescription(
- 'Required parameter client_secret missing.');
+ pht(
+ 'Required parameter %s missing.',
+ 'client_secret'));
return $response;
}
// one giant try / catch around all the exciting database stuff so we
@@ -56,7 +62,9 @@
if (!$auth_code) {
$response->setError('invalid_grant');
$response->setErrorDescription(
- 'Authorization code '.$code.' not found.');
+ pht(
+ 'Authorization code %d not found.',
+ $code));
return $response;
}
@@ -70,25 +78,29 @@
$redirect_uri != $auth_code_redirect_uri) {
$response->setError('invalid_grant');
$response->setErrorDescription(
- 'Redirect uri in request must exactly match redirect uri '.
- 'from authorization code.');
+ pht(
+ 'Redirect URI in request must exactly match redirect URI '.
+ 'from authorization code.'));
return $response;
}
} else if ($redirect_uri) {
$response->setError('invalid_grant');
$response->setErrorDescription(
- 'Redirect uri in request and no redirect uri in authorization '.
- 'code. The two must exactly match.');
+ pht(
+ 'Redirect URI in request and no redirect URI in authorization '.
+ 'code. The two must exactly match.'));
return $response;
}
$client = id(new PhabricatorOAuthServerClient())
- ->loadOneWhere('phid = %s',
- $client_phid);
+ ->loadOneWhere('phid = %s', $client_phid);
if (!$client) {
$response->setError('invalid_client');
$response->setErrorDescription(
- 'Client with client_id '.$client_phid.' not found.');
+ pht(
+ 'Client with %s %d not found.',
+ 'client_id',
+ $client_phid));
return $response;
}
$server->setClient($client);
@@ -99,7 +111,9 @@
if (!$user) {
$response->setError('invalid_grant');
$response->setErrorDescription(
- 'User with phid '.$user_phid.' not found.');
+ pht(
+ 'User with PHID %d not found.',
+ $user_phid));
return $response;
}
$server->setUser($user);
@@ -107,12 +121,15 @@
$test_code = new PhabricatorOAuthServerAuthorizationCode();
$test_code->setClientSecret($client_secret);
$test_code->setClientPHID($client_phid);
- $is_good_code = $server->validateAuthorizationCode($auth_code,
- $test_code);
+ $is_good_code = $server->validateAuthorizationCode(
+ $auth_code,
+ $test_code);
if (!$is_good_code) {
$response->setError('invalid_grant');
$response->setErrorDescription(
- 'Invalid authorization code '.$code.'.');
+ pht(
+ 'Invalid authorization code %d.',
+ $code));
return $response;
}
@@ -129,8 +146,9 @@
} catch (Exception $e) {
$response->setError('server_error');
$response->setErrorDescription(
- 'The authorization server encountered an unexpected condition '.
- 'which prevented it from fulfilling the request.');
+ pht(
+ 'The authorization server encountered an unexpected condition '.
+ 'which prevented it from fulfilling the request.'));
return $response;
}
}
diff --git a/src/applications/oauthserver/controller/client/PhabricatorOAuthClientEditController.php b/src/applications/oauthserver/controller/client/PhabricatorOAuthClientEditController.php
--- a/src/applications/oauthserver/controller/client/PhabricatorOAuthClientEditController.php
+++ b/src/applications/oauthserver/controller/client/PhabricatorOAuthClientEditController.php
@@ -82,13 +82,13 @@
->setUser($viewer)
->appendChild(
id(new AphrontFormTextControl())
- ->setLabel('Name')
+ ->setLabel(pht('Name'))
->setName('name')
->setValue($client->getName())
->setError($e_name))
->appendChild(
id(new AphrontFormTextControl())
- ->setLabel('Redirect URI')
+ ->setLabel(pht('Redirect URI'))
->setName('redirect_uri')
->setValue($client->getRedirectURI())
->setError($e_redirect))
diff --git a/src/applications/oauthserver/controller/client/PhabricatorOAuthClientSecretController.php b/src/applications/oauthserver/controller/client/PhabricatorOAuthClientSecretController.php
--- a/src/applications/oauthserver/controller/client/PhabricatorOAuthClientSecretController.php
+++ b/src/applications/oauthserver/controller/client/PhabricatorOAuthClientSecretController.php
@@ -50,11 +50,11 @@
if ($is_serious) {
$body = pht(
- 'The secret associated with this oauth application will be shown in '.
+ 'The secret associated with this OAuth application will be shown in '.
'plain text on your screen.');
} else {
$body = pht(
- 'The secret associated with this oauth application will be shown in '.
+ 'The secret associated with this OAuth application will be shown in '.
'plain text on your screen. Before continuing, wrap your arms around '.
'your monitor to create a human shield, keeping it safe from prying '.
'eyes. Protect company secrets!');
diff --git a/src/applications/oauthserver/panel/PhabricatorOAuthServerAuthorizationsSettingsPanel.php b/src/applications/oauthserver/panel/PhabricatorOAuthServerAuthorizationsSettingsPanel.php
--- a/src/applications/oauthserver/panel/PhabricatorOAuthServerAuthorizationsSettingsPanel.php
+++ b/src/applications/oauthserver/panel/PhabricatorOAuthServerAuthorizationsSettingsPanel.php
@@ -16,8 +16,8 @@
}
public function isEnabled() {
- $app_name = 'PhabricatorOAuthServerApplication';
- return PhabricatorApplication::isClassInstalled($app_name);
+ return PhabricatorApplication::isClassInstalled(
+ 'PhabricatorOAuthServerApplication');
}
public function processRequest(AphrontRequest $request) {
@@ -108,8 +108,7 @@
$table = new AphrontTableView($rows);
$table->setNoDataString(
- pht(
- "You haven't authorized any OAuth applications."));
+ pht("You haven't authorized any OAuth applications."));
$table->setRowClasses($rowc);
$table->setHeaders(
diff --git a/src/applications/owners/controller/PhabricatorOwnersDeleteController.php b/src/applications/owners/controller/PhabricatorOwnersDeleteController.php
--- a/src/applications/owners/controller/PhabricatorOwnersDeleteController.php
+++ b/src/applications/owners/controller/PhabricatorOwnersDeleteController.php
@@ -26,8 +26,10 @@
return id(new AphrontRedirectResponse())->setURI('/owners/');
}
- $text = pht('Are you sure you want to delete the "%s" package? This '.
- 'operation can not be undone.', $package->getName());
+ $text = pht(
+ 'Are you sure you want to delete the "%s" package? This '.
+ 'operation can not be undone.',
+ $package->getName());
$dialog = id(new AphrontDialogView())
->setUser($user)
->setTitle('Really delete this package?')
diff --git a/src/applications/owners/controller/PhabricatorOwnersEditController.php b/src/applications/owners/controller/PhabricatorOwnersEditController.php
--- a/src/applications/owners/controller/PhabricatorOwnersEditController.php
+++ b/src/applications/owners/controller/PhabricatorOwnersEditController.php
@@ -197,10 +197,11 @@
->setName('auditing')
->setLabel(pht('Auditing'))
->setCaption(
- pht('With auditing enabled, all future commits that touch '.
- 'this package will be reviewed to make sure an owner '.
- 'of the package is involved and the commit message has '.
- 'a valid revision, reviewed by, and author.'))
+ pht(
+ 'With auditing enabled, all future commits that touch '.
+ 'this package will be reviewed to make sure an owner '.
+ 'of the package is involved and the commit message has '.
+ 'a valid revision, reviewed by, and author.'))
->setOptions(array(
'disabled' => pht('Disabled'),
'enabled' => pht('Enabled'),
@@ -223,8 +224,9 @@
),
pht('Add New Path')))
->setDescription(
- pht('Specify the files and directories which comprise '.
- 'this package.'))
+ pht(
+ 'Specify the files and directories which comprise '.
+ 'this package.'))
->setContent(javelin_tag(
'table',
array(
diff --git a/src/applications/owners/mail/PackageCreateMail.php b/src/applications/owners/mail/PackageCreateMail.php
--- a/src/applications/owners/mail/PackageCreateMail.php
+++ b/src/applications/owners/mail/PackageCreateMail.php
@@ -7,6 +7,6 @@
}
protected function getVerb() {
- return 'Created';
+ return pht('Created');
}
}
diff --git a/src/applications/owners/mail/PackageDeleteMail.php b/src/applications/owners/mail/PackageDeleteMail.php
--- a/src/applications/owners/mail/PackageDeleteMail.php
+++ b/src/applications/owners/mail/PackageDeleteMail.php
@@ -3,7 +3,7 @@
final class PackageDeleteMail extends PackageMail {
protected function getVerb() {
- return 'Deleted';
+ return pht('Deleted');
}
protected function isNewThread() {
diff --git a/src/applications/passphrase/controller/PassphraseCredentialConduitController.php b/src/applications/passphrase/controller/PassphraseCredentialConduitController.php
--- a/src/applications/passphrase/controller/PassphraseCredentialConduitController.php
+++ b/src/applications/passphrase/controller/PassphraseCredentialConduitController.php
@@ -60,8 +60,8 @@
->appendChild(
pht(
'This credential and its secret will no longer be able '.
- 'to be retrieved using the `passphrase.query` method '.
- 'in Conduit.'))
+ 'to be retrieved using the `%s` method in Conduit.',
+ 'passphrase.query'))
->addSubmitButton(pht('Prevent Conduit Access'))
->addCancelButton($view_uri);
} else {
@@ -70,7 +70,7 @@
->appendChild(
pht(
'This credential will be able to be retrieved via the Conduit '.
- 'API by users who have access to this credential. You should '.
+ 'API by users who have access to this credential. You should '.
'only enable this for credentials which need to be accessed '.
'programmatically (such as from build agents).'))
->addSubmitButton(pht('Allow Conduit Access'))
diff --git a/src/applications/passphrase/credentialtype/PassphraseCredentialTypeSSHPrivateKeyText.php b/src/applications/passphrase/credentialtype/PassphraseCredentialTypeSSHPrivateKeyText.php
--- a/src/applications/passphrase/credentialtype/PassphraseCredentialTypeSSHPrivateKeyText.php
+++ b/src/applications/passphrase/credentialtype/PassphraseCredentialTypeSSHPrivateKeyText.php
@@ -45,9 +45,11 @@
if (!Filesystem::binaryExists('ssh-keygen')) {
throw new Exception(
pht(
- 'Decrypting SSH keys requires the `ssh-keygen` binary, but it '.
- 'is not available in PATH. Either make it available or strip the '.
- 'password fromt his SSH key manually before uploading it.'));
+ 'Decrypting SSH keys requires the `%s` binary, but it '.
+ 'is not available in %s. Either make it available or strip the '.
+ 'password fromt his SSH key manually before uploading it.',
+ 'ssh-keygen',
+ '$PATH'));
}
list($err, $stdout, $stderr) = exec_manual(
diff --git a/src/applications/paste/mail/PasteReplyHandler.php b/src/applications/paste/mail/PasteReplyHandler.php
--- a/src/applications/paste/mail/PasteReplyHandler.php
+++ b/src/applications/paste/mail/PasteReplyHandler.php
@@ -5,7 +5,8 @@
public function validateMailReceiver($mail_receiver) {
if (!($mail_receiver instanceof PhabricatorPaste)) {
- throw new Exception('Mail receiver is not a PhabricatorPaste.');
+ throw new Exception(
+ pht('Mail receiver is not a %s.', 'PhabricatorPaste'));
}
}
diff --git a/src/applications/paste/view/PasteEmbedView.php b/src/applications/paste/view/PasteEmbedView.php
--- a/src/applications/paste/view/PasteEmbedView.php
+++ b/src/applications/paste/view/PasteEmbedView.php
@@ -28,7 +28,11 @@
public function render() {
if (!$this->paste) {
- throw new Exception('Call setPaste() before render()!');
+ throw new Exception(
+ pht(
+ 'Call %s before %s!',
+ 'setPaste()',
+ __FUNCTION__.'()'));
}
$lines = phutil_split_lines($this->paste->getContent());
diff --git a/src/applications/people/conduit/UserAddStatusConduitAPIMethod.php b/src/applications/people/conduit/UserAddStatusConduitAPIMethod.php
--- a/src/applications/people/conduit/UserAddStatusConduitAPIMethod.php
+++ b/src/applications/people/conduit/UserAddStatusConduitAPIMethod.php
@@ -37,9 +37,12 @@
protected function defineErrorTypes() {
return array(
- 'ERR-BAD-EPOCH' => "'toEpoch' must be bigger than 'fromEpoch'.",
- 'ERR-OVERLAP' =>
- 'There must be no status in any part of the specified epoch.',
+ 'ERR-BAD-EPOCH' => pht(
+ "'%s' must be bigger than '%s'.",
+ 'toEpoch',
+ 'fromEpoch'),
+ 'ERR-OVERLAP' => pht(
+ 'There must be no status in any part of the specified epoch.'),
);
}
diff --git a/src/applications/people/conduit/UserDisableConduitAPIMethod.php b/src/applications/people/conduit/UserDisableConduitAPIMethod.php
--- a/src/applications/people/conduit/UserDisableConduitAPIMethod.php
+++ b/src/applications/people/conduit/UserDisableConduitAPIMethod.php
@@ -7,7 +7,7 @@
}
public function getMethodDescription() {
- return 'Permanently disable specified users (admin only).';
+ return pht('Permanently disable specified users (admin only).');
}
protected function defineParamTypes() {
@@ -22,8 +22,8 @@
protected function defineErrorTypes() {
return array(
- 'ERR-PERMISSIONS' => 'Only admins can call this method.',
- 'ERR-BAD-PHID' => 'Non existent user PHID.',
+ 'ERR-PERMISSIONS' => pht('Only admins can call this method.'),
+ 'ERR-BAD-PHID' => pht('Non existent user PHID.'),
);
}
diff --git a/src/applications/people/conduit/UserEnableConduitAPIMethod.php b/src/applications/people/conduit/UserEnableConduitAPIMethod.php
--- a/src/applications/people/conduit/UserEnableConduitAPIMethod.php
+++ b/src/applications/people/conduit/UserEnableConduitAPIMethod.php
@@ -7,7 +7,7 @@
}
public function getMethodDescription() {
- return 'Re-enable specified users (admin only).';
+ return pht('Re-enable specified users (admin only).');
}
protected function defineParamTypes() {
@@ -22,8 +22,8 @@
protected function defineErrorTypes() {
return array(
- 'ERR-PERMISSIONS' => 'Only admins can call this method.',
- 'ERR-BAD-PHID' => 'Non existent user PHID.',
+ 'ERR-PERMISSIONS' => pht('Only admins can call this method.'),
+ 'ERR-BAD-PHID' => pht('Non existent user PHID.'),
);
}
diff --git a/src/applications/people/conduit/UserFindConduitAPIMethod.php b/src/applications/people/conduit/UserFindConduitAPIMethod.php
--- a/src/applications/people/conduit/UserFindConduitAPIMethod.php
+++ b/src/applications/people/conduit/UserFindConduitAPIMethod.php
@@ -11,11 +11,11 @@
}
public function getMethodStatusDescription() {
- return pht('Obsoleted by "user.query".');
+ return pht('Obsoleted by "%s".', 'user.query');
}
public function getMethodDescription() {
- return pht('Lookup PHIDs by username. Obsoleted by "user.query".');
+ return pht('Lookup PHIDs by username. Obsoleted by "%s".', 'user.query');
}
protected function defineParamTypes() {
diff --git a/src/applications/people/conduit/UserQueryConduitAPIMethod.php b/src/applications/people/conduit/UserQueryConduitAPIMethod.php
--- a/src/applications/people/conduit/UserQueryConduitAPIMethod.php
+++ b/src/applications/people/conduit/UserQueryConduitAPIMethod.php
@@ -7,7 +7,7 @@
}
public function getMethodDescription() {
- return 'Query users.';
+ return pht('Query users.');
}
protected function defineParamTypes() {
@@ -28,7 +28,7 @@
protected function defineErrorTypes() {
return array(
- 'ERR-INVALID-PARAMETER' => 'Missing or malformed parameter.',
+ 'ERR-INVALID-PARAMETER' => pht('Missing or malformed parameter.'),
);
}
diff --git a/src/applications/people/conduit/UserRemoveStatusConduitAPIMethod.php b/src/applications/people/conduit/UserRemoveStatusConduitAPIMethod.php
--- a/src/applications/people/conduit/UserRemoveStatusConduitAPIMethod.php
+++ b/src/applications/people/conduit/UserRemoveStatusConduitAPIMethod.php
@@ -33,7 +33,10 @@
protected function defineErrorTypes() {
return array(
- 'ERR-BAD-EPOCH' => "'toEpoch' must be bigger than 'fromEpoch'.",
+ 'ERR-BAD-EPOCH' => pht(
+ "'%s' must be bigger than '%s'.",
+ 'toEpoch',
+ 'fromEpoch'),
);
}
diff --git a/src/applications/people/conduit/UserWhoAmIConduitAPIMethod.php b/src/applications/people/conduit/UserWhoAmIConduitAPIMethod.php
--- a/src/applications/people/conduit/UserWhoAmIConduitAPIMethod.php
+++ b/src/applications/people/conduit/UserWhoAmIConduitAPIMethod.php
@@ -7,7 +7,7 @@
}
public function getMethodDescription() {
- return 'Retrieve information about the logged-in user.';
+ return pht('Retrieve information about the logged-in user.');
}
protected function defineParamTypes() {
diff --git a/src/applications/people/controller/PhabricatorPeopleApproveController.php b/src/applications/people/controller/PhabricatorPeopleApproveController.php
--- a/src/applications/people/controller/PhabricatorPeopleApproveController.php
+++ b/src/applications/people/controller/PhabricatorPeopleApproveController.php
@@ -33,11 +33,13 @@
'Phabricator Account "%s" Approved',
$user->getUsername());
- $body = pht(
- "Your Phabricator account (%s) has been approved by %s. You can ".
- "login here:\n\n %s\n\n",
- $user->getUsername(),
- $admin->getUsername(),
+ $body = sprintf(
+ "%s\n\n %s\n\n",
+ pht(
+ 'Your Phabricator account (%s) has been approved by %s. You can '.
+ 'login here:',
+ $user->getUsername(),
+ $admin->getUsername()),
PhabricatorEnv::getProductionURI('/'));
$mail = id(new PhabricatorMetaMTAMail())
diff --git a/src/applications/people/controller/PhabricatorPeopleDeleteController.php b/src/applications/people/controller/PhabricatorPeopleDeleteController.php
--- a/src/applications/people/controller/PhabricatorPeopleDeleteController.php
+++ b/src/applications/people/controller/PhabricatorPeopleDeleteController.php
@@ -44,8 +44,7 @@
'so on), but less safe to delete established users. If possible, '.
'disable them instead.');
- $str4 = pht(
- 'To permanently destroy this user, run this command:');
+ $str4 = pht('To permanently destroy this user, run this command:');
$form = id(new AphrontFormView())
->setUser($admin)
@@ -73,9 +72,7 @@
pht(
'As you stare into the gaping maw of the abyss, something '.
'holds you back.'))
- ->appendParagraph(
- pht(
- 'You can not delete your own account.'))
+ ->appendParagraph(pht('You can not delete your own account.'))
->addCancelButton($profile_uri, pht('Turn Back'));
}
diff --git a/src/applications/people/controller/PhabricatorPeopleDisableController.php b/src/applications/people/controller/PhabricatorPeopleDisableController.php
--- a/src/applications/people/controller/PhabricatorPeopleDisableController.php
+++ b/src/applications/people/controller/PhabricatorPeopleDisableController.php
@@ -41,8 +41,7 @@
->setTitle(pht('Something Stays Your Hand'))
->appendParagraph(
pht(
- 'Try as you might, you find you can not disable your '.
- 'own account.'))
+ 'Try as you might, you find you can not disable your own account.'))
->addCancelButton($done_uri, pht('Curses!'));
}
diff --git a/src/applications/people/controller/PhabricatorPeopleFeedController.php b/src/applications/people/controller/PhabricatorPeopleFeedController.php
--- a/src/applications/people/controller/PhabricatorPeopleFeedController.php
+++ b/src/applications/people/controller/PhabricatorPeopleFeedController.php
@@ -38,8 +38,9 @@
$builder = new PhabricatorFeedBuilder($stories);
$builder->setUser($viewer);
$builder->setShowHovercards(true);
- $builder->setNoDataString(pht('To begin on such a grand journey, '.
- 'requires but just a single step.'));
+ $builder->setNoDataString(
+ pht(
+ 'To begin on such a grand journey, requires but just a single step.'));
$view = $builder->buildView();
$feed = phutil_tag_div(
diff --git a/src/applications/people/controller/PhabricatorPeopleLdapController.php b/src/applications/people/controller/PhabricatorPeopleLdapController.php
--- a/src/applications/people/controller/PhabricatorPeopleLdapController.php
+++ b/src/applications/people/controller/PhabricatorPeopleLdapController.php
@@ -26,7 +26,7 @@
->appendChild(
id(new AphrontFormTextControl())
->setLabel(pht('LDAP query'))
- ->setCaption(pht('A filter such as (objectClass=*)'))
+ ->setCaption(pht('A filter such as %s.', '(objectClass=*)'))
->setName('query'))
->appendChild(
id(new AphrontFormSubmitControl())
@@ -131,7 +131,7 @@
$ldap_provider = PhabricatorLDAPAuthProvider::getLDAPProvider();
if (!$ldap_provider) {
- throw new Exception('No LDAP provider enabled!');
+ throw new Exception(pht('No LDAP provider enabled!'));
}
$ldap_adapter = $ldap_provider->getAdapter();
diff --git a/src/applications/people/controller/PhabricatorPeopleNewController.php b/src/applications/people/controller/PhabricatorPeopleNewController.php
--- a/src/applications/people/controller/PhabricatorPeopleNewController.php
+++ b/src/applications/people/controller/PhabricatorPeopleNewController.php
@@ -123,12 +123,10 @@
if ($is_bot) {
$form->appendRemarkupInstructions(
- pht(
- 'You are creating a new **bot/script** user account.'));
+ pht('You are creating a new **bot/script** user account.'));
} else {
$form->appendRemarkupInstructions(
- pht(
- 'You are creating a new **standard** user account.'));
+ pht('You are creating a new **standard** user account.'));
}
$form
diff --git a/src/applications/people/controller/PhabricatorPeopleWelcomeController.php b/src/applications/people/controller/PhabricatorPeopleWelcomeController.php
--- a/src/applications/people/controller/PhabricatorPeopleWelcomeController.php
+++ b/src/applications/people/controller/PhabricatorPeopleWelcomeController.php
@@ -40,9 +40,7 @@
'The email contains a link to log in to their account. Sending '.
'another copy of the email can be useful if the original was lost '.
'or never sent.'))
- ->appendParagraph(
- pht(
- 'The email will identify you as the sender.'))
+ ->appendParagraph(pht('The email will identify you as the sender.'))
->addSubmitButton(pht('Send Email'))
->addCancelButton($profile_uri);
}
diff --git a/src/applications/people/editor/PhabricatorUserEditor.php b/src/applications/people/editor/PhabricatorUserEditor.php
--- a/src/applications/people/editor/PhabricatorUserEditor.php
+++ b/src/applications/people/editor/PhabricatorUserEditor.php
@@ -27,7 +27,7 @@
$allow_reassign = false) {
if ($user->getID()) {
- throw new Exception('User has already been created!');
+ throw new Exception(pht('User has already been created!'));
}
$is_reassign = false;
@@ -35,18 +35,17 @@
if ($allow_reassign) {
if ($email->getIsPrimary()) {
throw new Exception(
- pht(
- 'Primary email addresses can not be reassigned.'));
+ pht('Primary email addresses can not be reassigned.'));
}
$is_reassign = true;
} else {
- throw new Exception('Email has already been created!');
+ throw new Exception(pht('Email has already been created!'));
}
}
if (!PhabricatorUser::validateUsername($user->getUsername())) {
$valid = PhabricatorUser::describeValidUsername();
- throw new Exception("Username is invalid! {$valid}");
+ throw new Exception(pht('Username is invalid! %s', $valid));
}
// Always set a new user's email address to primary.
@@ -107,8 +106,9 @@
public function updateUser(
PhabricatorUser $user,
PhabricatorUserEmail $email = null) {
+
if (!$user->getID()) {
- throw new Exception('User has not been created yet!');
+ throw new Exception(pht('User has not been created yet!'));
}
$user->openTransaction();
@@ -137,7 +137,7 @@
PhutilOpaqueEnvelope $envelope) {
if (!$user->getID()) {
- throw new Exception('User has not been created yet!');
+ throw new Exception(pht('User has not been created yet!'));
}
$user->openTransaction();
@@ -163,12 +163,12 @@
$actor = $this->requireActor();
if (!$user->getID()) {
- throw new Exception('User has not been created yet!');
+ throw new Exception(pht('User has not been created yet!'));
}
if (!PhabricatorUser::validateUsername($username)) {
$valid = PhabricatorUser::describeValidUsername();
- throw new Exception("Username is invalid! {$valid}");
+ throw new Exception(pht('Username is invalid! %s', $valid));
}
$old_username = $user->getUsername();
@@ -209,7 +209,7 @@
$actor = $this->requireActor();
if (!$user->getID()) {
- throw new Exception('User has not been created yet!');
+ throw new Exception(pht('User has not been created yet!'));
}
$user->openTransaction();
@@ -247,7 +247,7 @@
$actor = $this->requireActor();
if (!$user->getID()) {
- throw new Exception('User has not been created yet!');
+ throw new Exception(pht('User has not been created yet!'));
}
$user->openTransaction();
@@ -286,7 +286,7 @@
$actor = $this->requireActor();
if (!$user->getID()) {
- throw new Exception('User has not been created yet!');
+ throw new Exception(pht('User has not been created yet!'));
}
$user->openTransaction();
@@ -325,7 +325,7 @@
$actor = $this->requireActor();
if (!$user->getID()) {
- throw new Exception('User has not been created yet!');
+ throw new Exception(pht('User has not been created yet!'));
}
$user->openTransaction();
@@ -370,10 +370,10 @@
$actor = $this->requireActor();
if (!$user->getID()) {
- throw new Exception('User has not been created yet!');
+ throw new Exception(pht('User has not been created yet!'));
}
if ($email->getID()) {
- throw new Exception('Email has already been created!');
+ throw new Exception(pht('Email has already been created!'));
}
// Use changePrimaryEmail() to change primary email.
@@ -420,10 +420,10 @@
$actor = $this->requireActor();
if (!$user->getID()) {
- throw new Exception('User has not been created yet!');
+ throw new Exception(pht('User has not been created yet!'));
}
if (!$email->getID()) {
- throw new Exception('Email has not been created yet!');
+ throw new Exception(pht('Email has not been created yet!'));
}
$user->openTransaction();
@@ -433,10 +433,10 @@
$email->reload();
if ($email->getIsPrimary()) {
- throw new Exception("Can't remove primary email!");
+ throw new Exception(pht("Can't remove primary email!"));
}
if ($email->getUserPHID() != $user->getPHID()) {
- throw new Exception('Email not owned by user!');
+ throw new Exception(pht('Email not owned by user!'));
}
$email->delete();
@@ -466,10 +466,10 @@
$actor = $this->requireActor();
if (!$user->getID()) {
- throw new Exception('User has not been created yet!');
+ throw new Exception(pht('User has not been created yet!'));
}
if (!$email->getID()) {
- throw new Exception('Email has not been created yet!');
+ throw new Exception(pht('Email has not been created yet!'));
}
$user->openTransaction();
@@ -479,15 +479,15 @@
$email->reload();
if ($email->getUserPHID() != $user->getPHID()) {
- throw new Exception('User does not own email!');
+ throw new Exception(pht('User does not own email!'));
}
if ($email->getIsPrimary()) {
- throw new Exception('Email is already primary!');
+ throw new Exception(pht('Email is already primary!'));
}
if (!$email->getIsVerified()) {
- throw new Exception('Email is not verified!');
+ throw new Exception(pht('Email is not verified!'));
}
$old_primary = $user->loadPrimaryEmail();
@@ -538,10 +538,10 @@
$actor = $this->requireActor();
if (!$user->getID()) {
- throw new Exception('User has not been created yet!');
+ throw new Exception(pht('User has not been created yet!'));
}
if (!$email->getID()) {
- throw new Exception('Email has not been created yet!');
+ throw new Exception(pht('Email has not been created yet!'));
}
$user->openTransaction();
@@ -610,13 +610,11 @@
if ($old_user != $user->getPHID()) {
if ($email->getIsVerified()) {
throw new Exception(
- pht(
- 'Verified email addresses can not be reassigned.'));
+ pht('Verified email addresses can not be reassigned.'));
}
if ($email->getIsPrimary()) {
throw new Exception(
- pht(
- 'Primary email addresses can not be reassigned.'));
+ pht('Primary email addresses can not be reassigned.'));
}
$email->setUserPHID($user->getPHID());
diff --git a/src/applications/people/editor/__tests__/PhabricatorUserEditorTestCase.php b/src/applications/people/editor/__tests__/PhabricatorUserEditorTestCase.php
--- a/src/applications/people/editor/__tests__/PhabricatorUserEditorTestCase.php
+++ b/src/applications/people/editor/__tests__/PhabricatorUserEditorTestCase.php
@@ -27,9 +27,7 @@
$email = $prefix.'@evil.com@example.com';
try {
- $this->registerUser(
- 'PhabricatorUserEditorTestCaseInvalid',
- $email);
+ $this->registerUser('PhabricatorUserEditorTestCaseInvalid', $email);
} catch (Exception $ex) {
$caught = $ex;
}
diff --git a/src/applications/people/storage/PhabricatorUser.php b/src/applications/people/storage/PhabricatorUser.php
--- a/src/applications/people/storage/PhabricatorUser.php
+++ b/src/applications/people/storage/PhabricatorUser.php
@@ -171,8 +171,9 @@
public function setPassword(PhutilOpaqueEnvelope $envelope) {
if (!$this->getPHID()) {
throw new Exception(
- 'You can not set a password for an unsaved user because their PHID '.
- 'is a salt component in the password hash.');
+ pht(
+ 'You can not set a password for an unsaved user because their PHID '.
+ 'is a salt component in the password hash.'));
}
if (!strlen($envelope->openEnvelope())) {
@@ -359,7 +360,7 @@
}
break;
default:
- throw new Exception('Unknown CSRF token format!');
+ throw new Exception(pht('Unknown CSRF token format!'));
}
}
@@ -408,7 +409,7 @@
public function loadPrimaryEmailAddress() {
$email = $this->loadPrimaryEmail();
if (!$email) {
- throw new Exception('User has no primary email address!');
+ throw new Exception(pht('User has no primary email address!'));
}
return $email->getAddress();
}
@@ -547,36 +548,33 @@
$this->loadPrimaryEmail(),
PhabricatorAuthSessionEngine::ONETIME_WELCOME);
- $body = <<<EOBODY
-Welcome to Phabricator!
-
-{$admin_username} ({$admin_realname}) has created an account for you.
-
- Username: {$user_username}
-
-To login to Phabricator, follow this link and set a password:
-
- {$uri}
-
-After you have set a password, you can login in the future by going here:
-
- {$base_uri}
-
-EOBODY;
+ $body = sprintf(
+ "%s\n\n%s\n\n %s\n\n%s\n\n %s\n\n%s\n\n %s\n",
+ pht('Welcome to Phabricator!'),
+ pht(
+ '%s (%s) has created an account for you.',
+ $admin_username,
+ $admin_realname),
+ pht(
+ 'Username: %s',
+ $user_username),
+ pht('To login to Phabricator, follow this link and set a password:'),
+ $uri,
+ pht(
+ 'After you have set a password, you can login in the '.
+ 'future by going here:'),
+ $base_uri);
if (!$is_serious) {
- $body .= <<<EOBODY
-
-Love,
-Phabricator
-
-EOBODY;
+ $body .= sprintf(
+ "\n%s\n",
+ pht("Love,\nPhabricator"));
}
$mail = id(new PhabricatorMetaMTAMail())
->addTos(array($this->getPHID()))
->setForceDelivery(true)
- ->setSubject('[Phabricator] Welcome to Phabricator')
+ ->setSubject(pht('[Phabricator] Welcome to Phabricator'))
->setBody($body)
->saveAndSend();
}
@@ -596,31 +594,36 @@
$this,
null,
PhabricatorAuthSessionEngine::ONETIME_USERNAME);
- $password_instructions = <<<EOTXT
-If you use a password to login, you'll need to reset it before you can login
-again. You can reset your password by following this link:
-
- {$uri}
-
-And, of course, you'll need to use your new username to login from now on. If
-you use OAuth to login, nothing should change.
-
-EOTXT;
- }
-
- $body = <<<EOBODY
-{$admin_username} ({$admin_realname}) has changed your Phabricator username.
-
- Old Username: {$old_username}
- New Username: {$new_username}
-
-{$password_instructions}
-EOBODY;
+ $password_instructions = sprintf(
+ "%s\n\n %s\n\n%s\n",
+ pht(
+ "If you use a password to login, you'll need to reset it ".
+ "before you can login again. You can reset your password by ".
+ "following this link:"),
+ $uri,
+ pht(
+ "And, of course, you'll need to use your new username to login ".
+ "from now on. If you use OAuth to login, nothing should change."));
+ }
+
+ $body = sprintf(
+ "%s\n\n %s\n %s\n\n%s",
+ pht(
+ '%s (%s) has changed your Phabricator username.',
+ $admin_username,
+ $admin_realname),
+ pht(
+ 'Old Username: %s',
+ $old_username),
+ pht(
+ 'New Username: %s',
+ $new_username),
+ $password_instructions);
$mail = id(new PhabricatorMetaMTAMail())
->addTos(array($this->getPHID()))
->setForceDelivery(true)
- ->setSubject('[Phabricator] Username Changed')
+ ->setSubject(pht('[Phabricator] Username Changed'))
->setBody($body)
->saveAndSend();
}
diff --git a/src/applications/people/storage/PhabricatorUserEmail.php b/src/applications/people/storage/PhabricatorUserEmail.php
--- a/src/applications/people/storage/PhabricatorUserEmail.php
+++ b/src/applications/people/storage/PhabricatorUserEmail.php
@@ -83,8 +83,9 @@
*/
public static function describeValidAddresses() {
return pht(
- "Email addresses should be in the form 'user@domain.com'. The maximum ".
- "length of an email address is %d character(s).",
+ "Email addresses should be in the form '%s'. The maximum ".
+ "length of an email address is %s character(s).",
+ 'user@domain.com',
new PhutilNumber(self::MAX_ADDRESS_LENGTH));
}
@@ -131,10 +132,11 @@
}
if (count($domains) == 1) {
- return 'Email address must be @'.head($domains);
+ return pht('Email address must be @%s', head($domains));
} else {
- return 'Email address must be at one of: '.
- implode(', ', $domains);
+ return pht(
+ 'Email address must be at one of: %s',
+ implode(', ', $domains));
}
}
@@ -174,27 +176,23 @@
$signature = null;
if (!$is_serious) {
- $signature = <<<EOSIGNATURE
-Get Well Soon,
-Phabricator
-EOSIGNATURE;
+ $signature = pht("Get Well Soon,\nPhabricator");
}
- $body = <<<EOBODY
-Hi {$username},
-
-Please verify that you own this email address ({$address}) by clicking this
-link:
-
- {$link}
-
-{$signature}
-EOBODY;
+ $body = sprintf(
+ "%s\n\n%s\n\n %s\n\n%s",
+ pht('Hi %s', $username),
+ pht(
+ 'Please verify that you own this email address (%s) by '.
+ 'clicking this link:',
+ $address),
+ $link,
+ $signature);
id(new PhabricatorMetaMTAMail())
->addRawTos(array($address))
->setForceDelivery(true)
- ->setSubject('[Phabricator] Email Verification')
+ ->setSubject(pht('[Phabricator] Email Verification'))
->setBody($body)
->setRelatedPHID($user->getPHID())
->saveAndSend();
@@ -220,19 +218,20 @@
$old_address = $this->getAddress();
$new_address = $new->getAddress();
- $body = <<<EOBODY
-Hi {$username},
-
-This email address ({$old_address}) is no longer your primary email address.
-Going forward, Phabricator will send all email to your new primary email
-address ({$new_address}).
-
-EOBODY;
+ $body = sprintf(
+ "%s\n\n%s\n",
+ pht('Hi %s', $username),
+ pht(
+ 'This email address (%s) is no longer your primary email address. '.
+ 'Going forward, Phabricator will send all email to your new primary '.
+ 'email address (%s).',
+ $old_address,
+ $new_address));
id(new PhabricatorMetaMTAMail())
->addRawTos(array($old_address))
->setForceDelivery(true)
- ->setSubject('[Phabricator] Primary Address Changed')
+ ->setSubject(pht('[Phabricator] Primary Address Changed'))
->setBody($body)
->setFrom($user->getPHID())
->setRelatedPHID($user->getPHID())
@@ -253,18 +252,18 @@
$new_address = $this->getAddress();
- $body = <<<EOBODY
-Hi {$username},
-
-This is now your primary email address ({$new_address}). Going forward,
-Phabricator will send all email here.
-
-EOBODY;
+ $body = sprintf(
+ "%s\n\n%s\n",
+ pht('Hi %s', $username),
+ pht(
+ 'This is now your primary email address (%s). Going forward, '.
+ 'Phabricator will send all email here.',
+ $new_address));
id(new PhabricatorMetaMTAMail())
->addRawTos(array($new_address))
->setForceDelivery(true)
- ->setSubject('[Phabricator] Primary Address Changed')
+ ->setSubject(pht('[Phabricator] Primary Address Changed'))
->setBody($body)
->setFrom($user->getPHID())
->setRelatedPHID($user->getPHID())
diff --git a/src/applications/people/storage/__tests__/PhabricatorUserTestCase.php b/src/applications/people/storage/__tests__/PhabricatorUserTestCase.php
--- a/src/applications/people/storage/__tests__/PhabricatorUserTestCase.php
+++ b/src/applications/people/storage/__tests__/PhabricatorUserTestCase.php
@@ -49,7 +49,7 @@
$this->assertEqual(
$expect,
PhabricatorUser::validateUsername($name),
- "Validity of '{$name}'.");
+ pht("Validity of '%s'.", $name));
}
}
diff --git a/src/applications/people/typeahead/PhabricatorPeopleNoOwnerDatasource.php b/src/applications/people/typeahead/PhabricatorPeopleNoOwnerDatasource.php
--- a/src/applications/people/typeahead/PhabricatorPeopleNoOwnerDatasource.php
+++ b/src/applications/people/typeahead/PhabricatorPeopleNoOwnerDatasource.php
@@ -23,16 +23,14 @@
'name' => pht('No Owner'),
'summary' => pht('Find results which are not assigned.'),
'description' => pht(
- 'This function includes results which have no owner. Use a query '.
- 'like this to find unassigned results:'.
- "\n\n".
- '> none()'.
- "\n\n".
- 'If you combine this function with other functions, the query will '.
- 'return results which match the other selectors //or// have no '.
- 'owner. For example, this query will find results which are owned '.
- 'by `alincoln`, and will also find results which have no owner:'.
- "\n\n".
+ "This function includes results which have no owner. Use a query ".
+ "like this to find unassigned results:\n\n%s\n\n".
+ "If you combine this function with other functions, the query will ".
+ "return results which match the other selectors //or// have no ".
+ "owner. For example, this query will find results which are owned ".
+ "by `alincoln`, and will also find results which have no owner:".
+ "\n\n%s",
+ '> none()',
'> alincoln, none()'),
),
);
diff --git a/src/applications/people/typeahead/PhabricatorViewerDatasource.php b/src/applications/people/typeahead/PhabricatorViewerDatasource.php
--- a/src/applications/people/typeahead/PhabricatorViewerDatasource.php
+++ b/src/applications/people/typeahead/PhabricatorViewerDatasource.php
@@ -21,16 +21,15 @@
'name' => pht('Current Viewer'),
'summary' => pht('Use the current viewing user.'),
'description' => pht(
- 'This function allows you to change the behavior of a query '.
- 'based on who is running it. When you use this function, you will '.
- 'be the current viewer, so it works like you typed your own '.
- 'username.'.
- "\n\n".
- 'However, if you save a query using this function and send it '.
- 'to someone else, it will work like //their// username was the '.
- 'one that was typed. This can be useful for building dashboard '.
- 'panels that always show relevant information to the user who '.
- 'is looking at them.'),
+ "This function allows you to change the behavior of a query ".
+ "based on who is running it. When you use this function, you will ".
+ "be the current viewer, so it works like you typed your own ".
+ "username.\n\n".
+ "However, if you save a query using this function and send it ".
+ "to someone else, it will work like //their// username was the ".
+ "one that was typed. This can be useful for building dashboard ".
+ "panels that always show relevant information to the user who ".
+ "is looking at them."),
),
);
}
diff --git a/src/applications/phame/conduit/PhameQueryPostsConduitAPIMethod.php b/src/applications/phame/conduit/PhameQueryPostsConduitAPIMethod.php
--- a/src/applications/phame/conduit/PhameQueryPostsConduitAPIMethod.php
+++ b/src/applications/phame/conduit/PhameQueryPostsConduitAPIMethod.php
@@ -7,7 +7,7 @@
}
public function getMethodDescription() {
- return 'Query phame posts.';
+ return pht('Query phame posts.');
}
public function getMethodStatus() {
diff --git a/src/applications/phame/controller/PhameController.php b/src/applications/phame/controller/PhameController.php
--- a/src/applications/phame/controller/PhameController.php
+++ b/src/applications/phame/controller/PhameController.php
@@ -64,12 +64,16 @@
$blogger = phutil_tag('strong', array(), $blogger);
if ($post->isDraft()) {
- $title = pht('%s drafted a blog post on %s.',
- $blogger, $blog);
+ $title = pht(
+ '%s drafted a blog post on %s.',
+ $blogger,
+ $blog);
$title = phutil_tag('em', array(), $title);
} else {
- $title = pht('%s wrote a blog post on %s.',
- $blogger, $blog);
+ $title = pht(
+ '%s wrote a blog post on %s.',
+ $blogger,
+ $blog);
}
$item = id(new PHUIObjectItemView())
diff --git a/src/applications/phame/controller/blog/PhameBlogEditController.php b/src/applications/phame/controller/blog/PhameBlogEditController.php
--- a/src/applications/phame/controller/blog/PhameBlogEditController.php
+++ b/src/applications/phame/controller/blog/PhameBlogEditController.php
@@ -156,7 +156,7 @@
->setName('custom_domain')
->setValue($blog->getDomain())
->setCaption(
- pht('Must include at least one dot (.), e.g. blog.example.com'))
+ pht('Must include at least one dot (.), e.g. %s', 'blog.example.com'))
->setError($e_custom_domain))
->appendChild(
id(new AphrontFormSelectControl())
diff --git a/src/applications/phame/controller/post/PhamePostListController.php b/src/applications/phame/controller/post/PhamePostListController.php
--- a/src/applications/phame/controller/post/PhamePostListController.php
+++ b/src/applications/phame/controller/post/PhamePostListController.php
@@ -54,7 +54,7 @@
$nav->selectFilter('post/all');
break;
default:
- throw new Exception("Unknown filter '{$this->filter}'!");
+ throw new Exception(pht("Unknown filter '%s'!", $this->filter));
}
$pager = id(new AphrontCursorPagerView())
diff --git a/src/applications/phame/controller/post/PhamePostViewController.php b/src/applications/phame/controller/post/PhamePostViewController.php
--- a/src/applications/phame/controller/post/PhamePostViewController.php
+++ b/src/applications/phame/controller/post/PhamePostViewController.php
@@ -48,8 +48,9 @@
->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
->setTitle(pht('Draft Post'))
->appendChild(
- pht('Only you can see this draft until you publish it. '.
- 'Use "Preview / Publish" to publish this post.')));
+ pht(
+ 'Only you can see this draft until you publish it. '.
+ 'Use "Preview / Publish" to publish this post.')));
}
if (!$post->getBlog()) {
@@ -58,8 +59,9 @@
->setSeverity(PHUIInfoView::SEVERITY_WARNING)
->setTitle(pht('Not On A Blog'))
->appendChild(
- pht('This post is not associated with a blog (the blog may have '.
- 'been deleted). Use "Move Post" to move it to a new blog.')));
+ pht(
+ 'This post is not associated with a blog (the blog may have '.
+ 'been deleted). Use "Move Post" to move it to a new blog.')));
}
$nav->appendChild(
diff --git a/src/applications/phame/skins/PhameSkinSpecification.php b/src/applications/phame/skins/PhameSkinSpecification.php
--- a/src/applications/phame/skins/PhameSkinSpecification.php
+++ b/src/applications/phame/skins/PhameSkinSpecification.php
@@ -42,9 +42,13 @@
$that_dir = $specs[$name]->getRootDirectory();
$this_dir = $spec->getRootDirectory();
throw new Exception(
- "Two skins have the same name ('{$name}'), in '{$this_dir}' and ".
- "'{$that_dir}'. Rename one or adjust your 'phame.skins' ".
- "configuration.");
+ pht(
+ "Two skins have the same name ('%s'), in '%s' and '%s'. ".
+ "Rename one or adjust your '%s' configuration.",
+ $name,
+ $this_dir,
+ $that_dir,
+ 'phame.skins'));
}
$specs[$name] = $spec;
diff --git a/src/applications/phame/storage/PhamePost.php b/src/applications/phame/storage/PhamePost.php
--- a/src/applications/phame/storage/PhamePost.php
+++ b/src/applications/phame/storage/PhamePost.php
@@ -148,8 +148,9 @@
public static function getVisibilityOptionsForSelect() {
return array(
- self::VISIBILITY_DRAFT => 'Draft: visible only to me.',
- self::VISIBILITY_PUBLISHED => 'Published: visible to the whole world.',
+ self::VISIBILITY_DRAFT => pht('Draft: visible only to me.'),
+ self::VISIBILITY_PUBLISHED => pht(
+ 'Published: visible to the whole world.'),
);
}
@@ -213,8 +214,7 @@
public function describeAutomaticCapability($capability) {
- return pht(
- 'The author of a blog post can always view and edit it.');
+ return pht('The author of a blog post can always view and edit it.');
}
diff --git a/src/applications/phid/conduit/PHIDInfoConduitAPIMethod.php b/src/applications/phid/conduit/PHIDInfoConduitAPIMethod.php
--- a/src/applications/phid/conduit/PHIDInfoConduitAPIMethod.php
+++ b/src/applications/phid/conduit/PHIDInfoConduitAPIMethod.php
@@ -11,11 +11,11 @@
}
public function getMethodStatusDescription() {
- return "Replaced by 'phid.query'.";
+ return pht("Replaced by 'phid.query'.");
}
public function getMethodDescription() {
- return 'Retrieve information about an arbitrary PHID.';
+ return pht('Retrieve information about an arbitrary PHID.');
}
protected function defineParamTypes() {
@@ -30,7 +30,7 @@
protected function defineErrorTypes() {
return array(
- 'ERR-BAD-PHID' => 'No such object exists.',
+ 'ERR-BAD-PHID' => pht('No such object exists.'),
);
}
diff --git a/src/applications/phid/conduit/PHIDLookupConduitAPIMethod.php b/src/applications/phid/conduit/PHIDLookupConduitAPIMethod.php
--- a/src/applications/phid/conduit/PHIDLookupConduitAPIMethod.php
+++ b/src/applications/phid/conduit/PHIDLookupConduitAPIMethod.php
@@ -7,7 +7,7 @@
}
public function getMethodDescription() {
- return 'Look up objects by name.';
+ return pht('Look up objects by name.');
}
protected function defineParamTypes() {
diff --git a/src/applications/phid/conduit/PHIDQueryConduitAPIMethod.php b/src/applications/phid/conduit/PHIDQueryConduitAPIMethod.php
--- a/src/applications/phid/conduit/PHIDQueryConduitAPIMethod.php
+++ b/src/applications/phid/conduit/PHIDQueryConduitAPIMethod.php
@@ -7,7 +7,7 @@
}
public function getMethodDescription() {
- return 'Retrieve information about arbitrary PHIDs.';
+ return pht('Retrieve information about arbitrary PHIDs.');
}
protected function defineParamTypes() {
diff --git a/src/applications/phid/handle/pool/PhabricatorHandleList.php b/src/applications/phid/handle/pool/PhabricatorHandleList.php
--- a/src/applications/phid/handle/pool/PhabricatorHandleList.php
+++ b/src/applications/phid/handle/pool/PhabricatorHandleList.php
@@ -156,8 +156,9 @@
private function raiseImmutableException() {
throw new Exception(
pht(
- 'Trying to mutate a PhabricatorHandleList, but this is not permitted; '.
- 'handle lists are immutable.'));
+ 'Trying to mutate a %s, but this is not permitted; '.
+ 'handle lists are immutable.',
+ __CLASS__));
}
diff --git a/src/applications/phid/query/PhabricatorObjectQuery.php b/src/applications/phid/query/PhabricatorObjectQuery.php
--- a/src/applications/phid/query/PhabricatorObjectQuery.php
+++ b/src/applications/phid/query/PhabricatorObjectQuery.php
@@ -78,7 +78,11 @@
public function getNamedResults() {
if ($this->namedResults === null) {
- throw new Exception('Call execute() before getNamedResults()!');
+ throw new Exception(
+ pht(
+ 'Call %s before %s!',
+ 'execute()',
+ __FUNCTION__.'()'));
}
return $this->namedResults;
}
diff --git a/src/applications/phid/storage/PhabricatorPHID.php b/src/applications/phid/storage/PhabricatorPHID.php
--- a/src/applications/phid/storage/PhabricatorPHID.php
+++ b/src/applications/phid/storage/PhabricatorPHID.php
@@ -9,7 +9,7 @@
public static function generateNewPHID($type, $subtype = null) {
if (!$type) {
- throw new Exception('Can not generate PHID with no type.');
+ throw new Exception(pht('Can not generate PHID with no type.'));
}
if ($subtype === null) {
diff --git a/src/applications/phid/type/PhabricatorPHIDType.php b/src/applications/phid/type/PhabricatorPHIDType.php
--- a/src/applications/phid/type/PhabricatorPHIDType.php
+++ b/src/applications/phid/type/PhabricatorPHIDType.php
@@ -9,16 +9,20 @@
if ($const === false) {
throw new Exception(
pht(
- 'PHIDType class "%s" must define an TYPECONST property.',
- get_class($this)));
+ '%s class "%s" must define a %s property.',
+ __CLASS__,
+ get_class($this),
+ 'TYPECONST'));
}
if (!is_string($const) || !preg_match('/^[A-Z]{4}$/', $const)) {
throw new Exception(
pht(
- 'PHIDType class "%s" has an invalid TYPECONST property. PHID '.
+ '%s class "%s" has an invalid %s property. PHID '.
'constants must be a four character uppercase string.',
- get_class($this)));
+ __CLASS__,
+ get_class($this),
+ 'TYPECONST'));
}
return $const;
@@ -169,9 +173,13 @@
$that_class = $original[$type];
$this_class = get_class($object);
throw new Exception(
- "Two PhabricatorPHIDType classes ({$that_class}, {$this_class}) ".
- "both handle PHID type '{$type}'. A type may be handled by only ".
- "one class.");
+ pht(
+ "Two %s classes (%s, %s) both handle PHID type '%s'. ".
+ "A type may be handled by only one class.",
+ __CLASS__,
+ $that_class,
+ $this_class,
+ $type));
}
$original[$type] = get_class($object);
diff --git a/src/applications/pholio/view/PholioMockEmbedView.php b/src/applications/pholio/view/PholioMockEmbedView.php
--- a/src/applications/pholio/view/PholioMockEmbedView.php
+++ b/src/applications/pholio/view/PholioMockEmbedView.php
@@ -17,7 +17,11 @@
public function render() {
if (!$this->mock) {
- throw new Exception('Call setMock() before render()!');
+ throw new Exception(
+ pht(
+ 'Call %s before %s!',
+ 'setMock()',
+ __FUNCTION__.'()'));
}
$mock = $this->mock;
diff --git a/src/applications/pholio/view/PholioTransactionView.php b/src/applications/pholio/view/PholioTransactionView.php
--- a/src/applications/pholio/view/PholioTransactionView.php
+++ b/src/applications/pholio/view/PholioTransactionView.php
@@ -67,7 +67,7 @@
$inlines[] = $xaction;
break;
default:
- throw new Exception('Unknown grouped transaction type!');
+ throw new Exception(pht('Unknown grouped transaction type!'));
}
}
@@ -101,12 +101,12 @@
$image = idx($images, $comment->getImageID());
if (!$image) {
- throw new Exception('No image attached!');
+ throw new Exception(pht('No image attached!'));
}
$file = $image->getFile();
if (!$file->isViewableImage()) {
- throw new Exception('File is not viewable.');
+ throw new Exception(pht('File is not viewable.'));
}
$image_uri = $file->getBestURI();
diff --git a/src/applications/phortune/cart/PhortuneSubscriptionCart.php b/src/applications/phortune/cart/PhortuneSubscriptionCart.php
--- a/src/applications/phortune/cart/PhortuneSubscriptionCart.php
+++ b/src/applications/phortune/cart/PhortuneSubscriptionCart.php
@@ -35,7 +35,9 @@
$subscription = $this->getSubscription();
if (!$subscription) {
throw new Exception(
- pht('Call setSubscription() before building a cart!'));
+ pht(
+ 'Call %s before building a cart!',
+ 'setSubscription()'));
}
$cart->setMetadataValue('subscriptionPHID', $subscription->getPHID());
diff --git a/src/applications/phortune/control/PhortuneMonthYearExpiryControl.php b/src/applications/phortune/control/PhortuneMonthYearExpiryControl.php
--- a/src/applications/phortune/control/PhortuneMonthYearExpiryControl.php
+++ b/src/applications/phortune/control/PhortuneMonthYearExpiryControl.php
@@ -38,7 +38,11 @@
protected function renderInput() {
if (!$this->getUser()) {
- throw new Exception('You must setUser() before render()!');
+ throw new Exception(
+ pht(
+ 'You must %s before %s!',
+ 'setUser()',
+ 'render()'));
}
// represent months like a credit card does
diff --git a/src/applications/phortune/controller/PhortuneCartCancelController.php b/src/applications/phortune/controller/PhortuneCartCancelController.php
--- a/src/applications/phortune/controller/PhortuneCartCancelController.php
+++ b/src/applications/phortune/controller/PhortuneCartCancelController.php
@@ -175,8 +175,7 @@
if ($is_refund) {
$title = pht('Refund Order?');
- $body = pht(
- 'Really refund this order?');
+ $body = pht('Really refund this order?');
$button = pht('Refund Order');
$cancel_text = pht('Cancel');
@@ -193,8 +192,7 @@
} else {
$title = pht('Cancel Order?');
- $body = pht(
- 'Really cancel this order? Any payment will be refunded.');
+ $body = pht('Really cancel this order? Any payment will be refunded.');
$button = pht('Cancel Order');
// Don't give the user a "Cancel" button in response to a "Cancel?"
diff --git a/src/applications/phortune/controller/PhortuneMerchantViewController.php b/src/applications/phortune/controller/PhortuneMerchantViewController.php
--- a/src/applications/phortune/controller/PhortuneMerchantViewController.php
+++ b/src/applications/phortune/controller/PhortuneMerchantViewController.php
@@ -297,5 +297,4 @@
}
-
}
diff --git a/src/applications/phortune/controller/PhortunePaymentMethodCreateController.php b/src/applications/phortune/controller/PhortunePaymentMethodCreateController.php
--- a/src/applications/phortune/controller/PhortunePaymentMethodCreateController.php
+++ b/src/applications/phortune/controller/PhortunePaymentMethodCreateController.php
@@ -44,8 +44,9 @@
$providers = $this->loadCreatePaymentMethodProvidersForMerchant($merchant);
if (!$providers) {
throw new Exception(
- 'There are no payment providers enabled that can add payment '.
- 'methods.');
+ pht(
+ 'There are no payment providers enabled that can add payment '.
+ 'methods.'));
}
if (count($providers) == 1) {
diff --git a/src/applications/phortune/controller/PhortuneProviderEditController.php b/src/applications/phortune/controller/PhortuneProviderEditController.php
--- a/src/applications/phortune/controller/PhortuneProviderEditController.php
+++ b/src/applications/phortune/controller/PhortuneProviderEditController.php
@@ -260,8 +260,7 @@
->setUser($viewer)
->addHiddenInput('merchantID', $merchant->getID())
->appendRemarkupInstructions(
- pht(
- 'Choose the type of payment provider to add:'))
+ pht('Choose the type of payment provider to add:'))
->appendChild($panel_classes)
->appendChild(
id(new AphrontFormSubmitControl())
diff --git a/src/applications/phortune/currency/PhortuneCurrency.php b/src/applications/phortune/currency/PhortuneCurrency.php
--- a/src/applications/phortune/currency/PhortuneCurrency.php
+++ b/src/applications/phortune/currency/PhortuneCurrency.php
@@ -52,7 +52,7 @@
case 'USD':
break;
default:
- throw new Exception("Unsupported currency '{$currency}'!");
+ throw new Exception(pht("Unsupported currency '%s'!", $currency));
}
return self::newFromValueAndCurrency($value, $currency);
@@ -121,7 +121,7 @@
}
private static function throwFormatException($string) {
- throw new Exception("Invalid currency format ('{$string}').");
+ throw new Exception(pht("Invalid currency format ('%s').", $string));
}
private function throwUnlikeCurrenciesException(PhortuneCurrency $other) {
diff --git a/src/applications/phortune/currency/PhortuneCurrencySerializer.php b/src/applications/phortune/currency/PhortuneCurrencySerializer.php
--- a/src/applications/phortune/currency/PhortuneCurrencySerializer.php
+++ b/src/applications/phortune/currency/PhortuneCurrencySerializer.php
@@ -11,7 +11,8 @@
throw new Exception(
pht(
'Trying to save object with a currency column, but the column '.
- 'value is not a PhortuneCurrency object.'));
+ 'value is not a %s object.',
+ 'PhortuneCurrency'));
}
return $value->serializeForStorage();
diff --git a/src/applications/phortune/exception/PhortuneNotImplementedException.php b/src/applications/phortune/exception/PhortuneNotImplementedException.php
--- a/src/applications/phortune/exception/PhortuneNotImplementedException.php
+++ b/src/applications/phortune/exception/PhortuneNotImplementedException.php
@@ -3,9 +3,10 @@
final class PhortuneNotImplementedException extends Exception {
public function __construct(PhortunePaymentProvider $provider) {
- $class = get_class($provider);
return parent::__construct(
- "Provider '{$class}' does not implement this method.");
+ pht(
+ "Provider '%s' does not implement this method.",
+ get_class($provider)));
}
}
diff --git a/src/applications/phortune/mail/PhortuneCartReplyHandler.php b/src/applications/phortune/mail/PhortuneCartReplyHandler.php
--- a/src/applications/phortune/mail/PhortuneCartReplyHandler.php
+++ b/src/applications/phortune/mail/PhortuneCartReplyHandler.php
@@ -5,7 +5,7 @@
public function validateMailReceiver($mail_receiver) {
if (!($mail_receiver instanceof PhortuneCart)) {
- throw new Exception('Mail receiver is not a PhortuneCart!');
+ throw new Exception(pht('Mail receiver is not a %s!', 'PhortuneCart'));
}
}
diff --git a/src/applications/phortune/management/PhabricatorPhortuneManagementInvoiceWorkflow.php b/src/applications/phortune/management/PhabricatorPhortuneManagementInvoiceWorkflow.php
--- a/src/applications/phortune/management/PhabricatorPhortuneManagementInvoiceWorkflow.php
+++ b/src/applications/phortune/management/PhabricatorPhortuneManagementInvoiceWorkflow.php
@@ -54,7 +54,8 @@
if (!$subscription_phid) {
throw new PhutilArgumentUsageException(
pht(
- 'Specify which subscription to invoice with --subscription.'));
+ 'Specify which subscription to invoice with %s.',
+ '--subscription'));
}
$subscription = id(new PhortuneSubscriptionQuery())
@@ -90,30 +91,38 @@
if (!$auto_range && !$last_arg && !$next_arg) {
throw new PhutilArgumentUsageException(
pht(
- 'Specify a billing range with --last and --next, or use '.
- '--auto-range.'));
+ 'Specify a billing range with %s and %s, or use %s.',
+ '--last',
+ '--next',
+ '--auto-range'));
} else if (!$auto_range & (!$last_arg || !$next_arg)) {
throw new PhutilArgumentUsageException(
pht(
- 'When specifying --last or --next, you must specify both arguments '.
- 'to define the beginning and end of the billing range.'));
+ 'When specifying %s or %s, you must specify both arguments '.
+ 'to define the beginning and end of the billing range.',
+ '--last',
+ '--next'));
} else if (!$auto_range && ($last_arg && $next_arg)) {
$last_time = $this->parseTimeArgument($args->getArg('last'));
$next_time = $this->parseTimeArgument($args->getArg('next'));
} else if ($auto_range && ($last_arg || $next_arg)) {
throw new PhutilArgumentUsageException(
pht(
- 'Use either --auto-range or --last and --next to specify the '.
- 'billing range, but not both.'));
+ 'Use either %s or %s and %s to specify the '.
+ 'billing range, but not both.',
+ '--auto-range',
+ '--last',
+ '--next'));
} else {
$trigger = $subscription->getTrigger();
$event = $trigger->getEvent();
if (!$event) {
throw new PhutilArgumentUsageException(
pht(
- 'Unable to calculate --auto-range, this subscription has not been '.
+ 'Unable to calculate %s, this subscription has not been '.
'scheduled for billing yet. Wait for the trigger daemon to '.
- 'schedule the subscription.'));
+ 'schedule the subscription.',
+ '--auto-range'));
}
$last_time = $event->getLastEventEpoch();
$next_time = $event->getNextEventEpoch();
diff --git a/src/applications/phortune/provider/PhortunePayPalPaymentProvider.php b/src/applications/phortune/provider/PhortunePayPalPaymentProvider.php
--- a/src/applications/phortune/provider/PhortunePayPalPaymentProvider.php
+++ b/src/applications/phortune/provider/PhortunePayPalPaymentProvider.php
@@ -27,8 +27,7 @@
}
public function getConfigureProvidesDescription() {
- return pht(
- 'This merchant accepts payments via PayPal.');
+ return pht('This merchant accepts payments via PayPal.');
}
public function getConfigureInstructions() {
diff --git a/src/applications/phortune/provider/PhortuneStripePaymentProvider.php b/src/applications/phortune/provider/PhortuneStripePaymentProvider.php
--- a/src/applications/phortune/provider/PhortuneStripePaymentProvider.php
+++ b/src/applications/phortune/provider/PhortuneStripePaymentProvider.php
@@ -24,8 +24,7 @@
}
public function getConfigureProvidesDescription() {
- return pht(
- 'This merchant accepts credit and debit cards via Stripe.');
+ return pht('This merchant accepts credit and debit cards via Stripe.');
}
public function getPaymentMethodDescription() {
@@ -147,7 +146,7 @@
$id = $stripe_charge->id;
if (!$id) {
- throw new Exception('Stripe charge call did not return an ID!');
+ throw new Exception(pht('Stripe charge call did not return an ID!'));
}
$charge->setMetadataValue('stripe.chargeID', $id);
diff --git a/src/applications/phortune/storage/PhortuneCart.php b/src/applications/phortune/storage/PhortuneCart.php
--- a/src/applications/phortune/storage/PhortuneCart.php
+++ b/src/applications/phortune/storage/PhortuneCart.php
@@ -87,8 +87,9 @@
if ($copy->getStatus() !== self::STATUS_BUILDING) {
throw new Exception(
pht(
- 'Cart has wrong status ("%s") to call willApplyCharge().',
- $copy->getStatus()));
+ 'Cart has wrong status ("%s") to call %s.',
+ $copy->getStatus(),
+ 'willApplyCharge()'));
}
$this->setStatus(self::STATUS_READY)->save();
@@ -129,9 +130,9 @@
if ($copy->getStatus() !== self::STATUS_READY) {
throw new Exception(
pht(
- 'Cart has wrong status ("%s") to call willApplyCharge(), '.
- 'expected "%s".',
+ 'Cart has wrong status ("%s") to call %s, expected "%s".',
$copy->getStatus(),
+ 'willApplyCharge()',
self::STATUS_READY));
}
@@ -156,9 +157,9 @@
if ($copy->getStatus() !== self::STATUS_PURCHASING) {
throw new Exception(
pht(
- 'Cart has wrong status ("%s") to call didHoldCharge(), '.
- 'expected "%s".',
+ 'Cart has wrong status ("%s") to call %s, expected "%s".',
$copy->getStatus(),
+ 'didHoldCharge()',
self::STATUS_PURCHASING));
}
@@ -184,8 +185,9 @@
($copy->getStatus() !== self::STATUS_HOLD)) {
throw new Exception(
pht(
- 'Cart has wrong status ("%s") to call didApplyCharge().',
- $copy->getStatus()));
+ 'Cart has wrong status ("%s") to call %s.',
+ $copy->getStatus(),
+ 'didApplyCharge()'));
}
$charge->save();
@@ -219,8 +221,9 @@
if (($copy->getStatus() !== self::STATUS_CHARGED)) {
throw new Exception(
pht(
- 'Cart has wrong status ("%s") to call willReviewCart()!',
- $copy->getStatus()));
+ 'Cart has wrong status ("%s") to call %s!',
+ $copy->getStatus(),
+ 'willReviewCart()'));
}
$this->setStatus(self::STATUS_REVIEW)->save();
@@ -244,8 +247,9 @@
($copy->getStatus() !== self::STATUS_REVIEW)) {
throw new Exception(
pht(
- 'Cart has wrong status ("%s") to call didReviewCart()!',
- $copy->getStatus()));
+ 'Cart has wrong status ("%s") to call %s!',
+ $copy->getStatus(),
+ 'didReviewCart()'));
}
foreach ($this->purchases as $purchase) {
@@ -275,8 +279,9 @@
($copy->getStatus() !== self::STATUS_HOLD)) {
throw new Exception(
pht(
- 'Cart has wrong status ("%s") to call didFailCharge().',
- $copy->getStatus()));
+ 'Cart has wrong status ("%s") to call %s.',
+ $copy->getStatus(),
+ 'didFailCharge()'));
}
$charge->save();
@@ -300,7 +305,7 @@
if (!$amount->isPositive()) {
throw new Exception(
- pht('Trying to refund nonpositive amount of money!'));
+ pht('Trying to refund non-positive amount of money!'));
}
if ($amount->isGreaterThan($charge->getAmountRefundableAsCurrency())) {
diff --git a/src/applications/phortune/worker/PhortuneSubscriptionWorker.php b/src/applications/phortune/worker/PhortuneSubscriptionWorker.php
--- a/src/applications/phortune/worker/PhortuneSubscriptionWorker.php
+++ b/src/applications/phortune/worker/PhortuneSubscriptionWorker.php
@@ -195,8 +195,7 @@
if (!$last_epoch || !$this_epoch) {
throw new PhabricatorWorkerPermanentFailureException(
- pht(
- 'Subscription is missing billing period information.'));
+ pht('Subscription is missing billing period information.'));
}
$period_length = ($this_epoch - $last_epoch);
diff --git a/src/applications/phpast/application/PhabricatorPHPASTApplication.php b/src/applications/phpast/application/PhabricatorPHPASTApplication.php
--- a/src/applications/phpast/application/PhabricatorPHPASTApplication.php
+++ b/src/applications/phpast/application/PhabricatorPHPASTApplication.php
@@ -15,7 +15,7 @@
}
public function getShortDescription() {
- return 'Visual PHP Parser';
+ return pht('Visual PHP Parser');
}
public function getTitleGlyph() {
diff --git a/src/applications/phpast/controller/PhabricatorXHPASTViewFrameController.php b/src/applications/phpast/controller/PhabricatorXHPASTViewFrameController.php
--- a/src/applications/phpast/controller/PhabricatorXHPASTViewFrameController.php
+++ b/src/applications/phpast/controller/PhabricatorXHPASTViewFrameController.php
@@ -22,7 +22,7 @@
'',
)),
array(
- 'title' => 'XHPAST View',
+ 'title' => pht('XHPAST View'),
));
}
}
diff --git a/src/applications/phpast/controller/PhabricatorXHPASTViewPanelController.php b/src/applications/phpast/controller/PhabricatorXHPASTViewPanelController.php
--- a/src/applications/phpast/controller/PhabricatorXHPASTViewPanelController.php
+++ b/src/applications/phpast/controller/PhabricatorXHPASTViewPanelController.php
@@ -11,7 +11,7 @@
$this->storageTree = id(new PhabricatorXHPASTViewParseTree())
->load($this->id);
if (!$this->storageTree) {
- throw new Exception('No such AST!');
+ throw new Exception(pht('No such AST!'));
}
}
diff --git a/src/applications/phpast/controller/PhabricatorXHPASTViewRunController.php b/src/applications/phpast/controller/PhabricatorXHPASTViewRunController.php
--- a/src/applications/phpast/controller/PhabricatorXHPASTViewRunController.php
+++ b/src/applications/phpast/controller/PhabricatorXHPASTViewRunController.php
@@ -35,7 +35,7 @@
->setUser($user)
->appendChild(
id(new AphrontFormTextAreaControl())
- ->setLabel('Source')
+ ->setLabel(pht('Source'))
->setName('source')
->setValue("<?php\n\n")
->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL))
diff --git a/src/applications/phpast/controller/PhabricatorXHPASTViewStreamController.php b/src/applications/phpast/controller/PhabricatorXHPASTViewStreamController.php
--- a/src/applications/phpast/controller/PhabricatorXHPASTViewStreamController.php
+++ b/src/applications/phpast/controller/PhabricatorXHPASTViewStreamController.php
@@ -16,7 +16,7 @@
foreach ($tree->getRawTokenStream() as $id => $token) {
$seq = $id;
$name = $token->getTypeName();
- $title = "Token {$seq}: {$name}";
+ $title = pht('Token %s: %s', $seq, $name);
$tokens[] = phutil_tag(
'span',
diff --git a/src/applications/phragment/conduit/PhragmentQueryFragmentsConduitAPIMethod.php b/src/applications/phragment/conduit/PhragmentQueryFragmentsConduitAPIMethod.php
--- a/src/applications/phragment/conduit/PhragmentQueryFragmentsConduitAPIMethod.php
+++ b/src/applications/phragment/conduit/PhragmentQueryFragmentsConduitAPIMethod.php
@@ -27,7 +27,7 @@
protected function defineErrorTypes() {
return array(
- 'ERR_BAD_FRAGMENT' => 'No such fragment exists',
+ 'ERR_BAD_FRAGMENT' => pht('No such fragment exists.'),
);
}
diff --git a/src/applications/phragment/controller/PhragmentController.php b/src/applications/phragment/controller/PhragmentController.php
--- a/src/applications/phragment/controller/PhragmentController.php
+++ b/src/applications/phragment/controller/PhragmentController.php
@@ -201,12 +201,16 @@
return id(new PHUIInfoView())
->setTitle(pht('security.alternate-file-domain must be configured!'))
->setSeverity(PHUIInfoView::SEVERITY_ERROR)
- ->appendChild(phutil_tag('p', array(), pht(
- 'Because Phragment generates files (such as ZIP archives and '.
- 'patches) as they are requested, it requires that you configure '.
- 'the `security.alternate-file-domain` option. This option on it\'s '.
- 'own will also provide additional security when serving files '.
- 'across Phabricator.')));
+ ->appendChild(
+ phutil_tag(
+ 'p',
+ array(),
+ pht(
+ "Because Phragment generates files (such as ZIP archives and ".
+ "patches) as they are requested, it requires that you configure ".
+ "the `%s` option. This option on it's own will also provide ".
+ "additional security when serving files across Phabricator.",
+ 'security.alternate-file-domain')));
}
return null;
}
diff --git a/src/applications/phragment/controller/PhragmentCreateController.php b/src/applications/phragment/controller/PhragmentCreateController.php
--- a/src/applications/phragment/controller/PhragmentCreateController.php
+++ b/src/applications/phragment/controller/PhragmentCreateController.php
@@ -40,7 +40,7 @@
$v_editpolicy = $request->getStr('editPolicy');
if (strpos($v_name, '/') !== false) {
- $errors[] = pht('The fragment name can not contain \'/\'.');
+ $errors[] = pht("The fragment name can not contain '/'.");
}
$file = id(new PhabricatorFileQuery())
@@ -48,7 +48,7 @@
->withIDs(array($v_fileid))
->executeOne();
if (!$file) {
- $errors[] = pht('The specified file doesn\'t exist.');
+ $errors[] = pht("The specified file doesn't exist.");
}
if (!count($errors)) {
diff --git a/src/applications/phrequent/conduit/PhrequentTrackingConduitAPIMethod.php b/src/applications/phrequent/conduit/PhrequentTrackingConduitAPIMethod.php
--- a/src/applications/phrequent/conduit/PhrequentTrackingConduitAPIMethod.php
+++ b/src/applications/phrequent/conduit/PhrequentTrackingConduitAPIMethod.php
@@ -8,8 +8,7 @@
}
public function getMethodDescription() {
- return pht(
- 'Returns current objects being tracked in Phrequent.');
+ return pht('Returns current objects being tracked in Phrequent.');
}
public function getMethodStatus() {
diff --git a/src/applications/phrequent/controller/PhrequentTrackController.php b/src/applications/phrequent/controller/PhrequentTrackController.php
--- a/src/applications/phrequent/controller/PhrequentTrackController.php
+++ b/src/applications/phrequent/controller/PhrequentTrackController.php
@@ -49,8 +49,7 @@
return $this->newDialog()
->setTitle(pht('Not Tracking Time'))
->appendParagraph(
- pht(
- 'You are not currently tracking time on this object.'))
+ pht('You are not currently tracking time on this object.'))
->addCancelButton($done_uri);
}
break;
@@ -93,8 +92,7 @@
if ($this->isStoppingTracking()) {
$min_time = $current_timer->getDateStarted();
if ($min_time > $timestamp->getEpoch()) {
- $errors[] = pht(
- 'Stop time must be after start time.');
+ $errors[] = pht('Stop time must be after start time.');
$e_date = pht('Invalid');
}
}
diff --git a/src/applications/phrequent/query/PhrequentUserTimeQuery.php b/src/applications/phrequent/query/PhrequentUserTimeQuery.php
--- a/src/applications/phrequent/query/PhrequentUserTimeQuery.php
+++ b/src/applications/phrequent/query/PhrequentUserTimeQuery.php
@@ -111,7 +111,7 @@
'dateEnded IS NULL');
break;
default:
- throw new Exception("Unknown ended '{$this->ended}'!");
+ throw new Exception(pht("Unknown ended '%s'!", $this->ended));
}
$where[] = $this->buildPagingClause($conn);
diff --git a/src/applications/phriction/conduit/PhrictionHistoryConduitAPIMethod.php b/src/applications/phriction/conduit/PhrictionHistoryConduitAPIMethod.php
--- a/src/applications/phriction/conduit/PhrictionHistoryConduitAPIMethod.php
+++ b/src/applications/phriction/conduit/PhrictionHistoryConduitAPIMethod.php
@@ -22,7 +22,7 @@
protected function defineErrorTypes() {
return array(
- 'ERR-BAD-DOCUMENT' => 'No such document exists.',
+ 'ERR-BAD-DOCUMENT' => pht('No such document exists.'),
);
}
diff --git a/src/applications/phriction/conduit/PhrictionInfoConduitAPIMethod.php b/src/applications/phriction/conduit/PhrictionInfoConduitAPIMethod.php
--- a/src/applications/phriction/conduit/PhrictionInfoConduitAPIMethod.php
+++ b/src/applications/phriction/conduit/PhrictionInfoConduitAPIMethod.php
@@ -22,7 +22,7 @@
protected function defineErrorTypes() {
return array(
- 'ERR-BAD-DOCUMENT' => 'No such document exists.',
+ 'ERR-BAD-DOCUMENT' => pht('No such document exists.'),
);
}
diff --git a/src/applications/phriction/constants/PhrictionActionConstants.php b/src/applications/phriction/constants/PhrictionActionConstants.php
--- a/src/applications/phriction/constants/PhrictionActionConstants.php
+++ b/src/applications/phriction/constants/PhrictionActionConstants.php
@@ -9,15 +9,15 @@
const ACTION_MOVE_HERE = 'move here';
public static function getActionPastTenseVerb($action) {
- static $map = array(
- self::ACTION_CREATE => 'created',
- self::ACTION_EDIT => 'edited',
- self::ACTION_DELETE => 'deleted',
- self::ACTION_MOVE_AWAY => 'moved',
- self::ACTION_MOVE_HERE => 'moved',
+ $map = array(
+ self::ACTION_CREATE => pht('created'),
+ self::ACTION_EDIT => pht('edited'),
+ self::ACTION_DELETE => pht('deleted'),
+ self::ACTION_MOVE_AWAY => pht('moved'),
+ self::ACTION_MOVE_HERE => pht('moved'),
);
- return idx($map, $action, "brazenly {$action}'d");
+ return idx($map, $action, pht("brazenly %s'd", $action));
}
}
diff --git a/src/applications/phriction/constants/PhrictionChangeType.php b/src/applications/phriction/constants/PhrictionChangeType.php
--- a/src/applications/phriction/constants/PhrictionChangeType.php
+++ b/src/applications/phriction/constants/PhrictionChangeType.php
@@ -9,15 +9,15 @@
const CHANGE_STUB = 4;
public static function getChangeTypeLabel($const) {
- static $map = array(
- self::CHANGE_EDIT => 'Edit',
- self::CHANGE_DELETE => 'Delete',
- self::CHANGE_MOVE_HERE => 'Move Here',
- self::CHANGE_MOVE_AWAY => 'Move Away',
- self::CHANGE_STUB => 'Created through child',
+ $map = array(
+ self::CHANGE_EDIT => pht('Edit'),
+ self::CHANGE_DELETE => pht('Delete'),
+ self::CHANGE_MOVE_HERE => pht('Move Here'),
+ self::CHANGE_MOVE_AWAY => pht('Move Away'),
+ self::CHANGE_STUB => pht('Created through child'),
);
- return idx($map, $const, '???');
+ return idx($map, $const, pht('Unknown'));
}
}
diff --git a/src/applications/phriction/controller/PhrictionEditController.php b/src/applications/phriction/controller/PhrictionEditController.php
--- a/src/applications/phriction/controller/PhrictionEditController.php
+++ b/src/applications/phriction/controller/PhrictionEditController.php
@@ -97,9 +97,12 @@
$draft_note = new PHUIInfoView();
$draft_note->setSeverity(PHUIInfoView::SEVERITY_NOTICE);
$draft_note->setTitle('Recovered Draft');
- $draft_note->appendChild(hsprintf(
- '<p>Showing a saved draft of your edits, you can %s.</p>',
- $discard));
+ $draft_note->appendChild(
+ hsprintf(
+ '<p>%s</p>',
+ pht(
+ 'Showing a saved draft of your edits, you can %s.',
+ $discard)));
} else {
$content_text = $content->getContent();
$draft_note = null;
diff --git a/src/applications/phriction/controller/PhrictionHistoryController.php b/src/applications/phriction/controller/PhrictionHistoryController.php
--- a/src/applications/phriction/controller/PhrictionHistoryController.php
+++ b/src/applications/phriction/controller/PhrictionHistoryController.php
@@ -87,7 +87,7 @@
$color = 'green';
break;
default:
- throw new Exception('Unknown change type!');
+ throw new Exception(pht('Unknown change type!'));
break;
}
diff --git a/src/applications/phriction/storage/PhrictionDocument.php b/src/applications/phriction/storage/PhrictionDocument.php
--- a/src/applications/phriction/storage/PhrictionDocument.php
+++ b/src/applications/phriction/storage/PhrictionDocument.php
@@ -101,7 +101,7 @@
);
if (empty($types[$type])) {
- throw new Exception("Unknown URI type '{$type}'!");
+ throw new Exception(pht("Unknown URI type '%s'!", $type));
}
$prefix = $types[$type];
diff --git a/src/applications/policy/__tests__/PhabricatorPolicyTestCase.php b/src/applications/policy/__tests__/PhabricatorPolicyTestCase.php
--- a/src/applications/policy/__tests__/PhabricatorPolicyTestCase.php
+++ b/src/applications/policy/__tests__/PhabricatorPolicyTestCase.php
@@ -16,7 +16,7 @@
'user' => true,
'admin' => true,
),
- 'Public Policy (Enabled in Config)');
+ pht('Public Policy (Enabled in Config)'));
}
@@ -35,7 +35,7 @@
'user' => true,
'admin' => true,
),
- 'Public Policy (Disabled in Config)');
+ pht('Public Policy (Disabled in Config)'));
}
@@ -51,7 +51,7 @@
'user' => true,
'admin' => true,
),
- 'User Policy');
+ pht('User Policy'));
}
@@ -66,7 +66,7 @@
'user' => false,
'admin' => true,
),
- 'Admin Policy');
+ pht('Admin Policy'));
}
@@ -81,7 +81,7 @@
'user' => false,
'admin' => false,
),
- 'No One Policy');
+ pht('No One Policy'));
}
@@ -105,22 +105,22 @@
$this->assertEqual(
3,
count($query->setLimit(3)->setOffset(0)->execute()),
- 'Invisible objects are ignored.');
+ pht('Invisible objects are ignored.'));
$this->assertEqual(
0,
count($query->setLimit(3)->setOffset(3)->execute()),
- 'Offset pages through visible objects only.');
+ pht('Offset pages through visible objects only.'));
$this->assertEqual(
2,
count($query->setLimit(3)->setOffset(1)->execute()),
- 'Offsets work correctly.');
+ pht('Offsets work correctly.'));
$this->assertEqual(
2,
count($query->setLimit(0)->setOffset(1)->execute()),
- 'Offset with no limit works.');
+ pht('Offset with no limit works.'));
}
@@ -144,12 +144,12 @@
$this->assertEqual(
3,
count($query->setLimit(3)->setOffset(0)->execute()),
- 'Limits work.');
+ pht('Limits work.'));
$this->assertEqual(
2,
count($query->setLimit(3)->setOffset(4)->execute()),
- 'Limit + offset work.');
+ pht('Limit + offset work.'));
}
@@ -185,7 +185,7 @@
'user' => false,
'admin' => false,
),
- 'Invalid Policy');
+ pht('Invalid Policy'));
}
@@ -222,7 +222,10 @@
}
$this->assertTrue(
(bool)PhabricatorApplication::getByClass($class),
- "Application class '{$class}' for query '{$qclass}'");
+ pht(
+ "Application class '%s' for query '%s'.",
+ $class,
+ $qclass));
}
}
@@ -281,11 +284,11 @@
$this->assertEqual(
$object,
$result,
- "{$description} with user {$spec} should succeed.");
+ pht('%s with user %s should succeed.', $description, $spec));
} else {
$this->assertTrue(
$caught instanceof PhabricatorPolicyException,
- "{$description} with user {$spec} should fail.");
+ pht('%s with user %s should fail.', $description, $spec));
}
}
}
@@ -326,7 +329,7 @@
$user->setIsAdmin(true);
break;
default:
- throw new Exception("Unknown user spec '{$spec}'.");
+ throw new Exception(pht("Unknown user spec '%s'.", $spec));
}
return $user;
diff --git a/src/applications/policy/capability/PhabricatorPolicyCapability.php b/src/applications/policy/capability/PhabricatorPolicyCapability.php
--- a/src/applications/policy/capability/PhabricatorPolicyCapability.php
+++ b/src/applications/policy/capability/PhabricatorPolicyCapability.php
@@ -21,16 +21,20 @@
if ($const === false) {
throw new Exception(
pht(
- 'PolicyCapability class "%s" must define an CAPABILITY property.',
- get_class($this)));
+ '%s class "%s" must define a %s property.',
+ __CLASS__,
+ get_class($this),
+ 'CAPABILITY'));
}
if (!is_string($const)) {
throw new Exception(
pht(
- 'PolicyCapability class "%s" has an invalid CAPABILITY '.
- 'property. Capability constants must be a string.',
- get_class($this)));
+ '%s class "%s" has an invalid %s property. '.
+ 'Capability constants must be a string.',
+ __CLASS__,
+ get_class($this),
+ 'CAPABILITY'));
}
return $const;
diff --git a/src/applications/policy/config/PhabricatorPolicyConfigOptions.php b/src/applications/policy/config/PhabricatorPolicyConfigOptions.php
--- a/src/applications/policy/config/PhabricatorPolicyConfigOptions.php
+++ b/src/applications/policy/config/PhabricatorPolicyConfigOptions.php
@@ -63,8 +63,9 @@
'users can take certain actions, such as creating new users. '."\n\n".
'This setting allows for "locking" these policies such that no '.
'further edits can be made on a per-policy basis.'))
- ->addExample($policy_locked_example,
- pht('Lock Create User Policy To Admins')),
+ ->addExample(
+ $policy_locked_example,
+ pht('Lock Create User Policy To Admins')),
);
}
diff --git a/src/applications/policy/config/PolicyLockOptionType.php b/src/applications/policy/config/PolicyLockOptionType.php
--- a/src/applications/policy/config/PolicyLockOptionType.php
+++ b/src/applications/policy/config/PolicyLockOptionType.php
@@ -13,8 +13,10 @@
foreach ($value as $capability_key => $policy) {
$capability = idx($capabilities, $capability_key);
if (!$capability) {
- throw new Exception(pht(
- 'Capability "%s" does not exist.', $capability_key));
+ throw new Exception(
+ pht(
+ 'Capability "%s" does not exist.',
+ $capability_key));
}
if (phid_get_type($policy) !=
PhabricatorPHIDConstants::PHID_TYPE_UNKNOWN) {
@@ -25,18 +27,20 @@
// this exception is not helpful here as its about global policy;
// throw a better exception
} catch (Exception $ex) {
- throw new Exception(pht(
- 'Capability "%s" has invalid policy "%s".',
- $capability_key,
- $policy));
+ throw new Exception(
+ pht(
+ 'Capability "%s" has invalid policy "%s".',
+ $capability_key,
+ $policy));
}
}
if ($policy == PhabricatorPolicies::POLICY_PUBLIC) {
if (!$capability->shouldAllowPublicPolicySetting()) {
- throw new Exception(pht(
- 'Capability "%s" does not support public policy.',
- $capability_key));
+ throw new Exception(
+ pht(
+ 'Capability "%s" does not support public policy.',
+ $capability_key));
}
}
}
@@ -50,11 +54,12 @@
foreach ($value as $capability_key => $policy) {
$handle = $handles[$policy];
if (!$handle->isComplete()) {
- throw new Exception(pht(
- 'Capability "%s" has invalid policy "%s"; "%s" does not exist.',
- $capability_key,
- $policy,
- $policy));
+ throw new Exception(
+ pht(
+ 'Capability "%s" has invalid policy "%s"; "%s" does not exist.',
+ $capability_key,
+ $policy,
+ $policy));
}
}
}
diff --git a/src/applications/policy/controller/PhabricatorPolicyEditController.php b/src/applications/policy/controller/PhabricatorPolicyEditController.php
--- a/src/applications/policy/controller/PhabricatorPolicyEditController.php
+++ b/src/applications/policy/controller/PhabricatorPolicyEditController.php
@@ -63,12 +63,12 @@
case 'deny':
break;
default:
- throw new Exception("Invalid action '{$action}'!");
+ throw new Exception(pht("Invalid action '%s'!", $action));
}
$rule_class = idx($rule, 'rule');
if (empty($rules[$rule_class])) {
- throw new Exception("Invalid rule class '{$rule_class}'!");
+ throw new Exception(pht("Invalid rule class '%s'!", $rule_class));
}
$rule_obj = $rules[$rule_class];
@@ -163,8 +163,7 @@
'mustcapture' => true,
),
pht('New Rule')))
- ->setDescription(
- pht('These rules are processed in order.'))
+ ->setDescription(pht('These rules are processed in order.'))
->setContent(javelin_tag(
'table',
array(
diff --git a/src/applications/policy/filter/PhabricatorPolicyFilter.php b/src/applications/policy/filter/PhabricatorPolicyFilter.php
--- a/src/applications/policy/filter/PhabricatorPolicyFilter.php
+++ b/src/applications/policy/filter/PhabricatorPolicyFilter.php
@@ -17,8 +17,10 @@
if (!self::hasCapability($user, $object, $capability)) {
throw new Exception(
- "You can not make that edit, because it would remove your ability ".
- "to '{$capability}' the object.");
+ pht(
+ "You can not make that edit, because it would remove your ability ".
+ "to '%s' the object.",
+ $capability));
}
}
@@ -111,7 +113,11 @@
if (!$viewer || !$capabilities) {
throw new Exception(
- 'Call setViewer() and requireCapabilities() before apply()!');
+ pht(
+ 'Call %s and %s before %s!',
+ 'setViewer()',
+ 'requireCapabilities()',
+ __FUNCTION__.'()'));
}
// If the viewer is omnipotent, short circuit all the checks and just
@@ -135,8 +141,10 @@
foreach ($capabilities as $capability) {
if (!in_array($capability, $object_capabilities)) {
throw new Exception(
- "Testing for capability '{$capability}' on an object which does ".
- "not have that capability!");
+ pht(
+ "Testing for capability '%s' on an object which does ".
+ "not have that capability!",
+ $capability));
}
$policy = $this->getObjectPolicy($object, $capability);
diff --git a/src/applications/policy/management/PhabricatorPolicyManagementShowWorkflow.php b/src/applications/policy/management/PhabricatorPolicyManagementShowWorkflow.php
--- a/src/applications/policy/management/PhabricatorPolicyManagementShowWorkflow.php
+++ b/src/applications/policy/management/PhabricatorPolicyManagementShowWorkflow.php
@@ -6,7 +6,7 @@
protected function didConstruct() {
$this
->setName('show')
- ->setSynopsis('Show policy information about an object.')
+ ->setSynopsis(pht('Show policy information about an object.'))
->setExamples(
'**show** D123')
->setArguments(
@@ -25,8 +25,7 @@
$obj_names = $args->getArg('objects');
if (!$obj_names) {
throw new PhutilArgumentUsageException(
- pht(
- 'Specify the name of an object to show policy information for.'));
+ pht('Specify the name of an object to show policy information for.'));
} else if (count($obj_names) > 1) {
throw new PhutilArgumentUsageException(
pht(
diff --git a/src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php b/src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php
--- a/src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php
+++ b/src/applications/policy/management/PhabricatorPolicyManagementUnlockWorkflow.php
@@ -7,10 +7,10 @@
$this
->setName('unlock')
->setSynopsis(
- 'Unlock an object by setting its policies to allow anyone to view '.
- 'and edit it.')
- ->setExamples(
- '**unlock** D123')
+ pht(
+ 'Unlock an object by setting its policies to allow anyone to view '.
+ 'and edit it.'))
+ ->setExamples('**unlock** D123')
->setArguments(
array(
array(
@@ -27,12 +27,10 @@
$obj_names = $args->getArg('objects');
if (!$obj_names) {
throw new PhutilArgumentUsageException(
- pht(
- 'Specify the name of an object to unlock.'));
+ pht('Specify the name of an object to unlock.'));
} else if (count($obj_names) > 1) {
throw new PhutilArgumentUsageException(
- pht(
- 'Specify the name of exactly one object to unlock.'));
+ pht('Specify the name of exactly one object to unlock.'));
}
$object = id(new PhabricatorObjectQuery())
@@ -43,9 +41,7 @@
if (!$object) {
$name = head($obj_names);
throw new PhutilArgumentUsageException(
- pht(
- "No such object '%s'!",
- $name));
+ pht("No such object '%s'!", $name));
}
$handle = id(new PhabricatorHandleQuery())
diff --git a/src/applications/policy/query/PhabricatorPolicyQuery.php b/src/applications/policy/query/PhabricatorPolicyQuery.php
--- a/src/applications/policy/query/PhabricatorPolicyQuery.php
+++ b/src/applications/policy/query/PhabricatorPolicyQuery.php
@@ -56,8 +56,10 @@
protected function loadPage() {
if ($this->object && $this->phids) {
throw new Exception(
- 'You can not issue a policy query with both setObject() and '.
- 'setPHIDs().');
+ pht(
+ 'You can not issue a policy query with both %s and %s.',
+ 'setObject()',
+ 'setPHIDs()'));
} else if ($this->object) {
$phids = $this->loadObjectPolicyPHIDs();
} else {
@@ -128,7 +130,7 @@
public static function getGlobalPolicy($policy) {
if (!self::isGlobalPolicy($policy)) {
- throw new Exception("Policy '{$policy}' is not a global policy!");
+ throw new Exception(pht("Policy '%s' is not a global policy!", $policy));
}
return idx(self::getGlobalPolicies(), $policy);
}
diff --git a/src/applications/policy/storage/PhabricatorPolicy.php b/src/applications/policy/storage/PhabricatorPolicy.php
--- a/src/applications/policy/storage/PhabricatorPolicy.php
+++ b/src/applications/policy/storage/PhabricatorPolicy.php
@@ -56,17 +56,21 @@
if (!$handle) {
throw new Exception(
- "Policy identifier is an object PHID ('{$policy_identifier}'), but no ".
- "object handle was provided. A handle must be provided for object ".
- "policies.");
+ pht(
+ "Policy identifier is an object PHID ('%s'), but no object handle ".
+ "was provided. A handle must be provided for object policies.",
+ $policy_identifier));
}
$handle_phid = $handle->getPHID();
if ($policy_identifier != $handle_phid) {
throw new Exception(
- "Policy identifier is an object PHID ('{$policy_identifier}'), but ".
- "the provided handle has a different PHID ('{$handle_phid}'). The ".
- "handle must correspond to the policy identifier.");
+ pht(
+ "Policy identifier is an object PHID ('%s'), but the provided ".
+ "handle has a different PHID ('%s'). The handle must correspond ".
+ "to the policy identifier.",
+ $policy_identifier,
+ $handle_phid));
}
$policy = id(new PhabricatorPolicy())
diff --git a/src/applications/ponder/application/PhabricatorPonderApplication.php b/src/applications/ponder/application/PhabricatorPonderApplication.php
--- a/src/applications/ponder/application/PhabricatorPonderApplication.php
+++ b/src/applications/ponder/application/PhabricatorPonderApplication.php
@@ -29,8 +29,8 @@
}
public function loadStatus(PhabricatorUser $user) {
- // replace with "x new unanswered questions" or some such
- // make sure to use self::formatStatusCount and friends...!
+ // Replace with "x new unanswered questions" or some such
+ // make sure to use `self::formatStatusCount` and friends...!
$status = array();
return $status;
diff --git a/src/applications/ponder/constants/PonderQuestionStatus.php b/src/applications/ponder/constants/PonderQuestionStatus.php
--- a/src/applications/ponder/constants/PonderQuestionStatus.php
+++ b/src/applications/ponder/constants/PonderQuestionStatus.php
@@ -17,7 +17,7 @@
self::STATUS_OPEN => pht('Open'),
self::STATUS_CLOSED => pht('Closed by author'),
);
- return idx($map, $status, '???');
+ return idx($map, $status, pht('Unknown'));
}
public static function getQuestionStatusTagColor($status) {
diff --git a/src/applications/ponder/controller/PonderAnswerSaveController.php b/src/applications/ponder/controller/PonderAnswerSaveController.php
--- a/src/applications/ponder/controller/PonderAnswerSaveController.php
+++ b/src/applications/ponder/controller/PonderAnswerSaveController.php
@@ -27,8 +27,7 @@
->setUser($viewer)
->setTitle(pht('Empty Answer'))
->appendChild(
- phutil_tag('p', array(), pht(
- 'Your answer must not be empty.')))
+ phutil_tag('p', array(), pht('Your answer must not be empty.')))
->addCancelButton('/Q'.$question_id);
return id(new AphrontDialogResponse())->setDialog($dialog);
diff --git a/src/applications/ponder/editor/PonderVoteEditor.php b/src/applications/ponder/editor/PonderVoteEditor.php
--- a/src/applications/ponder/editor/PonderVoteEditor.php
+++ b/src/applications/ponder/editor/PonderVoteEditor.php
@@ -25,7 +25,7 @@
public function saveVote() {
$actor = $this->requireActor();
if (!$this->votable) {
- throw new Exception('Must set votable before saving vote');
+ throw new Exception(pht('Must set votable before saving vote.'));
}
$votable = $this->votable;
@@ -58,7 +58,7 @@
$curvote = PonderVote::VOTE_NONE;
}
- // adjust votable's score by this much
+ // Adjust votable's score by this much.
$delta = $newvote - $curvote;
queryfx($conn,
diff --git a/src/applications/ponder/mail/PonderQuestionReplyHandler.php b/src/applications/ponder/mail/PonderQuestionReplyHandler.php
--- a/src/applications/ponder/mail/PonderQuestionReplyHandler.php
+++ b/src/applications/ponder/mail/PonderQuestionReplyHandler.php
@@ -5,7 +5,7 @@
public function validateMailReceiver($mail_receiver) {
if (!($mail_receiver instanceof PonderQuestion)) {
- throw new Exception('Mail receiver is not a PonderQuestion!');
+ throw new Exception(pht('Mail receiver is not a %s!', 'PonderQuestion'));
}
}
diff --git a/src/applications/ponder/phid/PonderAnswerPHIDType.php b/src/applications/ponder/phid/PonderAnswerPHIDType.php
--- a/src/applications/ponder/phid/PonderAnswerPHIDType.php
+++ b/src/applications/ponder/phid/PonderAnswerPHIDType.php
@@ -32,7 +32,7 @@
$question = $answer->getQuestion();
$question_title = $question->getFullTitle();
- $handle->setName("{$question_title} (Answer {$id})");
+ $handle->setName(pht('%s (Answer %s)', $question_title, $id));
$handle->setURI($answer->getURI());
}
}
diff --git a/src/applications/ponder/storage/PonderQuestion.php b/src/applications/ponder/storage/PonderQuestion.php
--- a/src/applications/ponder/storage/PonderQuestion.php
+++ b/src/applications/ponder/storage/PonderQuestion.php
@@ -251,8 +251,7 @@
public function describeAutomaticCapability($capability) {
- return pht(
- 'The user who asked a question can always view and edit it.');
+ return pht('The user who asked a question can always view and edit it.');
}
diff --git a/src/applications/ponder/storage/PonderQuestionTransaction.php b/src/applications/ponder/storage/PonderQuestionTransaction.php
--- a/src/applications/ponder/storage/PonderQuestionTransaction.php
+++ b/src/applications/ponder/storage/PonderQuestionTransaction.php
@@ -295,7 +295,7 @@
if (count($add) != 1) {
throw new Exception(
- 'There should be only one answer added at a time.');
+ pht('There should be only one answer added at a time.'));
}
return reset($add);
@@ -303,7 +303,7 @@
/**
* Generally, the answer object is only available if the transaction
- * type is self::TYPE_ANSWERS.
+ * type is `self::TYPE_ANSWERS`.
*
* Some stories - notably ones made before D7027 - will be of the more
* generic @{class:PhabricatorApplicationTransactionFeedStory}. These
diff --git a/src/applications/project/editor/__tests__/PhabricatorProjectEditorTestCase.php b/src/applications/project/editor/__tests__/PhabricatorProjectEditorTestCase.php
--- a/src/applications/project/editor/__tests__/PhabricatorProjectEditorTestCase.php
+++ b/src/applications/project/editor/__tests__/PhabricatorProjectEditorTestCase.php
@@ -100,11 +100,13 @@
$proj = $this->refreshProject($proj, $user, true);
$this->assertTrue(
(bool)$proj,
- 'Assumption that projects are default visible to any user when created.');
+ pht(
+ 'Assumption that projects are default visible '.
+ 'to any user when created.'));
$this->assertFalse(
$proj->isUserMember($user->getPHID()),
- 'Arbitrary user not member of project.');
+ pht('Arbitrary user not member of project.'));
// Join the project.
$this->joinProject($proj, $user);
@@ -114,7 +116,7 @@
$this->assertTrue(
$proj->isUserMember($user->getPHID()),
- 'Join works.');
+ pht('Join works.'));
// Join the project again.
@@ -125,7 +127,7 @@
$this->assertTrue(
$proj->isUserMember($user->getPHID()),
- 'Joining an already-joined project is a no-op.');
+ pht('Joining an already-joined project is a no-op.'));
// Leave the project.
@@ -136,7 +138,7 @@
$this->assertFalse(
$proj->isUserMember($user->getPHID()),
- 'Leave works.');
+ pht('Leave works.'));
// Leave the project again.
@@ -147,7 +149,7 @@
$this->assertFalse(
$proj->isUserMember($user->getPHID()),
- 'Leaving an already-left project is a no-op.');
+ pht('Leaving an already-left project is a no-op.'));
// If a user can't edit or join a project, joining fails.
@@ -175,7 +177,7 @@
$proj = $this->refreshProject($proj, $user, true);
$this->assertTrue(
$proj->isUserMember($user->getPHID()),
- 'Join allowed with edit permission.');
+ pht('Join allowed with edit permission.'));
$this->leaveProject($proj, $user);
@@ -189,7 +191,7 @@
$proj = $this->refreshProject($proj, $user, true);
$this->assertTrue(
$proj->isUserMember($user->getPHID()),
- 'Join allowed with join permission.');
+ pht('Join allowed with join permission.'));
// A user can leave a project even if they can't edit it or join.
@@ -202,7 +204,7 @@
$proj = $this->refreshProject($proj, $user, true);
$this->assertFalse(
$proj->isUserMember($user->getPHID()),
- 'Leave allowed without any permission.');
+ pht('Leave allowed without any permission.'));
}
private function refreshProject(
diff --git a/src/applications/project/query/PhabricatorProjectQuery.php b/src/applications/project/query/PhabricatorProjectQuery.php
--- a/src/applications/project/query/PhabricatorProjectQuery.php
+++ b/src/applications/project/query/PhabricatorProjectQuery.php
@@ -259,7 +259,9 @@
break;
default:
throw new Exception(
- "Unknown project status '{$this->status}'!");
+ pht(
+ "Unknown project status '%s'!",
+ $this->status));
}
$where[] = qsprintf(
$conn_r,
diff --git a/src/applications/project/remarkup/__tests__/ProjectRemarkupRuleTestCase.php b/src/applications/project/remarkup/__tests__/ProjectRemarkupRuleTestCase.php
--- a/src/applications/project/remarkup/__tests__/ProjectRemarkupRuleTestCase.php
+++ b/src/applications/project/remarkup/__tests__/ProjectRemarkupRuleTestCase.php
@@ -101,7 +101,7 @@
),
),
- 'This is \'#urgent\'.' => array(
+ "This is '#urgent'." => array(
'embed' => array(),
'ref' => array(
array(
diff --git a/src/applications/project/storage/PhabricatorProjectTransaction.php b/src/applications/project/storage/PhabricatorProjectTransaction.php
--- a/src/applications/project/storage/PhabricatorProjectTransaction.php
+++ b/src/applications/project/storage/PhabricatorProjectTransaction.php
@@ -120,16 +120,16 @@
// TODO: Some day, it would be nice to show the images.
if (!$old) {
return pht(
- '%s set this project\'s image to %s.',
+ "%s set this project's image to %s.",
$author_handle,
$this->renderHandleLink($new));
} else if (!$new) {
return pht(
- '%s removed this project\'s image.',
+ "%s removed this project's image.",
$author_handle);
} else {
return pht(
- '%s updated this project\'s image from %s to %s.',
+ "%s updated this project's image from %s to %s.",
$author_handle,
$this->renderHandleLink($old),
$this->renderHandleLink($new));
@@ -137,24 +137,24 @@
case PhabricatorProjectTransaction::TYPE_ICON:
return pht(
- '%s set this project\'s icon to %s.',
+ "%s set this project's icon to %s.",
$author_handle,
PhabricatorProjectIcon::getLabel($new));
case PhabricatorProjectTransaction::TYPE_COLOR:
return pht(
- '%s set this project\'s color to %s.',
+ "%s set this project's color to %s.",
$author_handle,
PHUITagView::getShadeName($new));
case PhabricatorProjectTransaction::TYPE_LOCKED:
if ($new) {
return pht(
- '%s locked this project\'s membership.',
+ "%s locked this project's membership.",
$author_handle);
} else {
return pht(
- '%s unlocked this project\'s membership.',
+ "%s unlocked this project's membership.",
$author_handle);
}
diff --git a/src/applications/project/typeahead/PhabricatorProjectLogicalUserDatasource.php b/src/applications/project/typeahead/PhabricatorProjectLogicalUserDatasource.php
--- a/src/applications/project/typeahead/PhabricatorProjectLogicalUserDatasource.php
+++ b/src/applications/project/typeahead/PhabricatorProjectLogicalUserDatasource.php
@@ -28,13 +28,12 @@
'arguments' => pht('username'),
'summary' => pht("Find results in any of a user's projects."),
'description' => pht(
- 'This function allows you to find results associated with any '.
- 'of the projects a specified user is a member of. For example, '.
- 'this will find results associated with all of the projects '.
- '`alincoln` is a member of:'.
- "\n\n".
- '> projects(alincoln)'.
- "\n\n"),
+ "This function allows you to find results associated with any ".
+ "of the projects a specified user is a member of. For example, ".
+ "this will find results associated with all of the projects ".
+ "`%s` is a member of:\n\n%s\n\n",
+ 'alincoln',
+ '> projects(alincoln)'),
),
);
}
diff --git a/src/applications/project/typeahead/PhabricatorProjectNoProjectsDatasource.php b/src/applications/project/typeahead/PhabricatorProjectNoProjectsDatasource.php
--- a/src/applications/project/typeahead/PhabricatorProjectNoProjectsDatasource.php
+++ b/src/applications/project/typeahead/PhabricatorProjectNoProjectsDatasource.php
@@ -21,11 +21,10 @@
'name' => pht('Not In Any Projects'),
'summary' => pht('Find results which are not in any projects.'),
'description' => pht(
- 'This function matches results which are not associated with any '.
- 'projects. It is usually most often used to find objects which '.
- 'might have slipped through the cracks and not been organized '.
- 'properly.'.
- "\n\n".
+ "This function matches results which are not associated with any ".
+ "projects. It is usually most often used to find objects which ".
+ "might have slipped through the cracks and not been organized ".
+ "properly.\n\n%s",
"> null()"),
),
);
diff --git a/src/applications/releeph/commitfinder/ReleephCommitFinder.php b/src/applications/releeph/commitfinder/ReleephCommitFinder.php
--- a/src/applications/releeph/commitfinder/ReleephCommitFinder.php
+++ b/src/applications/releeph/commitfinder/ReleephCommitFinder.php
@@ -37,13 +37,17 @@
->executeOne();
if (!$diff_rev) {
throw new ReleephCommitFinderException(
- "{$partial_string} does not refer to an existing diff.");
+ pht(
+ '%s does not refer to an existing diff.',
+ $partial_string));
}
$commit_phids = $diff_rev->getCommitPHIDs();
if (!$commit_phids) {
throw new ReleephCommitFinderException(
- "{$partial_string} has no commits associated with it yet.");
+ pht(
+ '%s has no commits associated with it yet.',
+ $partial_string));
}
$this->objectPHID = $diff_rev->getPHID();
@@ -64,10 +68,11 @@
$partial_string, $matches)) {
$callsign = $matches['callsign'];
if ($callsign != $repository->getCallsign()) {
- throw new ReleephCommitFinderException(sprintf(
- '%s is in a different repository to this Releeph project (%s).',
- $partial_string,
- $repository->getCallsign()));
+ throw new ReleephCommitFinderException(
+ pht(
+ '%s is in a different repository to this Releeph project (%s).',
+ $partial_string,
+ $repository->getCallsign()));
} else {
$dr_data = $matches;
}
@@ -82,7 +87,10 @@
$dr_data['user'] = $this->getUser();
$dr = DiffusionRequest::newFromDictionary($dr_data);
} catch (Exception $ex) {
- $message = "No commit matches {$partial_string}: ".$ex->getMessage();
+ $message = pht(
+ 'No commit matches %s: %s',
+ $partial_string,
+ $ex->getMessage());
throw new ReleephCommitFinderException($message);
}
@@ -90,7 +98,9 @@
if (!$phabricator_repository_commit) {
throw new ReleephCommitFinderException(
- "The commit {$partial_string} doesn't exist in this repository.");
+ pht(
+ "The commit %s doesn't exist in this repository.",
+ $partial_string));
}
// When requesting a single commit, if it has an associated review we
diff --git a/src/applications/releeph/conduit/ReleephQueryRequestsConduitAPIMethod.php b/src/applications/releeph/conduit/ReleephQueryRequestsConduitAPIMethod.php
--- a/src/applications/releeph/conduit/ReleephQueryRequestsConduitAPIMethod.php
+++ b/src/applications/releeph/conduit/ReleephQueryRequestsConduitAPIMethod.php
@@ -8,8 +8,8 @@
}
public function getMethodDescription() {
- return
- 'Return information about all Releeph requests linked to the given ids.';
+ return pht(
+ 'Return information about all Releeph requests linked to the given ids.');
}
protected function defineParamTypes() {
diff --git a/src/applications/releeph/conduit/work/ReleephWorkCanPushConduitAPIMethod.php b/src/applications/releeph/conduit/work/ReleephWorkCanPushConduitAPIMethod.php
--- a/src/applications/releeph/conduit/work/ReleephWorkCanPushConduitAPIMethod.php
+++ b/src/applications/releeph/conduit/work/ReleephWorkCanPushConduitAPIMethod.php
@@ -11,7 +11,7 @@
}
public function getMethodDescription() {
- return 'Return whether the conduit user is allowed to push.';
+ return pht('Return whether the conduit user is allowed to push.');
}
protected function defineParamTypes() {
diff --git a/src/applications/releeph/conduit/work/ReleephWorkGetBranchCommitMessageConduitAPIMethod.php b/src/applications/releeph/conduit/work/ReleephWorkGetBranchCommitMessageConduitAPIMethod.php
--- a/src/applications/releeph/conduit/work/ReleephWorkGetBranchCommitMessageConduitAPIMethod.php
+++ b/src/applications/releeph/conduit/work/ReleephWorkGetBranchCommitMessageConduitAPIMethod.php
@@ -12,7 +12,7 @@
}
public function getMethodDescription() {
- return 'Get a commit message for committing a Releeph branch.';
+ return pht('Get a commit message for committing a Releeph branch.');
}
protected function defineParamTypes() {
@@ -60,19 +60,23 @@
$commit_message[] = $h_branch->getFullName();
$commit_message[] = $h_branch->getURI();
- $commit_message[] = 'Cut Point: '.$handles[$cut_phid]->getName();
+ $commit_message[] = pht('Cut Point: %s', $handles[$cut_phid]->getName());
$cut_point_pr_commit = id(new PhabricatorRepositoryCommit())
->loadOneWhere('phid = %s', $cut_phid);
$cut_point_commit_date = strftime(
'%Y-%m-%d %H:%M:%S%z',
$cut_point_pr_commit->getEpoch());
- $commit_message[] = "Cut Point Date: {$cut_point_commit_date}";
+ $commit_message[] = pht('Cut Point Date: %s', $cut_point_commit_date);
- $commit_message[] = 'Created By: '.$handles[$creator_phid]->getName();
+ $commit_message[] = pht(
+ 'Created By: %s',
+ $handles[$creator_phid]->getName());
$project_uri = $project->getURI();
- $commit_message[] = 'Project: '.$h_project->getName().' '.$project_uri;
+ $commit_message[] = pht(
+ 'Project: %s',
+ $h_project->getName().' '.$project_uri);
/**
* Required for 090-limit_new_branch_creations.sh in
diff --git a/src/applications/releeph/conduit/work/ReleephWorkGetBranchConduitAPIMethod.php b/src/applications/releeph/conduit/work/ReleephWorkGetBranchConduitAPIMethod.php
--- a/src/applications/releeph/conduit/work/ReleephWorkGetBranchConduitAPIMethod.php
+++ b/src/applications/releeph/conduit/work/ReleephWorkGetBranchConduitAPIMethod.php
@@ -12,7 +12,7 @@
}
public function getMethodDescription() {
- return 'Return information to help checkout / cut a Releeph branch.';
+ return pht('Return information to help checkout / cut a Releeph branch.');
}
protected function defineParamTypes() {
diff --git a/src/applications/releeph/controller/branch/ReleephBranchCreateController.php b/src/applications/releeph/controller/branch/ReleephBranchCreateController.php
--- a/src/applications/releeph/controller/branch/ReleephBranchCreateController.php
+++ b/src/applications/releeph/controller/branch/ReleephBranchCreateController.php
@@ -94,17 +94,16 @@
->setLabel(pht('Symbolic Name'))
->setName('symbolicName')
->setValue($symbolic_name)
- ->setCaption(pht('Mutable alternate name, for easy reference, '.
- '(e.g. "LATEST")')))
+ ->setCaption(pht(
+ 'Mutable alternate name, for easy reference, (e.g. "LATEST")')))
->appendChild(
id(new AphrontFormTextControl())
->setLabel(pht('Cut point'))
->setName('cutPoint')
->setValue($cut_point)
->setError($e_cut)
- ->setCaption(
- pht('A commit ID for your repo type, or a '.
- 'Diffusion ID like "rE123"')))
+ ->setCaption(pht(
+ 'A commit ID for your repo type, or a Diffusion ID like "rE123"')))
->appendChild($branch_date_control)
->appendChild(
id(new AphrontFormSubmitControl())
diff --git a/src/applications/releeph/controller/branch/ReleephBranchEditController.php b/src/applications/releeph/controller/branch/ReleephBranchEditController.php
--- a/src/applications/releeph/controller/branch/ReleephBranchEditController.php
+++ b/src/applications/releeph/controller/branch/ReleephBranchEditController.php
@@ -85,8 +85,8 @@
->setLabel(pht('Symbolic Name'))
->setName('symbolicName')
->setValue($symbolic_name)
- ->setCaption(pht('Mutable alternate name, for easy reference, '.
- '(e.g. "LATEST")')))
+ ->setCaption(pht(
+ 'Mutable alternate name, for easy reference, (e.g. "LATEST")')))
->appendChild(
id(new AphrontFormSubmitControl())
->addCancelButton($this->getBranchViewURI($branch))
diff --git a/src/applications/releeph/controller/product/ReleephProductCreateController.php b/src/applications/releeph/controller/product/ReleephProductCreateController.php
--- a/src/applications/releeph/controller/product/ReleephProductCreateController.php
+++ b/src/applications/releeph/controller/product/ReleephProductCreateController.php
@@ -73,7 +73,7 @@
->setName('arcPrID')
->setValue($arc_pr_id)
->setCaption(pht(
- 'If your Arc project isn\'t listed, associate it with a repository %s',
+ "If your Arc project isn't listed, associate it with a repository %s.",
phutil_tag(
'a',
array(
@@ -100,8 +100,8 @@
->setName('trunkBranch')
->setValue($trunk_branch)
->setError($e_trunk_branch)
- ->setCaption(pht('The development branch, '.
- 'from which requests will be picked.')))
+ ->setCaption(pht(
+ 'The development branch, from which requests will be picked.')))
->appendChild($branch_name_preview)
->appendChild(
id(new AphrontFormSubmitControl())
diff --git a/src/applications/releeph/controller/request/ReleephRequestActionController.php b/src/applications/releeph/controller/request/ReleephRequestActionController.php
--- a/src/applications/releeph/controller/request/ReleephRequestActionController.php
+++ b/src/applications/releeph/controller/request/ReleephRequestActionController.php
@@ -64,8 +64,9 @@
// We're all good!
} else {
throw new Exception(
- "Bug! Only pushers or the requestor can manually change a ".
- "request's in-branch status!");
+ pht(
+ "Bug! Only pushers or the requestor can manually change a ".
+ "request's in-branch status!"));
}
if ($action === 'mark-manually-picked') {
@@ -89,7 +90,8 @@
break;
default:
- throw new Exception("unknown or unimplemented action {$action}");
+ throw new Exception(
+ pht('Unknown or unimplemented action %s.', $action));
}
$editor->applyTransactions($pull, $xactions);
diff --git a/src/applications/releeph/controller/request/ReleephRequestDifferentialCreateController.php b/src/applications/releeph/controller/request/ReleephRequestDifferentialCreateController.php
--- a/src/applications/releeph/controller/request/ReleephRequestDifferentialCreateController.php
+++ b/src/applications/releeph/controller/request/ReleephRequestDifferentialCreateController.php
@@ -32,21 +32,22 @@
'arcanistProjectID = %d AND isActive = 1',
$arc_project->getID());
if (!$projects) {
- throw new Exception(sprintf(
- "D%d belongs to the '%s' Arcanist project, ".
- "which is not part of any Releeph project!",
- $this->revision->getID(),
- $arc_project->getName()));
+ throw new Exception(
+ pht(
+ "%s belongs to the '%s' Arcanist project, ".
+ "which is not part of any Releeph project!",
+ 'D'.$this->revision->getID(),
+ $arc_project->getName()));
}
$branches = id(new ReleephBranch())->loadAllWhere(
'releephProjectID IN (%Ld) AND isActive = 1',
mpull($projects, 'getID'));
if (!$branches) {
- throw new Exception(sprintf(
- 'D%d could be in the Releeph project(s) %s, '.
+ throw new Exception(pht(
+ '%s could be in the Releeph project(s) %s, '.
'but this project / none of these projects have open branches.',
- $this->revision->getID(),
+ 'D'.$this->revision->getID(),
implode(', ', mpull($projects, 'getName'))));
}
@@ -69,9 +70,10 @@
->addCancelButton('/D'.$request->getStr('D'));
$dialog->appendChild(
- pht('This differential revision changes code that is associated '.
- 'with multiple Releeph branches. '.
- 'Please select the branch where you would like this code to be picked.'));
+ pht(
+ 'This differential revision changes code that is associated '.
+ 'with multiple Releeph branches. Please select the branch '.
+ 'where you would like this code to be picked.'));
foreach ($branch_groups as $project_id => $branches) {
$project = idx($projects, $project_id);
diff --git a/src/applications/releeph/controller/request/ReleephRequestEditController.php b/src/applications/releeph/controller/request/ReleephRequestEditController.php
--- a/src/applications/releeph/controller/request/ReleephRequestEditController.php
+++ b/src/applications/releeph/controller/request/ReleephRequestEditController.php
@@ -93,8 +93,8 @@
if ($request_identifier ===
ReleephRequestTypeaheadControl::PLACEHOLDER) {
- $errors[] = 'No commit ID was provided.';
- $e_request_identifier = 'Required';
+ $errors[] = pht('No commit ID was provided.');
+ $e_request_identifier = pht('Required');
} else {
$pr_commit = null;
$finder = id(new ReleephCommitFinder())
@@ -103,9 +103,10 @@
try {
$pr_commit = $finder->fromPartial($request_identifier);
} catch (Exception $e) {
- $e_request_identifier = 'Invalid';
- $errors[] =
- "Request {$request_identifier} is probably not a valid commit";
+ $e_request_identifier = pht('Invalid');
+ $errors[] = pht(
+ 'Request %s is probably not a valid commit.',
+ $request_identifier);
$errors[] = $e->getMessage();
}
@@ -126,7 +127,7 @@
if ($existing) {
return id(new AphrontRedirectResponse())
->setURI('/releeph/request/edit/'.$existing->getID().
- '?existing=1');
+ '?existing=1');
}
$xactions[] = id(new ReleephRequestTransaction())
@@ -204,8 +205,8 @@
$notice_view = null;
if ($request->getInt('existing')) {
$notice_messages = array(
- 'You are editing an existing pick request!',
- hsprintf(
+ pht('You are editing an existing pick request!'),
+ pht(
'Requested %s by %s',
$age_string,
$handles[$pull->getRequestUserPHID()]->renderLink()),
@@ -222,12 +223,12 @@
$form
->appendChild(
id(new AphrontFormMarkupControl())
- ->setLabel('Original Commit')
+ ->setLabel(pht('Original Commit'))
->setValue(
$handles[$pull->getRequestCommitPHID()]->renderLink()))
->appendChild(
id(new AphrontFormMarkupControl())
- ->setLabel('Requestor')
+ ->setLabel(pht('Requestor'))
->setValue(hsprintf(
'%s %s',
$handles[$pull->getRequestUserPHID()]->renderLink(),
@@ -267,8 +268,9 @@
->setError($e_request_identifier)
->setStartTime($branch_cut_point->getEpoch())
->setCaption(
- 'Start typing to autocomplete on commit title, '.
- 'or give a Phabricator commit identifier like rFOO1234'));
+ pht(
+ 'Start typing to autocomplete on commit title, '.
+ 'or give a Phabricator commit identifier like rFOO1234.')));
}
}
@@ -291,7 +293,7 @@
$form->appendChild(
id(new AphrontFormSubmitControl())
- ->addCancelButton($cancel_uri, 'Cancel')
+ ->addCancelButton($cancel_uri, pht('Cancel'))
->setValue($submit_name));
$box = id(new PHUIObjectBoxView())
diff --git a/src/applications/releeph/editor/ReleephBranchEditor.php b/src/applications/releeph/editor/ReleephBranchEditor.php
--- a/src/applications/releeph/editor/ReleephBranchEditor.php
+++ b/src/applications/releeph/editor/ReleephBranchEditor.php
@@ -15,9 +15,10 @@
return $this;
}
- public function newBranchFromCommit(PhabricatorRepositoryCommit $cut_point,
- $branch_date,
- $symbolic_name = null) {
+ public function newBranchFromCommit(
+ PhabricatorRepositoryCommit $cut_point,
+ $branch_date,
+ $symbolic_name = null) {
$template = $this->releephProject->getDetail('branchTemplate');
if (!$template) {
diff --git a/src/applications/releeph/editor/ReleephRequestTransactionalEditor.php b/src/applications/releeph/editor/ReleephRequestTransactionalEditor.php
--- a/src/applications/releeph/editor/ReleephRequestTransactionalEditor.php
+++ b/src/applications/releeph/editor/ReleephRequestTransactionalEditor.php
@@ -299,10 +299,13 @@
$type = $xaction->getTransactionType();
$new = $xaction->getNewValue();
phlog(
- "Unknown discovery action '{$action}' ".
- "for xaction of type {$type} ".
- "with new value {$new} ".
- "mentioning RQ{$id}!");
+ pht(
+ "Unknown discovery action '%s' for xaction of type %s ".
+ "with new value %s mentioning %s!",
+ $action,
+ $type,
+ $new,
+ 'RQ'.$id));
break;
}
}
diff --git a/src/applications/releeph/field/selector/ReleephFieldSelector.php b/src/applications/releeph/field/selector/ReleephFieldSelector.php
--- a/src/applications/releeph/field/selector/ReleephFieldSelector.php
+++ b/src/applications/releeph/field/selector/ReleephFieldSelector.php
@@ -26,14 +26,17 @@
$field = idx($map, $class);
if (!$field) {
throw new Exception(
- "Tried to select a in instance of '{$class}' but that field ".
- "is not configured for this project!");
+ pht(
+ "Tried to select a in instance of '%s' but that field ".
+ "is not configured for this project!",
+ $class));
}
if (idx($result, $class)) {
throw new Exception(
- "You have asked to select the field '{$class}' ".
- "more than once!");
+ pht(
+ "You have asked to select the field '%s' more than once!",
+ $class));
}
$result[$class] = $field;
diff --git a/src/applications/releeph/field/specification/ReleephDependsOnFieldSpecification.php b/src/applications/releeph/field/specification/ReleephDependsOnFieldSpecification.php
--- a/src/applications/releeph/field/specification/ReleephDependsOnFieldSpecification.php
+++ b/src/applications/releeph/field/specification/ReleephDependsOnFieldSpecification.php
@@ -2,6 +2,7 @@
final class ReleephDependsOnFieldSpecification
extends ReleephFieldSpecification {
+
public function getFieldKey() {
return 'dependsOn';
}
diff --git a/src/applications/releeph/field/specification/ReleephDiffChurnFieldSpecification.php b/src/applications/releeph/field/specification/ReleephDiffChurnFieldSpecification.php
--- a/src/applications/releeph/field/specification/ReleephDiffChurnFieldSpecification.php
+++ b/src/applications/releeph/field/specification/ReleephDiffChurnFieldSpecification.php
@@ -13,7 +13,7 @@
}
public function getName() {
- return 'Churn';
+ return pht('Churn');
}
public function renderPropertyViewValue(array $handles) {
@@ -75,7 +75,7 @@
$blurb = head($parts);
} else {
$last = array_pop($parts);
- $blurb = implode(', ', $parts).' and '.$last;
+ $blurb = pht('%s and %s', implode(', ', $parts), $last);
}
}
diff --git a/src/applications/releeph/field/specification/ReleephDiffSizeFieldSpecification.php b/src/applications/releeph/field/specification/ReleephDiffSizeFieldSpecification.php
--- a/src/applications/releeph/field/specification/ReleephDiffSizeFieldSpecification.php
+++ b/src/applications/releeph/field/specification/ReleephDiffSizeFieldSpecification.php
@@ -12,7 +12,7 @@
}
public function getName() {
- return 'Size';
+ return pht('Size');
}
public function renderPropertyViewValue(array $handles) {
@@ -50,10 +50,10 @@
Javelin::initBehavior('phabricator-tooltips');
require_celerity_resource('aphront-tooltip-css');
- $test_blurb =
- pht('%d line(s)', $mr_changes['tests']['lines']).' and '.
- pht('%d path(s)', count($mr_changes['tests']['paths'])).
- " contain changes to test code:\n";
+ $test_blurb = pht(
+ "%d line(s) and %d path(s) contain changes to test code:\n",
+ $mr_changes['tests']['lines'],
+ count($mr_changes['tests']['paths']));
foreach ($mr_changes['tests']['paths'] as $mr_test_path) {
$test_blurb .= pht("%s\n", $mr_test_path);
}
@@ -73,9 +73,11 @@
}
$blurb = hsprintf('%s%s.',
- pht('%d line(s)', $mr_changes['code']['lines']).' and '.
- pht('%d path(s)', count($mr_changes['code']['paths'])).' over '.
- pht('%d diff(s)', count($diffs)),
+ pht(
+ '%d line(s) and %d path(s) over %d diff(s)',
+ $mr_changes['code']['lines'],
+ $mr_changes['code']['paths'],
+ count($diffs)),
$test_tag);
return id(new AphrontProgressBarView())
diff --git a/src/applications/releeph/field/specification/ReleephFieldSpecification.php b/src/applications/releeph/field/specification/ReleephFieldSpecification.php
--- a/src/applications/releeph/field/specification/ReleephFieldSpecification.php
+++ b/src/applications/releeph/field/specification/ReleephFieldSpecification.php
@@ -48,8 +48,7 @@
* Storage keys are reused for form controls, and periods in form control
* names break HTML forms.
*/
- throw new Exception(
- "You can't use '.' in storage keys!");
+ throw new Exception(pht("You can't use '%s' in storage keys!", '.'));
}
return $key;
}
diff --git a/src/applications/releeph/field/specification/ReleephIntentFieldSpecification.php b/src/applications/releeph/field/specification/ReleephIntentFieldSpecification.php
--- a/src/applications/releeph/field/specification/ReleephIntentFieldSpecification.php
+++ b/src/applications/releeph/field/specification/ReleephIntentFieldSpecification.php
@@ -83,11 +83,11 @@
}
public function renderLabelForCommitMessage() {
- return 'Approved By';
+ return pht('Approved By');
}
public function renderLabelForRevertMessage() {
- return 'Rejected By';
+ return pht('Rejected By');
}
public function renderValueForCommitMessage() {
@@ -120,13 +120,13 @@
if ($is_pusher) {
if ($is_requestor) {
- $token = "{$name} (pusher and requestor)";
+ $token = pht('%s (pusher and requestor)', $name);
} else {
$token = "{$name} (pusher)";
}
} else {
if ($is_requestor) {
- $token = "{$name} (requestor)";
+ $token = pht('%s (requestor)', $name);
} else {
$token = $name;
}
diff --git a/src/applications/releeph/field/specification/ReleephLevelFieldSpecification.php b/src/applications/releeph/field/specification/ReleephLevelFieldSpecification.php
--- a/src/applications/releeph/field/specification/ReleephLevelFieldSpecification.php
+++ b/src/applications/releeph/field/specification/ReleephLevelFieldSpecification.php
@@ -79,7 +79,7 @@
$label = $this->getName();
throw new ReleephFieldParseException(
$this,
- "You must provide a {$label} level");
+ pht('You must provide a %s level.', $label));
}
$levels = $this->getLevels();
@@ -87,7 +87,10 @@
$label = $this->getName();
throw new ReleephFieldParseException(
$this,
- "Level '{$value}' is not a valid {$label} level in this project.");
+ pht(
+ "Level '%s' is not a valid %s level in this project.",
+ $value,
+ $label));
}
}
@@ -101,8 +104,9 @@
if (!$level) {
throw new ReleephFieldParseException(
$this,
- "No value given for {$label}, ".
- "and no default is given for this level!");
+ pht(
+ 'No value given for %s, and no default is given for this level!',
+ $label));
}
} else {
$level = $this->getLevelByName($name);
@@ -111,7 +115,7 @@
if (!$level) {
throw new ReleephFieldParseException(
$this,
- "Unknown {$label} level name '{$name}'");
+ pht("Unknown %s level name '%s'", $label, $name));
}
$this->setValue($level);
}
diff --git a/src/applications/releeph/field/specification/ReleephReasonFieldSpecification.php b/src/applications/releeph/field/specification/ReleephReasonFieldSpecification.php
--- a/src/applications/releeph/field/specification/ReleephReasonFieldSpecification.php
+++ b/src/applications/releeph/field/specification/ReleephReasonFieldSpecification.php
@@ -8,7 +8,7 @@
}
public function getName() {
- return 'Reason';
+ return pht('Reason');
}
public function getStorageKey() {
@@ -36,7 +36,7 @@
public function renderEditControl(array $handles) {
return id(new AphrontFormTextAreaControl())
- ->setLabel('Reason')
+ ->setLabel(pht('Reason'))
->setName('reason')
->setError($this->error)
->setValue($this->getValue());
@@ -47,14 +47,14 @@
$this->error = 'Required';
throw new ReleephFieldParseException(
$this,
- 'You must give a reason for your request.');
+ pht('You must give a reason for your request.'));
}
}
public function renderHelpForArcanist() {
- $text =
+ $text = pht(
"Fully explain why you are requesting this code be included ".
- "in the next release.\n";
+ "in the next release.\n");
return phutil_console_wrap($text, 8);
}
@@ -63,7 +63,7 @@
}
public function renderLabelForCommitMessage() {
- return 'Request Reason';
+ return pht('Request Reason');
}
public function renderValueForCommitMessage() {
diff --git a/src/applications/releeph/field/specification/ReleephRequestorFieldSpecification.php b/src/applications/releeph/field/specification/ReleephRequestorFieldSpecification.php
--- a/src/applications/releeph/field/specification/ReleephRequestorFieldSpecification.php
+++ b/src/applications/releeph/field/specification/ReleephRequestorFieldSpecification.php
@@ -8,7 +8,7 @@
}
public function getName() {
- return 'Requestor';
+ return pht('Requestor');
}
public function getRequiredHandlePHIDsForPropertyView() {
@@ -35,7 +35,7 @@
}
public function renderLabelForCommitMessage() {
- return 'Requested By';
+ return pht('Requested By');
}
public function renderValueForCommitMessage() {
diff --git a/src/applications/releeph/field/specification/ReleephRevisionFieldSpecification.php b/src/applications/releeph/field/specification/ReleephRevisionFieldSpecification.php
--- a/src/applications/releeph/field/specification/ReleephRevisionFieldSpecification.php
+++ b/src/applications/releeph/field/specification/ReleephRevisionFieldSpecification.php
@@ -8,7 +8,7 @@
}
public function getName() {
- return 'Revision';
+ return pht('Revision');
}
public function getRequiredHandlePHIDsForPropertyView() {
diff --git a/src/applications/releeph/query/ReleephBranchQuery.php b/src/applications/releeph/query/ReleephBranchQuery.php
--- a/src/applications/releeph/query/ReleephBranchQuery.php
+++ b/src/applications/releeph/query/ReleephBranchQuery.php
@@ -137,7 +137,7 @@
'isActive = 1');
break;
default:
- throw new Exception("Unknown status constant '{$status}'!");
+ throw new Exception(pht("Unknown status constant '%s'!", $status));
}
$where[] = $this->buildPagingClause($conn_r);
diff --git a/src/applications/releeph/query/ReleephProductSearchEngine.php b/src/applications/releeph/query/ReleephProductSearchEngine.php
--- a/src/applications/releeph/query/ReleephProductSearchEngine.php
+++ b/src/applications/releeph/query/ReleephProductSearchEngine.php
@@ -74,7 +74,7 @@
private function getActiveOptions() {
return array(
'all' => pht('Active and Inactive Products'),
- 'active' => pht('Active Prodcuts'),
+ 'active' => pht('Active Products'),
'inactive' => pht('Inactive Products'),
);
}
diff --git a/src/applications/releeph/query/ReleephRequestQuery.php b/src/applications/releeph/query/ReleephRequestQuery.php
--- a/src/applications/releeph/query/ReleephRequestQuery.php
+++ b/src/applications/releeph/query/ReleephRequestQuery.php
@@ -236,7 +236,7 @@
ReleephRequestStatus::REVERTED,
);
default:
- throw new Exception("Unknown status '{$this->status}'!");
+ throw new Exception(pht("Unknown status '%s'!", $this->status));
}
}
diff --git a/src/applications/releeph/storage/ReleephRequest.php b/src/applications/releeph/storage/ReleephRequest.php
--- a/src/applications/releeph/storage/ReleephRequest.php
+++ b/src/applications/releeph/storage/ReleephRequest.php
@@ -290,7 +290,7 @@
}
public function setStatus($value) {
- throw new Exception('`status` is now deprecated!');
+ throw new Exception(pht('`%s` is now deprecated!', 'status'));
}
/* -( Make magic Lisk methods private )------------------------------------ */
diff --git a/src/applications/releeph/view/branch/ReleephBranchPreviewView.php b/src/applications/releeph/view/branch/ReleephBranchPreviewView.php
--- a/src/applications/releeph/view/branch/ReleephBranchPreviewView.php
+++ b/src/applications/releeph/view/branch/ReleephBranchPreviewView.php
@@ -34,7 +34,9 @@
foreach ($required_params as $param_name) {
if (idx($all_params, $param_name) === null) {
throw new Exception(
- "'{$param_name}' is not set as either a static or dynamic!");
+ pht(
+ "'%s' is not set as either a static or dynamic!",
+ $param_name));
}
}
diff --git a/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectDeleteController.php b/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectDeleteController.php
--- a/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectDeleteController.php
+++ b/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectDeleteController.php
@@ -28,10 +28,11 @@
$dialog
->setUser($request->getUser())
->setTitle(pht('Really delete this arcanist project?'))
- ->appendChild(pht(
- 'Really delete the "%s" arcanist project? '.
+ ->appendChild(
+ pht(
+ 'Really delete the "%s" arcanist project? '.
'This operation can not be undone.',
- $arc_project->getName()))
+ $arc_project->getName()))
->setSubmitURI('/repository/project/delete/'.$this->id.'/')
->addSubmitButton(pht('Delete Arcanist Project'))
->addCancelButton('/repository/');
diff --git a/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php b/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php
--- a/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php
+++ b/src/applications/repository/controller/PhabricatorRepositoryArcanistProjectEditController.php
@@ -84,9 +84,10 @@
id(new AphrontFormTextControl())
->setLabel(pht('Indexed Languages'))
->setName('symbolIndexLanguages')
- ->setCaption(pht(
- 'Separate with commas, for example: %s',
- phutil_tag('tt', array(), 'php, py')))
+ ->setCaption(
+ pht(
+ 'Separate with commas, for example: %s',
+ phutil_tag('tt', array(), 'php, py')))
->setValue($langs))
->appendControl(
id(new AphrontFormTokenizerControl())
@@ -97,7 +98,7 @@
->appendChild(
id(new AphrontFormSubmitControl())
->addCancelButton('/repository/')
- ->setValue('Save'));
+ ->setValue(pht('Save')));
$panel = new PHUIObjectBoxView();
$panel->setHeaderText(pht('Edit Arcanist Project'));
diff --git a/src/applications/repository/engine/PhabricatorRepositoryEngine.php b/src/applications/repository/engine/PhabricatorRepositoryEngine.php
--- a/src/applications/repository/engine/PhabricatorRepositoryEngine.php
+++ b/src/applications/repository/engine/PhabricatorRepositoryEngine.php
@@ -23,7 +23,10 @@
*/
protected function getRepository() {
if ($this->repository === null) {
- throw new Exception('Call setRepository() to provide a repository!');
+ throw new Exception(
+ pht(
+ 'Call %s to provide a repository!',
+ 'setRepository()'));
}
return $this->repository;
diff --git a/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php b/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
--- a/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
+++ b/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php
@@ -245,26 +245,31 @@
if (is_dir($path)) {
$files = Filesystem::listDirectory($path, $include_hidden = true);
if (!$files) {
- $message =
- "Expected to find a git repository at '{$path}', but there ".
+ $message = pht(
+ "Expected to find a git repository at '%s', but there ".
"is an empty directory there. Remove the directory: the daemon ".
- "will run 'git clone' for you.";
+ "will run '%s' for you.",
+ $path,
+ 'git clone');
} else {
- $message =
- "Expected to find a git repository at '{$path}', but there is ".
+ $message = pht(
+ "Expected to find a git repository at '%s', but there is ".
"a non-repository directory (with other stuff in it) there. Move ".
"or remove this directory (or reconfigure the repository to use a ".
"different directory), and then either clone a repository ".
- "yourself or let the daemon do it.";
+ "yourself or let the daemon do it.",
+ $path);
}
} else if (is_file($path)) {
- $message =
- "Expected to find a git repository at '{$path}', but there is a ".
+ $message = pht(
+ "Expected to find a git repository at '%s', but there is a ".
"file there instead. Remove it and let the daemon clone a ".
- "repository for you.";
+ "repository for you.",
+ $path);
} else {
- $message =
- "Expected to find a git repository at '{$path}', but did not.";
+ $message = pht(
+ "Expected to find a git repository at '%s', but did not.",
+ $path);
}
} else {
$repo_path = rtrim($stdout, "\n");
@@ -277,18 +282,24 @@
// we're OK.
} else if (!Filesystem::pathsAreEquivalent($repo_path, $path)) {
$err = true;
- $message =
- "Expected to find repo at '{$path}', but the actual ".
- "git repository root for this directory is '{$repo_path}'. ".
- "Something is misconfigured. The repository's 'Local Path' should ".
- "be set to some place where the daemon can check out a working ".
- "copy, and should not be inside another git repository.";
+ $message = pht(
+ "Expected to find repo at '%s', but the actual git repository root ".
+ "for this directory is '%s'. Something is misconfigured. ".
+ "The repository's 'Local Path' should be set to some place where ".
+ "the daemon can check out a working copy, ".
+ "and should not be inside another git repository.",
+ $path,
+ $repo_path);
}
}
if ($err && $repository->canDestroyWorkingCopy()) {
- phlog("Repository working copy at '{$path}' failed sanity check; ".
- "destroying and re-cloning. {$message}");
+ phlog(
+ pht(
+ "Repository working copy at '%s' failed sanity check; ".
+ "destroying and re-cloning. %s",
+ $path,
+ $message));
Filesystem::remove($path);
$this->executeGitCreate();
} else if ($err) {
@@ -324,9 +335,11 @@
}
} else if ($err) {
throw new Exception(
- "git fetch failed with error #{$err}:\n".
- "stdout:{$stdout}\n\n".
- "stderr:{$stderr}\n");
+ pht(
+ "git fetch failed with error #%d:\nstdout:%s\n\nstderr:%s\n",
+ $err,
+ $stdout,
+ $stderr));
} else {
$retry = false;
}
diff --git a/src/applications/repository/engine/PhabricatorRepositoryRefEngine.php b/src/applications/repository/engine/PhabricatorRepositoryRefEngine.php
--- a/src/applications/repository/engine/PhabricatorRepositoryRefEngine.php
+++ b/src/applications/repository/engine/PhabricatorRepositoryRefEngine.php
@@ -397,7 +397,7 @@
$class = 'PhabricatorRepositoryMercurialCommitMessageParserWorker';
break;
default:
- throw new Exception("Unknown repository type '{$vcs}'!");
+ throw new Exception(pht("Unknown repository type '%s'!", $vcs));
}
$all_commits = queryfx_all(
diff --git a/src/applications/repository/graphcache/PhabricatorRepositoryGraphCache.php b/src/applications/repository/graphcache/PhabricatorRepositoryGraphCache.php
--- a/src/applications/repository/graphcache/PhabricatorRepositoryGraphCache.php
+++ b/src/applications/repository/graphcache/PhabricatorRepositoryGraphCache.php
@@ -106,7 +106,7 @@
// Sanity check so we can survive and recover from bad data.
if (isset($seen[$commit_id])) {
- phlog(pht('Unexpected infinite loop in RepositoryGraphCache!'));
+ phlog(pht('Unexpected infinite loop in %s!', __CLASS__));
return false;
} else {
$seen[$commit_id] = true;
diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementCacheWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementCacheWorkflow.php
--- a/src/applications/repository/management/PhabricatorRepositoryManagementCacheWorkflow.php
+++ b/src/applications/repository/management/PhabricatorRepositoryManagementCacheWorkflow.php
@@ -29,14 +29,18 @@
$commit_name = $args->getArg('commit');
if ($commit_name === null) {
throw new PhutilArgumentUsageException(
- pht('Specify a commit to look up with `--commit`.'));
+ pht(
+ 'Specify a commit to look up with `%s`.',
+ '--commit'));
}
$commit = $this->loadNamedCommit($commit_name);
$path_name = $args->getArg('path');
if ($path_name === null) {
throw new PhutilArgumentUsageException(
- pht('Specify a path to look up with `--path`.'));
+ pht(
+ 'Specify a path to look up with `%s`.',
+ '--path'));
}
$path_map = id(new DiffusionPathIDQuery(array($path_name)))
@@ -62,9 +66,7 @@
pht('Query took %s ms.', new PhutilNumber(1000 * ($t_end - $t_start))));
if ($cache_result === false) {
- $console->writeOut(
- "%s\n",
- pht('Not found in graph cache.'));
+ $console->writeOut("%s\n", pht('Not found in graph cache.'));
} else if ($cache_result === null) {
$console->writeOut(
"%s\n",
diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementDiscoverWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementDiscoverWorkflow.php
--- a/src/applications/repository/management/PhabricatorRepositoryManagementDiscoverWorkflow.php
+++ b/src/applications/repository/management/PhabricatorRepositoryManagementDiscoverWorkflow.php
@@ -7,17 +7,17 @@
$this
->setName('discover')
->setExamples('**discover** [__options__] __repository__ ...')
- ->setSynopsis('Discover __repository__, named by callsign.')
+ ->setSynopsis(pht('Discover __repository__, named by callsign.'))
->setArguments(
array(
array(
'name' => 'verbose',
- 'help' => 'Show additional debugging information.',
+ 'help' => pht('Show additional debugging information.'),
),
array(
'name' => 'repair',
- 'help' => 'Repair a repository with gaps in commit '.
- 'history.',
+ 'help' => pht(
+ 'Repair a repository with gaps in commit history.'),
),
array(
'name' => 'repos',
@@ -31,12 +31,14 @@
if (!$repos) {
throw new PhutilArgumentUsageException(
- 'Specify one or more repositories to discover, by callsign.');
+ pht('Specify one or more repositories to discover, by callsign.'));
}
$console = PhutilConsole::getConsole();
foreach ($repos as $repo) {
- $console->writeOut("Discovering '%s'...\n", $repo->getCallsign());
+ $console->writeOut(
+ "%s\n",
+ pht("Discovering '%s'...", $repo->getCallsign()));
id(new PhabricatorRepositoryDiscoveryEngine())
->setRepository($repo)
@@ -45,7 +47,7 @@
->discoverCommits();
}
- $console->writeOut("Done.\n");
+ $console->writeOut("%s\n", pht('Done.'));
return 0;
}
diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php
--- a/src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php
+++ b/src/applications/repository/management/PhabricatorRepositoryManagementEditWorkflow.php
@@ -7,7 +7,7 @@
$this
->setName('edit')
->setExamples('**edit** --as __username__ __repository__ ...')
- ->setSynopsis('Edit __repository__, named by callsign.')
+ ->setSynopsis(pht('Edit __repository__, named by callsign.'))
->setArguments(
array(
array(
@@ -17,12 +17,12 @@
array(
'name' => 'as',
'param' => 'user',
- 'help' => 'Edit as user.',
+ 'help' => pht('Edit as user.'),
),
array(
'name' => 'local-path',
'param' => 'path',
- 'help' => 'Edit the local path.',
+ 'help' => pht('Edit the local path.'),
),
));
}
@@ -32,7 +32,7 @@
if (!$repos) {
throw new PhutilArgumentUsageException(
- 'Specify one or more repositories to edit, by callsign.');
+ pht('Specify one or more repositories to edit, by callsign.'));
}
$console = PhutilConsole::getConsole();
@@ -47,7 +47,9 @@
$username = $args->getArg('as');
if (!$username) {
throw new PhutilArgumentUsageException(
- pht('Specify a user to edit as with --as <username>.'));
+ pht(
+ 'Specify a user to edit as with %s.',
+ '--as <username>'));
}
$actor = id(new PhabricatorPeopleQuery())
@@ -61,7 +63,7 @@
}
foreach ($repos as $repo) {
- $console->writeOut("Editing '%s'...\n", $repo->getCallsign());
+ $console->writeOut("%s\n", pht("Editing '%s'...", $repo->getCallsign()));
$xactions = array();
@@ -88,7 +90,7 @@
->applyTransactions($repo, $xactions);
}
- $console->writeOut("Done.\n");
+ $console->writeOut("%s\n", pht('Done.'));
return 0;
}
diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php
--- a/src/applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php
+++ b/src/applications/repository/management/PhabricatorRepositoryManagementImportingWorkflow.php
@@ -8,13 +8,14 @@
->setName('importing')
->setExamples('**importing** __repository__ ...')
->setSynopsis(
- 'Show commits in __repository__, named by callsign, which are still '.
- 'importing.')
+ pht(
+ 'Show commits in __repository__, named by callsign, which are '.
+ 'still importing.'))
->setArguments(
array(
array(
'name' => 'simple',
- 'help' => 'Show simpler output.',
+ 'help' => pht('Show simpler output.'),
),
array(
'name' => 'repos',
@@ -28,8 +29,9 @@
if (!$repos) {
throw new PhutilArgumentUsageException(
- 'Specify one or more repositories to find importing commits for, '.
- 'by callsign.');
+ pht(
+ 'Specify one or more repositories to find importing commits for, '.
+ 'by callsign.'));
}
$repos = mpull($repos, null, 'getID');
diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementListWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementListWorkflow.php
--- a/src/applications/repository/management/PhabricatorRepositoryManagementListWorkflow.php
+++ b/src/applications/repository/management/PhabricatorRepositoryManagementListWorkflow.php
@@ -6,7 +6,7 @@
protected function didConstruct() {
$this
->setName('list')
- ->setSynopsis('Show a list of repositories.')
+ ->setSynopsis(pht('Show a list of repositories.'))
->setArguments(array());
}
@@ -21,7 +21,7 @@
$console->writeOut("%s\n", $repo->getCallsign());
}
} else {
- $console->writeErr("%s\n", 'There are no repositories.');
+ $console->writeErr("%s\n", pht('There are no repositories.'));
}
return 0;
diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementMarkImportedWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementMarkImportedWorkflow.php
--- a/src/applications/repository/management/PhabricatorRepositoryManagementMarkImportedWorkflow.php
+++ b/src/applications/repository/management/PhabricatorRepositoryManagementMarkImportedWorkflow.php
@@ -7,12 +7,12 @@
$this
->setName('mark-imported')
->setExamples('**mark-imported** __repository__ ...')
- ->setSynopsis('Mark __repository__, named by callsign, as imported.')
+ ->setSynopsis(pht('Mark __repository__, named by callsign, as imported.'))
->setArguments(
array(
array(
'name' => 'mark-not-imported',
- 'help' => 'Instead, mark repositories as NOT imported.',
+ 'help' => pht('Instead, mark repositories as NOT imported.'),
),
array(
'name' => 'repos',
@@ -26,7 +26,7 @@
if (!$repos) {
throw new PhutilArgumentUsageException(
- 'Specify one or more repositories to mark imported, by callsign.');
+ pht('Specify one or more repositories to mark imported, by callsign.'));
}
$new_importing_value = (bool)$args->getArg('mark-not-imported');
@@ -59,7 +59,7 @@
}
}
- $console->writeOut("Done.\n");
+ $console->writeOut("%s\n", pht('Done.'));
return 0;
}
diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementMirrorWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementMirrorWorkflow.php
--- a/src/applications/repository/management/PhabricatorRepositoryManagementMirrorWorkflow.php
+++ b/src/applications/repository/management/PhabricatorRepositoryManagementMirrorWorkflow.php
@@ -28,8 +28,7 @@
if (!$repos) {
throw new PhutilArgumentUsageException(
pht(
- 'Specify one or more repositories to push to mirrors, by '.
- 'callsign.'));
+ 'Specify one or more repositories to push to mirrors, by callsign.'));
}
$console = PhutilConsole::getConsole();
@@ -44,7 +43,7 @@
->pushToMirrors();
}
- $console->writeOut("Done.\n");
+ $console->writeOut('%s\b', pht('Done.'));
return 0;
}
diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementPullWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementPullWorkflow.php
--- a/src/applications/repository/management/PhabricatorRepositoryManagementPullWorkflow.php
+++ b/src/applications/repository/management/PhabricatorRepositoryManagementPullWorkflow.php
@@ -7,16 +7,16 @@
$this
->setName('pull')
->setExamples('**pull** __repository__ ...')
- ->setSynopsis('Pull __repository__, named by callsign.')
+ ->setSynopsis(pht('Pull __repository__, named by callsign.'))
->setArguments(
array(
array(
- 'name' => 'verbose',
- 'help' => 'Show additional debugging information.',
+ 'name' => 'verbose',
+ 'help' => pht('Show additional debugging information.'),
),
array(
- 'name' => 'repos',
- 'wildcard' => true,
+ 'name' => 'repos',
+ 'wildcard' => true,
),
));
}
@@ -26,12 +26,12 @@
if (!$repos) {
throw new PhutilArgumentUsageException(
- 'Specify one or more repositories to pull, by callsign.');
+ pht('Specify one or more repositories to pull, by callsign.'));
}
$console = PhutilConsole::getConsole();
foreach ($repos as $repo) {
- $console->writeOut("Pulling '%s'...\n", $repo->getCallsign());
+ $console->writeOut("%s\n", pht("Pulling '%s'...", $repo->getCallsign()));
id(new PhabricatorRepositoryPullEngine())
->setRepository($repo)
@@ -39,7 +39,7 @@
->pullRepository();
}
- $console->writeOut("Done.\n");
+ $console->writeOut("%s\n", pht('Done.'));
return 0;
}
diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementUpdateWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementUpdateWorkflow.php
--- a/src/applications/repository/management/PhabricatorRepositoryManagementUpdateWorkflow.php
+++ b/src/applications/repository/management/PhabricatorRepositoryManagementUpdateWorkflow.php
@@ -27,11 +27,11 @@
array(
array(
'name' => 'verbose',
- 'help' => 'Show additional debugging information.',
+ 'help' => pht('Show additional debugging information.'),
),
array(
'name' => 'no-discovery',
- 'help' => 'Do not perform discovery.',
+ 'help' => pht('Do not perform discovery.'),
),
array(
'name' => 'repos',
diff --git a/src/applications/repository/management/PhabricatorRepositoryManagementWorkflow.php b/src/applications/repository/management/PhabricatorRepositoryManagementWorkflow.php
--- a/src/applications/repository/management/PhabricatorRepositoryManagementWorkflow.php
+++ b/src/applications/repository/management/PhabricatorRepositoryManagementWorkflow.php
@@ -19,7 +19,7 @@
foreach ($callsigns as $callsign) {
if (empty($repos[$callsign])) {
throw new PhutilArgumentUsageException(
- "No repository with callsign '{$callsign}' exists!");
+ pht("No repository with callsign '%s' exists!", $callsign));
}
}
diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php
--- a/src/applications/repository/storage/PhabricatorRepository.php
+++ b/src/applications/repository/storage/PhabricatorRepository.php
@@ -416,7 +416,7 @@
$env['HGPLAIN'] = 1;
break;
default:
- throw new Exception('Unrecognized version control system.');
+ throw new Exception(pht('Unrecognized version control system.'));
}
return $env;
@@ -447,7 +447,7 @@
// command-line flag instead of an environmental variable.
break;
default:
- throw new Exception('Unrecognized version control system.');
+ throw new Exception(pht('Unrecognized version control system.'));
}
}
@@ -501,7 +501,7 @@
}
break;
default:
- throw new Exception('Unrecognized version control system.');
+ throw new Exception(pht('Unrecognized version control system.'));
}
array_unshift($args, $pattern);
@@ -524,7 +524,7 @@
$pattern = "hg {$pattern}";
break;
default:
- throw new Exception('Unrecognized version control system.');
+ throw new Exception(pht('Unrecognized version control system.'));
}
array_unshift($args, $pattern);
@@ -799,7 +799,7 @@
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
break;
default:
- throw new Exception('Unrecognized version control system.');
+ throw new Exception(pht('Unrecognized version control system.'));
}
$closeable_flag = PhabricatorRepositoryCommit::IMPORTED_CLOSEABLE;
@@ -955,7 +955,7 @@
return $uri;
}
- throw new Exception("Remote URI '{$raw_uri}' could not be parsed!");
+ throw new Exception(pht("Remote URI '%s' could not be parsed!", $raw_uri));
}
@@ -1457,8 +1457,7 @@
public static function assertValidRemoteURI($uri) {
if (trim($uri) != $uri) {
throw new Exception(
- pht(
- 'The remote URI has leading or trailing whitespace.'));
+ pht('The remote URI has leading or trailing whitespace.'));
}
$protocol = self::getRemoteURIProtocol($uri);
@@ -1472,8 +1471,10 @@
pht(
"The remote URI is not formatted correctly. Remote URIs ".
"with an explicit protocol should be in the form ".
- "'proto://domain/path', not 'proto://domain:/path'. ".
- "The ':/path' syntax is only valid in SCP-style URIs."));
+ "'%s', not '%s'. The '%s' syntax is only valid in SCP-style URIs.",
+ 'proto://domain/path',
+ 'proto://domain:/path',
+ ':/path'));
}
}
@@ -1493,8 +1494,14 @@
throw new Exception(
pht(
"The URI protocol is unrecognized. It should begin ".
- "'ssh://', 'http://', 'https://', 'git://', 'svn://', ".
- "'svn+ssh://', or be in the form 'git@domain.com:path'."));
+ "'%s', '%s', '%s', '%s', '%s', '%s', or be in the form '%s'.",
+ 'ssh://',
+ 'http://',
+ 'https://',
+ 'git://',
+ 'svn://',
+ 'svn+ssh://',
+ 'git@domain.com:path'));
}
return true;
@@ -1595,7 +1602,7 @@
if (!$service) {
throw new Exception(
pht(
- 'The Alamnac service for this repository is invalid or could not '.
+ 'The Almanac service for this repository is invalid or could not '.
'be loaded.'));
}
@@ -1603,7 +1610,7 @@
if (!($service_type instanceof AlmanacClusterRepositoryServiceType)) {
throw new Exception(
pht(
- 'The Alamnac service for this repository does not have the correct '.
+ 'The Almanac service for this repository does not have the correct '.
'service type.'));
}
@@ -1611,7 +1618,7 @@
if (!$bindings) {
throw new Exception(
pht(
- 'The Alamanc service for this repository is not bound to any '.
+ 'The Almaanc service for this repository is not bound to any '.
'interfaces.'));
}
@@ -1742,8 +1749,8 @@
pht(
'Unable to read device public key while attempting to make '.
'authenticated method call within the Phabricator cluster. '.
- 'Use `bin/almanac register` to register keys for this device. '.
- 'Exception: %s',
+ 'Use `%s` to register keys for this device. Exception: %s',
+ 'bin/almanac register',
$ex->getMessage()),
array($ex));
}
@@ -1757,8 +1764,8 @@
pht(
'Unable to read device private key while attempting to make '.
'authenticated method call within the Phabricator cluster. '.
- 'Use `bin/almanac register` to register keys for this device. '.
- 'Exception: %s',
+ 'Use `%s` to register keys for this device. Exception: %s',
+ 'bin/almanac register',
$ex->getMessage()),
array($ex));
}
diff --git a/src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryCommitChangeParserWorker.php b/src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryCommitChangeParserWorker.php
--- a/src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryCommitChangeParserWorker.php
+++ b/src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryCommitChangeParserWorker.php
@@ -21,9 +21,9 @@
$callsign = $repository->getCallsign();
$full_name = 'r'.$callsign.$identifier;
- $this->log("Parsing %s...\n", $full_name);
+ $this->log("%s\n", pht('Parsing %s...', $full_name));
if ($this->isBadCommit($full_name)) {
- $this->log('This commit is marked bad!');
+ $this->log(pht('This commit is marked bad!'));
return;
}
diff --git a/src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryGitCommitChangeParserWorker.php b/src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryGitCommitChangeParserWorker.php
--- a/src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryGitCommitChangeParserWorker.php
+++ b/src/applications/repository/worker/commitchangeparser/PhabricatorRepositoryGitCommitChangeParserWorker.php
@@ -127,7 +127,7 @@
// NOTE: "U" (unmerged) and "X" (unknown) statuses are also possible
// in theory but shouldn't appear here.
default:
- throw new Exception("Failed to parse line '{$line}'.");
+ throw new Exception(pht("Failed to parse line '%s'.", $line));
}
$changes[$change_path] = array(
diff --git a/src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php b/src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php
--- a/src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php
+++ b/src/applications/repository/worker/commitchangeparser/PhabricatorRepositorySvnCommitChangeParserWorker.php
@@ -201,7 +201,7 @@
if ($source_file_type == DifferentialChangeType::FILE_DELETED) {
throw new Exception(
- 'Something is wrong; source of a copy must exist.');
+ pht('Something is wrong; source of a copy must exist.'));
}
if ($source_file_type != DifferentialChangeType::FILE_DIRECTORY) {
@@ -504,10 +504,11 @@
if ($need) {
$subpath = $repository->getDetail('svn-subpath');
if (!$subpath) {
- $commits = implode(', ', $need);
throw new Exception(
- "Missing commits ({$need}) in a SVN repository which is not ".
- "configured for subdirectory-only parsing!");
+ pht(
+ 'Missing commits (%s) in a SVN repository which is not '.
+ 'configured for subdirectory-only parsing!',
+ implode(', ', $need)));
}
foreach ($need as $foreign_commit) {
@@ -631,7 +632,7 @@
case 'dir': return DifferentialChangeType::FILE_DIRECTORY;
case 'file': return DifferentialChangeType::FILE_NORMAL;
default:
- throw new Exception("Unknown SVN file kind '{$kind}'.");
+ throw new Exception(pht("Unknown SVN file kind '%s'.", $kind));
}
}
@@ -687,7 +688,7 @@
'(<size>(.*?)</size>)?@';
$matches = null;
if (!preg_match($pattern, $entry, $matches)) {
- throw new Exception('Unable to parse entry!');
+ throw new Exception(pht('Unable to parse entry!'));
}
$map[html_entity_decode($matches[2])] =
$this->getFileTypeFromSVNKind($matches[1]);
@@ -704,40 +705,61 @@
$mode = 'entry';
$entry = array();
} else {
- throw new Exception("Expected </list> or <entry, got {$line}.");
+ throw new Exception(
+ pht(
+ 'Expected %s or %s, got %s.',
+ '</list>',
+ '<entry',
+ $line));
}
break;
case 'xml':
$expect = '/<?xml version="1.0".*?>/';
if (!preg_match($expect, $line)) {
- throw new Exception("Expected '{$expect}', got {$line}.");
+ throw new Exception(
+ pht(
+ "Expected '%s', got %s.",
+ $expect,
+ $line));
}
$mode = 'list';
break;
case 'list':
$expect = '<lists>';
if ($line !== $expect) {
- throw new Exception("Expected '{$expect}', got {$line}.");
+ throw new Exception(
+ pht(
+ "Expected '%s', got %s.",
+ $expect,
+ $line));
}
$mode = 'list1';
break;
case 'list1':
$expect = '<list';
if ($line !== $expect) {
- throw new Exception("Expected '{$expect}', got {$line}.");
+ throw new Exception(
+ pht(
+ "Expected '%s', got %s.",
+ $expect,
+ $line));
}
$mode = 'list2';
break;
case 'list2':
if (!preg_match('/^\s+path="/', $line)) {
- throw new Exception("Expected ' path=...', got {$line}.");
+ throw new Exception(
+ pht(
+ "Expected '%s', got %s.",
+ ' path=...',
+ $line));
}
$mode = 'entry-or-end';
break;
}
}
if (!$done) {
- throw new Exception('Unexpected end of file.');
+ throw new Exception(pht('Unexpected end of file.'));
}
return $map;
diff --git a/src/applications/search/controller/PhabricatorSearchAttachController.php b/src/applications/search/controller/PhabricatorSearchAttachController.php
--- a/src/applications/search/controller/PhabricatorSearchAttachController.php
+++ b/src/applications/search/controller/PhabricatorSearchAttachController.php
@@ -211,43 +211,43 @@
private function getStrings() {
switch ($this->type) {
case DifferentialRevisionPHIDType::TYPECONST:
- $noun = 'Revisions';
- $selected = 'created';
+ $noun = pht('Revisions');
+ $selected = pht('created');
break;
case ManiphestTaskPHIDType::TYPECONST:
- $noun = 'Tasks';
- $selected = 'assigned';
+ $noun = pht('Tasks');
+ $selected = pht('assigned');
break;
case PhabricatorRepositoryCommitPHIDType::TYPECONST:
- $noun = 'Commits';
- $selected = 'created';
+ $noun = pht('Commits');
+ $selected = pht('created');
break;
case PholioMockPHIDType::TYPECONST:
- $noun = 'Mocks';
- $selected = 'created';
+ $noun = pht('Mocks');
+ $selected = pht('created');
break;
}
switch ($this->action) {
case self::ACTION_EDGE:
case self::ACTION_ATTACH:
- $dialog_title = "Manage Attached {$noun}";
- $header_text = "Currently Attached {$noun}";
- $button_text = "Save {$noun}";
+ $dialog_title = pht('Manage Attached %s', $noun);
+ $header_text = pht('Currently Attached %s', $noun);
+ $button_text = pht('Save %s', $noun);
$instructions = null;
break;
case self::ACTION_MERGE:
- $dialog_title = 'Merge Duplicate Tasks';
- $header_text = 'Tasks To Merge';
- $button_text = "Merge {$noun}";
- $instructions =
+ $dialog_title = pht('Merge Duplicate Tasks');
+ $header_text = pht('Tasks To Merge');
+ $button_text = pht('Merge %s', $noun);
+ $instructions = pht(
'These tasks will be merged into the current task and then closed. '.
- 'The current task will grow stronger.';
+ 'The current task will grow stronger.');
break;
case self::ACTION_DEPENDENCIES:
- $dialog_title = 'Edit Dependencies';
- $header_text = 'Current Dependencies';
- $button_text = 'Save Dependencies';
+ $dialog_title = pht('Edit Dependencies');
+ $header_text = pht('Current Dependencies');
+ $button_text = pht('Save Dependencies');
$instructions = null;
break;
case self::ACTION_BLOCKS:
@@ -271,15 +271,15 @@
private function getFilters(array $strings) {
if ($this->type == PholioMockPHIDType::TYPECONST) {
$filters = array(
- 'created' => 'Created By Me',
- 'all' => 'All '.$strings['target_plural_noun'],
+ 'created' => pht('Created By Me'),
+ 'all' => pht('All %s', $strings['target_plural_noun']),
);
} else {
$filters = array(
- 'assigned' => 'Assigned to Me',
- 'created' => 'Created By Me',
- 'open' => 'All Open '.$strings['target_plural_noun'],
- 'all' => 'All '.$strings['target_plural_noun'],
+ 'assigned' => pht('Assigned to Me'),
+ 'created' => pht('Created By Me'),
+ 'open' => pht('All Open %s', $strings['target_plural_noun']),
+ 'all' => pht('All %s', $strings['target_plural_noun']),
);
}
@@ -326,10 +326,11 @@
foreach ($cycle as $cycle_phid) {
$names[] = $handles[$cycle_phid]->getFullName();
}
- $names = implode(" \xE2\x86\x92 ", $names);
throw new Exception(
- "You can not create that dependency, because it would create a ".
- "circular dependency: {$names}.");
+ pht(
+ 'You can not create that dependency, because it would create a '.
+ 'circular dependency: %s.',
+ implode(" \xE2\x86\x92 ", $names)));
}
}
diff --git a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php
--- a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php
+++ b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php
@@ -33,7 +33,10 @@
protected function requireViewer() {
if (!$this->viewer) {
- throw new Exception('Call setViewer() before using an engine!');
+ throw new Exception(
+ pht(
+ 'Call %s before using an engine!',
+ 'setViewer()'));
}
return $this->viewer;
}
@@ -328,7 +331,7 @@
*/
public function getBuiltinQuery($query_key) {
if (!$this->isBuiltinQuery($query_key)) {
- throw new Exception("'{$query_key}' is not a builtin!");
+ throw new Exception(pht("'%s' is not a builtin!", $query_key));
}
return idx($this->getBuiltinQueries(), $query_key);
}
@@ -355,7 +358,7 @@
* @task builtin
*/
public function buildSavedQueryFromBuiltin($query_key) {
- throw new Exception("Builtin '{$query_key}' is not supported!");
+ throw new Exception(pht("Builtin '%s' is not supported!", $query_key));
}
diff --git a/src/applications/search/engine/PhabricatorElasticSearchEngine.php b/src/applications/search/engine/PhabricatorElasticSearchEngine.php
--- a/src/applications/search/engine/PhabricatorElasticSearchEngine.php
+++ b/src/applications/search/engine/PhabricatorElasticSearchEngine.php
@@ -99,7 +99,7 @@
$spec[] = array(
'simple_query_string' => array(
'query' => $query->getParameter('query'),
- 'fields' => array( 'field.corpus' ),
+ 'fields' => array('field.corpus'),
),
);
diff --git a/src/applications/search/engine/PhabricatorJumpNavHandler.php b/src/applications/search/engine/PhabricatorJumpNavHandler.php
--- a/src/applications/search/engine/PhabricatorJumpNavHandler.php
+++ b/src/applications/search/engine/PhabricatorJumpNavHandler.php
@@ -69,7 +69,7 @@
->setURI('/maniphest/task/create/?title='
.phutil_escape_uri($matches[1]));
default:
- throw new Exception("Unknown jump effect '{$effect}'!");
+ throw new Exception(pht("Unknown jump effect '%s'!", $effect));
}
}
}
diff --git a/src/applications/search/index/PhabricatorSearchDocumentIndexer.php b/src/applications/search/index/PhabricatorSearchDocumentIndexer.php
--- a/src/applications/search/index/PhabricatorSearchDocumentIndexer.php
+++ b/src/applications/search/index/PhabricatorSearchDocumentIndexer.php
@@ -36,7 +36,7 @@
->withPHIDs(array($phid))
->executeOne();
if (!$object) {
- throw new Exception("Unable to load object by phid '{$phid}'!");
+ throw new Exception(pht("Unable to load object by PHID '%s'!", $phid));
}
return $object;
}
@@ -73,17 +73,21 @@
try {
$engine->reindexAbstractDocument($document);
} catch (Exception $ex) {
- $phid = $document->getPHID();
- $class = get_class($engine);
-
- phlog("Unable to index document {$phid} with engine {$class}.");
+ phlog(
+ pht(
+ 'Unable to index document %s with engine %s.',
+ $document->getPHID(),
+ get_class($engine)));
phlog($ex);
}
$this->dispatchDidUpdateIndexEvent($phid, $document);
} catch (Exception $ex) {
- $class = get_class($this);
- phlog("Unable to build document {$phid} with indexer {$class}.");
+ phlog(
+ pht(
+ 'Unable to build document %s with indexer %s.',
+ $phid,
+ get_class($this)));
phlog($ex);
}
diff --git a/src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php b/src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php
--- a/src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php
+++ b/src/applications/search/management/PhabricatorSearchManagementIndexWorkflow.php
@@ -6,7 +6,7 @@
protected function didConstruct() {
$this
->setName('index')
- ->setSynopsis('Build or rebuild search indexes.')
+ ->setSynopsis(pht('Build or rebuild search indexes.'))
->setExamples(
"**index** D123\n".
"**index** --type DREV\n".
@@ -15,18 +15,19 @@
array(
array(
'name' => 'all',
- 'help' => 'Reindex all documents.',
+ 'help' => pht('Reindex all documents.'),
),
array(
'name' => 'type',
'param' => 'TYPE',
- 'help' => 'PHID type to reindex, like "TASK" or "DREV".',
+ 'help' => pht('PHID type to reindex, like "TASK" or "DREV".'),
),
array(
'name' => 'background',
- 'help' => 'Instead of indexing in this process, queue tasks for '.
- 'the daemons. This can improve performance, but makes '.
- 'it more difficult to debug search indexing.',
+ 'help' => pht(
+ 'Instead of indexing in this process, queue tasks for '.
+ 'the daemons. This can improve performance, but makes '.
+ 'it more difficult to debug search indexing.'),
),
array(
'name' => 'objects',
@@ -45,11 +46,16 @@
if ($obj_names && ($is_all || $is_type)) {
throw new PhutilArgumentUsageException(
- "You can not name objects to index alongside the '--all' or '--type' ".
- "flags.");
+ pht(
+ "You can not name objects to index alongside the '%s' or '%s' flags.",
+ '--all',
+ '--type'));
} else if (!$obj_names && !($is_all || $is_type)) {
throw new PhutilArgumentUsageException(
- "Provide one of '--all', '--type' or a list of object names.");
+ pht(
+ "Provide one of '%s', '%s' or a list of object names.",
+ '--all',
+ '--type'));
}
if ($obj_names) {
@@ -59,7 +65,7 @@
}
if (!$phids) {
- throw new PhutilArgumentUsageException('Nothing to index!');
+ throw new PhutilArgumentUsageException(pht('Nothing to index!'));
}
if ($args->getArg('background')) {
@@ -73,8 +79,8 @@
$console->writeOut(
"%s\n",
pht(
- 'Run this workflow with "--background" to queue tasks for the '.
- 'daemon workers.'));
+ 'Run this workflow with "%s" to queue tasks for the daemon workers.',
+ '--background'));
}
$groups = phid_group_by_type($phids);
@@ -106,7 +112,9 @@
foreach ($names as $name) {
if (empty($objects[$name])) {
throw new PhutilArgumentUsageException(
- "'{$name}' is not the name of a known object.");
+ pht(
+ "'%s' is not the name of a known object.",
+ $name));
}
}
diff --git a/src/applications/search/management/PhabricatorSearchManagementInitWorkflow.php b/src/applications/search/management/PhabricatorSearchManagementInitWorkflow.php
--- a/src/applications/search/management/PhabricatorSearchManagementInitWorkflow.php
+++ b/src/applications/search/management/PhabricatorSearchManagementInitWorkflow.php
@@ -6,7 +6,7 @@
protected function didConstruct() {
$this
->setName('init')
- ->setSynopsis('Initialize or repair an index.')
+ ->setSynopsis(pht('Initialize or repair an index.'))
->setExamples('**init**');
}
@@ -28,7 +28,7 @@
} else if (!$engine->indexIsSane()) {
$console->writeOut(
'%s',
- pht('Index exists but is incorrect, fixing...'));
+ pht('Index exists but is incorrect, fixing...'));
$engine->initIndex();
$console->writeOut(
"%s\n",
@@ -39,8 +39,9 @@
if ($work_done) {
$console->writeOut(
"%s\n",
- pht('Index maintenance complete. Run `./bin/search index` to '.
- 'reindex documents'));
+ pht(
+ 'Index maintenance complete. Run `%s` to reindex documents',
+ './bin/search index'));
} else {
$console->writeOut(
"%s\n",
diff --git a/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php b/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php
--- a/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php
+++ b/src/applications/search/query/PhabricatorSearchApplicationSearchEngine.php
@@ -137,7 +137,7 @@
)))
->appendChild(
id(new AphrontFormTextControl())
- ->setLabel('Query')
+ ->setLabel(pht('Query'))
->setName('query')
->setValue($saved->getParameter('query')))
->appendChild($status_control)
@@ -145,25 +145,25 @@
->appendControl(
id(new AphrontFormTokenizerControl())
->setName('authorPHIDs')
- ->setLabel('Authors')
+ ->setLabel(pht('Authors'))
->setDatasource(new PhabricatorPeopleUserFunctionDatasource())
->setValue($author_phids))
->appendControl(
id(new AphrontFormTokenizerControl())
->setName('ownerPHIDs')
- ->setLabel('Owners')
+ ->setLabel(pht('Owners'))
->setDatasource(new PhabricatorPeopleOwnerDatasource())
->setValue($owner_phids))
->appendControl(
id(new AphrontFormTokenizerControl())
->setName('subscriberPHIDs')
- ->setLabel('Subscribers')
+ ->setLabel(pht('Subscribers'))
->setDatasource(new PhabricatorMetaMTAMailableFunctionDatasource())
->setValue($subscriber_phids))
->appendControl(
id(new AphrontFormTokenizerControl())
->setName('projectPHIDs')
- ->setLabel('In Any Project')
+ ->setLabel(pht('In Any Project'))
->setDatasource(new PhabricatorProjectDatasource())
->setValue($project_phids));
}
diff --git a/src/applications/search/query/PhabricatorSearchDocumentQuery.php b/src/applications/search/query/PhabricatorSearchDocumentQuery.php
--- a/src/applications/search/query/PhabricatorSearchDocumentQuery.php
+++ b/src/applications/search/query/PhabricatorSearchDocumentQuery.php
@@ -72,8 +72,7 @@
protected function getResultCursor($result) {
throw new Exception(
pht(
- 'This query does not support cursor paging; it must be offset '.
- 'paged.'));
+ 'This query does not support cursor paging; it must be offset paged.'));
}
protected function nextPage(array $page) {
diff --git a/src/applications/settings/panel/PhabricatorConduitCertificateSettingsPanel.php b/src/applications/settings/panel/PhabricatorConduitCertificateSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorConduitCertificateSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorConduitCertificateSettingsPanel.php
@@ -67,7 +67,8 @@
$notice->appendChild(phutil_tag(
'p',
array(),
- pht('Your old certificate has been destroyed and you have been issued '.
+ pht(
+ 'Your old certificate has been destroyed and you have been issued '.
'a new certificate. Sessions established under the old certificate '.
'are no longer valid.')));
$notice = $notice->render();
@@ -83,7 +84,8 @@
->appendChild(phutil_tag(
'p',
array('class' => 'aphront-form-instructions'),
- pht('This certificate allows you to authenticate over Conduit, '.
+ pht(
+ 'This certificate allows you to authenticate over Conduit, '.
'the Phabricator API. Normally, you just run %s to install it.',
phutil_tag('tt', array(), 'arc install-certificate'))))
->appendChild(
@@ -98,7 +100,8 @@
->setHeaderText(pht('Arcanist Certificate'))
->setForm($cert_form);
- $regen_instruction = pht('You can regenerate this certificate, which '.
+ $regen_instruction = pht(
+ 'You can regenerate this certificate, which '.
'will invalidate the old certificate and create a new one.');
$regen_form = new AphrontFormView();
diff --git a/src/applications/settings/panel/PhabricatorConpherencePreferencesSettingsPanel.php b/src/applications/settings/panel/PhabricatorConpherencePreferencesSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorConpherencePreferencesSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorConpherencePreferencesSettingsPanel.php
@@ -49,9 +49,10 @@
=> pht('Notifications Only'),
))
->setCaption(
- pht('Should Conpherence send emails for updates or '.
- 'notifications only? This global setting can be overridden '.
- 'on a per-thread basis within Conpherence.')))
+ pht(
+ 'Should Conpherence send emails for updates or '.
+ 'notifications only? This global setting can be overridden '.
+ 'on a per-thread basis within Conpherence.')))
->appendChild(
id(new AphrontFormSubmitControl())
->setValue(pht('Save Preferences')));
diff --git a/src/applications/settings/panel/PhabricatorDeveloperPreferencesSettingsPanel.php b/src/applications/settings/panel/PhabricatorDeveloperPreferencesSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorDeveloperPreferencesSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorDeveloperPreferencesSettingsPanel.php
@@ -43,10 +43,10 @@
$is_console_enabled = PhabricatorEnv::getEnvConfig('darkconsole.enabled');
$preamble = pht(
- '**DarkConsole** is a developer console which can help build and '.
- 'debug Phabricator applications. It includes tools for understanding '.
- 'errors, performance, service calls, and other low-level aspects of '.
- 'Phabricator\'s inner workings.');
+ "**DarkConsole** is a developer console which can help build and ".
+ "debug Phabricator applications. It includes tools for understanding ".
+ "errors, performance, service calls, and other low-level aspects of ".
+ "Phabricator's inner workings.");
if ($is_console_enabled) {
$instructions = pht(
@@ -56,15 +56,17 @@
'tools. You may want to disable it again later if you only need it '.
'temporarily.'.
"\n\n".
- 'NOTE: After enabling DarkConsole, **press the ##`## key on your '.
+ 'NOTE: After enabling DarkConsole, **press the ##%s## key on your '.
'keyboard** to show or hide it.',
- $preamble);
+ $preamble,
+ '`');
} else {
$instructions = pht(
"%s\n\n".
'Before you can turn on DarkConsole, it needs to be enabled in '.
- 'the configuration for this install (`darkconsole.enabled`).',
- $preamble);
+ 'the configuration for this install (`%s`).',
+ $preamble,
+ 'darkconsole.enabled');
}
$form = id(new AphrontFormView())
diff --git a/src/applications/settings/panel/PhabricatorDiffPreferencesSettingsPanel.php b/src/applications/settings/panel/PhabricatorDiffPreferencesSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorDiffPreferencesSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorDiffPreferencesSettingsPanel.php
@@ -85,10 +85,11 @@
1 => pht('Enable Filetree'),
))
->setCaption(
- pht('When looking at a revision or commit, enable a sidebar '.
- 'showing affected files. You can press %s to show or hide '.
- 'the sidebar.',
- phutil_tag('tt', array(), 'f'))))
+ pht(
+ 'When looking at a revision or commit, enable a sidebar '.
+ 'showing affected files. You can press %s to show or hide '.
+ 'the sidebar.',
+ phutil_tag('tt', array(), 'f'))))
->appendChild(
id(new AphrontFormSubmitControl())
->setValue(pht('Save Preferences')));
diff --git a/src/applications/settings/panel/PhabricatorDisplayPreferencesSettingsPanel.php b/src/applications/settings/panel/PhabricatorDisplayPreferencesSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorDisplayPreferencesSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorDisplayPreferencesSettingsPanel.php
@@ -95,13 +95,15 @@
$pref_monospaced_textareas_value = 'disabled';
}
- $editor_instructions = pht('Link to edit files in external editor. '.
+ $editor_instructions = pht(
+ 'Link to edit files in external editor. '.
'%%f is replaced by filename, %%l by line number, %%r by repository '.
'callsign, %%%% by literal %%. For documentation, see: %s',
$editor_doc_link);
- $font_instructions = pht('Overrides default fonts in tools like '.
- 'Differential. Input should be valid CSS "font" declaration, such as '.
+ $font_instructions = pht(
+ 'Overrides default fonts in tools like Differential. '.
+ 'Input should be valid CSS "font" declaration, such as '.
'"13px Consolas"');
$form = id(new AphrontFormView())
@@ -114,10 +116,12 @@
->setOptions(
array(
'glyph' =>
- pht("In page titles, show Tool names as unicode glyphs: ".
+ pht(
+ 'In page titles, show Tool names as unicode glyphs: %s',
"\xE2\x9A\x99"),
'text' =>
- pht('In page titles, show Tool names as plain text: '.
+ pht(
+ 'In page titles, show Tool names as plain text: '.
'[Differential]'),
)))
->appendChild(
diff --git a/src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php b/src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php
@@ -289,7 +289,7 @@
->appendParagraph(
pht(
'Are you sure you want to delete this address? You will no '.
- 'longer be able to use it to login.'))
+ 'longer be able to use it to login.'))
->appendParagraph(
pht(
'Note: Removing an email address from your account will invalidate '.
diff --git a/src/applications/settings/panel/PhabricatorEmailPreferencesSettingsPanel.php b/src/applications/settings/panel/PhabricatorEmailPreferencesSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorEmailPreferencesSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorEmailPreferencesSettingsPanel.php
@@ -226,9 +226,9 @@
$select = AphrontFormSelectControl::renderSelectTag(
(int)idx($prefs, $key, $value_email),
array(
- $value_email => pht("\xE2\x9A\xAB Email"),
- $value_notify => pht("\xE2\x97\x90 Notify"),
- $value_ignore => pht("\xE2\x9A\xAA Ignore"),
+ $value_email => "\xE2\x9A\xAB ".pht('Email'),
+ $value_notify => "\xE2\x97\x90 ".pht('Notify'),
+ $value_ignore => "\xE2\x9A\xAA ".pht('Ignore'),
),
array(
'name' => 'mailtags['.$key.']',
diff --git a/src/applications/settings/panel/PhabricatorSSHKeysSettingsPanel.php b/src/applications/settings/panel/PhabricatorSSHKeysSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorSSHKeysSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorSSHKeysSettingsPanel.php
@@ -35,7 +35,7 @@
->setUser($viewer)
->setKeys($keys)
->setCanEdit(true)
- ->setNoDataString("You haven't added any SSH Public Keys.");
+ ->setNoDataString(pht("You haven't added any SSH Public Keys."));
$panel = new PHUIObjectBoxView();
$header = new PHUIHeaderView();
diff --git a/src/applications/settings/panel/PhabricatorSearchPreferencesSettingsPanel.php b/src/applications/settings/panel/PhabricatorSearchPreferencesSettingsPanel.php
--- a/src/applications/settings/panel/PhabricatorSearchPreferencesSettingsPanel.php
+++ b/src/applications/settings/panel/PhabricatorSearchPreferencesSettingsPanel.php
@@ -44,7 +44,7 @@
$preferences->getPreference($pref_jump, 1))
->addCheckbox($pref_shortcut,
1,
- pht("Press '/' to focus the search input."),
+ pht("Press '%s' to focus the search input.", '/'),
$preferences->getPreference($pref_shortcut, 1)))
->appendChild(
id(new AphrontFormSubmitControl())
diff --git a/src/applications/settings/storage/PhabricatorUserPreferences.php b/src/applications/settings/storage/PhabricatorUserPreferences.php
--- a/src/applications/settings/storage/PhabricatorUserPreferences.php
+++ b/src/applications/settings/storage/PhabricatorUserPreferences.php
@@ -19,7 +19,7 @@
const PREFERENCE_SEARCHBAR_JUMP = 'searchbar-jump';
const PREFERENCE_SEARCH_SHORTCUT = 'search-shortcut';
- const PREFERENCE_SEARCH_SCOPE = 'search-scope';
+ const PREFERENCE_SEARCH_SCOPE = 'search-scope';
const PREFERENCE_DIFFUSION_BLAME = 'diffusion-blame';
const PREFERENCE_DIFFUSION_COLOR = 'diffusion-color';
@@ -31,10 +31,10 @@
const PREFERENCE_DIFF_UNIFIED = 'diff-unified';
const PREFERENCE_DIFF_FILETREE = 'diff-filetree';
- const PREFERENCE_DIFF_GHOSTS = 'diff-ghosts';
+ const PREFERENCE_DIFF_GHOSTS = 'diff-ghosts';
const PREFERENCE_CONPH_NOTIFICATIONS = 'conph-notifications';
- const PREFERENCE_CONPHERENCE_COLUMN = 'conpherence-column';
+ const PREFERENCE_CONPHERENCE_COLUMN = 'conpherence-column';
// These are in an unusual order for historic reasons.
const MAILTAG_PREFERENCE_NOTIFY = 0;
diff --git a/src/applications/slowvote/view/SlowvoteEmbedView.php b/src/applications/slowvote/view/SlowvoteEmbedView.php
--- a/src/applications/slowvote/view/SlowvoteEmbedView.php
+++ b/src/applications/slowvote/view/SlowvoteEmbedView.php
@@ -22,7 +22,11 @@
public function render() {
if (!$this->poll) {
- throw new Exception('Call setPoll() before render()!');
+ throw new Exception(
+ pht(
+ 'Call %s before %s)!',
+ 'setPoll()',
+ __FUNCTION__.'()'));
}
$poll = $this->poll;
diff --git a/src/applications/subscriptions/command/PhabricatorSubscriptionsSubscribeEmailCommand.php b/src/applications/subscriptions/command/PhabricatorSubscriptionsSubscribeEmailCommand.php
--- a/src/applications/subscriptions/command/PhabricatorSubscriptionsSubscribeEmailCommand.php
+++ b/src/applications/subscriptions/command/PhabricatorSubscriptionsSubscribeEmailCommand.php
@@ -17,17 +17,18 @@
public function getCommandDescription() {
return pht(
- 'Add one or more subscribers to the object. You can add users '.
- 'by providing their usernames, or add projects by adding their '.
- 'hashtags. For example, use `!subscribe alincoln #ios` to add the '.
- 'user `alincoln` and the project with hashtag `#ios` as subscribers.'.
+ 'Add one or more subscribers to the object. You can add users by '.
+ 'providing their usernames, or add projects by adding their hashtags. '.
+ 'For example, use `%s` to add the user `alincoln` and the project with '.
+ 'hashtag `#ios` as subscribers.'.
"\n\n".
'Subscribers which are invalid or unrecognized will be ignored. This '.
'command has no effect if you do not specify any subscribers.'.
"\n\n".
'Users who are CC\'d on the email itself are also automatically '.
'subscribed if Phabricator knows which accounts are linked to their '.
- 'email addresses.');
+ 'email addresses.',
+ '!subscribe alincoln #ios');
}
public function getCommandAliases() {
diff --git a/src/applications/subscriptions/editor/PhabricatorSubscriptionsEditor.php b/src/applications/subscriptions/editor/PhabricatorSubscriptionsEditor.php
--- a/src/applications/subscriptions/editor/PhabricatorSubscriptionsEditor.php
+++ b/src/applications/subscriptions/editor/PhabricatorSubscriptionsEditor.php
@@ -56,7 +56,11 @@
public function save() {
if (!$this->object) {
- throw new Exception('Call setObject() before save()!');
+ throw new Exception(
+ pht(
+ 'Call %s before %s!',
+ 'setObject()',
+ __FUNCTION__.'()'));
}
$actor = $this->requireActor();
diff --git a/src/applications/system/controller/PhabricatorSystemSelectEncodingController.php b/src/applications/system/controller/PhabricatorSystemSelectEncodingController.php
--- a/src/applications/system/controller/PhabricatorSystemSelectEncodingController.php
+++ b/src/applications/system/controller/PhabricatorSystemSelectEncodingController.php
@@ -15,9 +15,11 @@
->setTitle(pht('No Encoding Support'))
->appendParagraph(
pht(
- 'This system does not have the "mbstring" extension installed, '.
- 'so character encodings are not supported. Install "mbstring" to '.
- 'enable support.'))
+ 'This system does not have the "%s" extension installed, '.
+ 'so character encodings are not supported. Install "%s" to '.
+ 'enable support.',
+ 'mbstring',
+ 'mbstring'))
->addCancelButton('/');
}
diff --git a/src/applications/tokens/phid/PhabricatorTokenTokenPHIDType.php b/src/applications/tokens/phid/PhabricatorTokenTokenPHIDType.php
--- a/src/applications/tokens/phid/PhabricatorTokenTokenPHIDType.php
+++ b/src/applications/tokens/phid/PhabricatorTokenTokenPHIDType.php
@@ -30,7 +30,7 @@
$name = $token->getName();
- $handle->setName("{$name} Token");
+ $handle->setName(pht('%s Token', $name));
}
}
diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php
+++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php
@@ -121,20 +121,25 @@
if (!$xaction->getPHID()) {
throw new Exception(
- 'Transaction must have a PHID before calling applyEdit()!');
+ pht(
+ 'Transaction must have a PHID before calling %s!',
+ 'applyEdit()'));
}
$type_comment = PhabricatorTransactions::TYPE_COMMENT;
if ($xaction->getTransactionType() == $type_comment) {
if ($comment->getPHID()) {
throw new Exception(
- 'Transaction comment must not yet have a PHID!');
+ pht('Transaction comment must not yet have a PHID!'));
}
}
if (!$this->getContentSource()) {
throw new Exception(
- 'Call setContentSource() before applyEdit()!');
+ pht(
+ 'Call %s before %s!',
+ 'setContentSource()',
+ 'applyEdit()'));
}
$actor = $this->requireActor();
diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
+++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
@@ -257,7 +257,8 @@
case PhabricatorTransactions::TYPE_EDGE:
$edge_type = $xaction->getMetadataValue('edge:type');
if (!$edge_type) {
- throw new Exception("Edge transaction has no 'edge:type'!");
+ throw new Exception(
+ pht("Edge transaction has no '%s'!", 'edge:type'));
}
$old_edges = array();
@@ -318,7 +319,7 @@
protected function getCustomTransactionNewValue(
PhabricatorLiskDAO $object,
PhabricatorApplicationTransaction $xaction) {
- throw new Exception('Capability not supported!');
+ throw new Exception(pht('Capability not supported!'));
}
protected function transactionHasEffect(
@@ -509,8 +510,9 @@
PhabricatorApplicationTransaction $xaction) {
$type = $xaction->getTransactionType();
throw new Exception(
- "Transaction type '{$type}' is missing an internal apply ".
- "implementation!");
+ pht(
+ "Transaction type '%s}' is missing an internal apply implementation!",
+ $type));
}
protected function applyCustomExternalTransaction(
@@ -518,8 +520,9 @@
PhabricatorApplicationTransaction $xaction) {
$type = $xaction->getTransactionType();
throw new Exception(
- "Transaction type '{$type}' is missing an external apply ".
- "implementation!");
+ pht(
+ "Transaction type '%s' is missing an external apply implementation!",
+ $type));
}
// TODO: Write proper documentation for these hooks. These are like the
@@ -971,7 +974,10 @@
if (!$this->getContentSource()) {
throw new Exception(
- 'Call setContentSource() before applyTransactions()!');
+ pht(
+ 'Call %s before %s!',
+ 'setContentSource()',
+ 'applyTransactions()'));
}
// Do a bunch of sanity checks that the incoming transactions are fresh.
@@ -986,33 +992,36 @@
throw new PhabricatorApplicationTransactionStructureException(
$xaction,
pht(
- 'You can not apply transactions which already have IDs/PHIDs!'));
+ 'You can not apply transactions which already have %s!',
+ 'IDs/PHIDs'));
}
if ($xaction->getObjectPHID()) {
throw new PhabricatorApplicationTransactionStructureException(
$xaction,
pht(
- 'You can not apply transactions which already have objectPHIDs!'));
+ 'You can not apply transactions which already have %s!',
+ 'objectPHIDs'));
}
if ($xaction->getAuthorPHID()) {
throw new PhabricatorApplicationTransactionStructureException(
$xaction,
pht(
- 'You can not apply transactions which already have authorPHIDs!'));
+ 'You can not apply transactions which already have %s!',
+ 'authorPHIDs'));
}
if ($xaction->getCommentPHID()) {
throw new PhabricatorApplicationTransactionStructureException(
$xaction,
pht(
- 'You can not apply transactions which already have '.
- 'commentPHIDs!'));
+ 'You can not apply transactions which already have %s!',
+ 'commentPHIDs'));
}
if ($xaction->getCommentVersion() !== 0) {
throw new PhabricatorApplicationTransactionStructureException(
$xaction,
pht(
- 'You can not apply transactions which already have '.
- 'commentVersions!'));
+ 'You can not apply transactions which already have %s!',
+ 'commentVersions'));
}
$expect_value = !$xaction->shouldGenerateOldValue();
@@ -1022,16 +1031,17 @@
throw new PhabricatorApplicationTransactionStructureException(
$xaction,
pht(
- 'This transaction is supposed to have an oldValue set, but '.
- 'it does not!'));
+ 'This transaction is supposed to have an %s set, but it does not!',
+ 'oldValue'));
}
if ($has_value && !$expect_value) {
throw new PhabricatorApplicationTransactionStructureException(
$xaction,
pht(
- 'This transaction should generate its oldValue automatically, '.
- 'but has already had one set!'));
+ 'This transaction should generate its %s automatically, '.
+ 'but has already had one set!',
+ 'oldValue'));
}
$type = $xaction->getTransactionType();
@@ -1469,8 +1479,13 @@
if ($new) {
throw new Exception(
- "Invalid 'new' value for PHID transaction. Value should contain only ".
- "keys '+' (add PHIDs), '-' (remove PHIDs) and '=' (set PHIDS).");
+ pht(
+ "Invalid '%s' value for PHID transaction. Value should contain only ".
+ "keys '%s' (add PHIDs), '%s' (remove PHIDs) and '%s' (set PHIDS).",
+ 'new',
+ '+',
+ '-',
+ '='));
}
$result = array();
@@ -1512,8 +1527,13 @@
if ($new) {
throw new Exception(
- "Invalid 'new' value for Edge transaction. Value should contain only ".
- "keys '+' (add edges), '-' (remove edges) and '=' (set edges).");
+ pht(
+ "Invalid '%s' value for Edge transaction. Value should contain only ".
+ "keys '%s' (add edges), '%s' (remove edges) and '%s' (set edges).",
+ 'new',
+ '+',
+ '-',
+ '='));
}
$old = $xaction->getOldValue();
@@ -1564,13 +1584,17 @@
foreach ($list as $key => $item) {
if (phid_get_type($key) === PhabricatorPHIDConstants::PHID_TYPE_UNKNOWN) {
throw new Exception(
- "Edge transactions must have destination PHIDs as in edge ".
- "lists (found key '{$key}').");
+ pht(
+ "Edge transactions must have destination PHIDs as in edge ".
+ "lists (found key '%s').",
+ $key));
}
if (!is_array($item) && $item !== $key) {
throw new Exception(
- "Edge transactions must have PHIDs or edge specs as values ".
- "(found value '{$item}').");
+ pht(
+ "Edge transactions must have PHIDs or edge specs as values ".
+ "(found value '%s').",
+ $item));
}
}
}
@@ -1603,8 +1627,7 @@
default:
throw new Exception(
pht(
- 'Transaction edge specification contains unexpected key '.
- '"%s".',
+ 'Transaction edge specification contains unexpected key "%s".',
$key));
}
}
@@ -1619,9 +1642,12 @@
if ($edge['type'] != $edge_type) {
$this_type = $edge['type'];
throw new Exception(
- "Edge transaction includes edge of type '{$this_type}', but ".
- "transaction is of type '{$edge_type}'. Each edge transaction must ".
- "alter edges of only one type.");
+ pht(
+ "Edge transaction includes edge of type '%s', but ".
+ "transaction is of type '%s'. Each edge transaction must ".
+ "alter edges of only one type.",
+ $this_type,
+ $edge_type));
}
}
@@ -1813,11 +1839,12 @@
$errors[] = new PhabricatorApplicationTransactionValidationError(
$transaction_type,
pht('Invalid'),
- pht('The selected %s policy excludes you. Choose a %s policy '.
- 'which allows you to %s the object.',
- $capability,
- $capability,
- $capability));
+ pht(
+ 'The selected %s policy excludes you. Choose a %s policy '.
+ 'which allows you to %s the object.',
+ $capability,
+ $capability,
+ $capability));
}
}
}
@@ -2120,14 +2147,14 @@
* @task mail
*/
protected function buildReplyHandler(PhabricatorLiskDAO $object) {
- throw new Exception('Capability not supported.');
+ throw new Exception(pht('Capability not supported.'));
}
/**
* @task mail
*/
protected function getMailSubjectPrefix() {
- throw new Exception('Capability not supported.');
+ throw new Exception(pht('Capability not supported.'));
}
@@ -2169,7 +2196,7 @@
* @task mail
*/
protected function buildMailTemplate(PhabricatorLiskDAO $object) {
- throw new Exception('Capability not supported.');
+ throw new Exception(pht('Capability not supported.'));
}
@@ -2177,7 +2204,7 @@
* @task mail
*/
protected function getMailTo(PhabricatorLiskDAO $object) {
- throw new Exception('Capability not supported.');
+ throw new Exception(pht('Capability not supported.'));
}
@@ -2234,7 +2261,7 @@
}
if (!$has_support) {
- throw new Exception('Capability not supported.');
+ throw new Exception(pht('Capability not supported.'));
}
return array_mergev($phids);
@@ -2456,7 +2483,7 @@
protected function buildHeraldAdapter(
PhabricatorLiskDAO $object,
array $xactions) {
- throw new Exception('No herald adapter specified.');
+ throw new Exception(pht('No Herald adapter specified.'));
}
private function setHeraldAdapter(HeraldAdapter $adapter) {
@@ -2518,7 +2545,9 @@
$field_key = $xaction->getMetadataValue('customfield:key');
if (!$field_key) {
throw new Exception(
- "Custom field transaction has no 'customfield:key'!");
+ pht(
+ "Custom field transaction has no '%s'!",
+ 'customfield:key'));
}
$field = PhabricatorCustomField::getObjectField(
@@ -2528,14 +2557,20 @@
if (!$field) {
throw new Exception(
- "Custom field transaction has invalid 'customfield:key'; field ".
- "'{$field_key}' is disabled or does not exist.");
+ pht(
+ "Custom field transaction has invalid '%s'; field ".
+ "'%s' is disabled or does not exist.",
+ 'customfield:key',
+ $field_key));
}
if (!$field->shouldAppearInApplicationTransactions()) {
throw new Exception(
- "Custom field transaction '{$field_key}' does not implement ".
- "integration for ApplicationTransactions.");
+ pht(
+ "Custom field transaction '%s' does not implement ".
+ "integration for %s.",
+ $field_key,
+ 'ApplicationTransactions'));
}
$field->setViewer($this->getActor());
diff --git a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
--- a/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
+++ b/src/applications/transactions/storage/PhabricatorApplicationTransaction.php
@@ -137,7 +137,7 @@
public function getComment() {
if ($this->commentNotLoaded) {
- throw new Exception('Comment for this transaction was not loaded.');
+ throw new Exception(pht('Comment for this transaction was not loaded.'));
}
return $this->comment;
}
@@ -292,8 +292,7 @@
public function getHandles() {
if ($this->handles === null) {
throw new Exception(
- 'Transaction requires handles and it did not load them.'
- );
+ pht('Transaction requires handles and it did not load them.'));
}
return $this->handles;
}
diff --git a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
--- a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
+++ b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
@@ -149,7 +149,11 @@
}
if (!$this->getObjectPHID()) {
- throw new Exception('Call setObjectPHID() before render()!');
+ throw new Exception(
+ pht(
+ 'Call %s before %s!',
+ 'setObjectPHID()',
+ 'render()'));
}
return id(new AphrontFormView())
diff --git a/src/applications/typeahead/controller/PhabricatorTypeaheadFunctionHelpController.php b/src/applications/typeahead/controller/PhabricatorTypeaheadFunctionHelpController.php
--- a/src/applications/typeahead/controller/PhabricatorTypeaheadFunctionHelpController.php
+++ b/src/applications/typeahead/controller/PhabricatorTypeaheadFunctionHelpController.php
@@ -93,25 +93,21 @@
$content[] = '= '.pht('Using Typeahead Functions');
$content[] = pht(
- 'In addition to typing user and project names to build queries, you can '.
- 'also type the names of special functions which give you more options '.
- 'and the ability to express more complex queries.'.
- "\n\n".
- 'Functions have an internal name (like `viewer()`) and a '.
- 'human-readable name, like `Current Viewer`. In general, you can type '.
- 'either one to select the function. You can also click the '.
- '{nav icon=search} button on any typeahead control to browse available '.
- 'functions and find this documentation.'.
- "\n\n".
- 'This documentation uses the internal names to make it clear where '.
- 'tokens begin and end. Specifically, you will find queries written '.
- 'out like this in the documentation: '.
- "\n\n".
- '> viewer(), alincoln'.
- "\n\n".
- 'When this query is actually shown in the control, it will look more '.
- 'like this:'.
- "\n\n".
+ "In addition to typing user and project names to build queries, you can ".
+ "also type the names of special functions which give you more options ".
+ "and the ability to express more complex queries.\n\n".
+ "Functions have an internal name (like `%s`) and a human-readable name, ".
+ "like `Current Viewer`. In general, you can type either one to select ".
+ "the function. You can also click the {nav icon=search} button on any ".
+ "typeahead control to browse available functions and find this ".
+ "documentation.\n\n".
+ "This documentation uses the internal names to make it clear where ".
+ "tokens begin and end. Specifically, you will find queries written ".
+ "out like this in the documentation:\n\n%s\n\n".
+ "When this query is actually shown in the control, it will look more ".
+ "like this:\n\n%s",
+ 'viewer()',
+ '> viewer(), alincoln',
'> {nav Current Viewer} {nav alincoln (Abraham Lincoln)}');
diff --git a/src/applications/uiexample/examples/JavelinReactorUIExample.php b/src/applications/uiexample/examples/JavelinReactorUIExample.php
--- a/src/applications/uiexample/examples/JavelinReactorUIExample.php
+++ b/src/applications/uiexample/examples/JavelinReactorUIExample.php
@@ -3,11 +3,11 @@
final class JavelinReactorUIExample extends PhabricatorUIExample {
public function getName() {
- return 'Javelin Reactor';
+ return pht('Javelin Reactor');
}
public function getDescription() {
- return 'Lots of code';
+ return pht('Lots of code');
}
public function renderExample() {
diff --git a/src/applications/uiexample/examples/JavelinUIExample.php b/src/applications/uiexample/examples/JavelinUIExample.php
--- a/src/applications/uiexample/examples/JavelinUIExample.php
+++ b/src/applications/uiexample/examples/JavelinUIExample.php
@@ -3,11 +3,11 @@
final class JavelinUIExample extends PhabricatorUIExample {
public function getName() {
- return 'Javelin UI';
+ return pht('Javelin UI');
}
public function getDescription() {
- return 'Here are some Javelin UI elements that you could use.';
+ return pht('Here are some Javelin UI elements that you could use.');
}
public function renderExample() {
@@ -34,7 +34,7 @@
),
),
),
- 'Toggle Red Border');
+ pht('Toggle Red Border'));
$button_blue = javelin_tag(
'a',
@@ -51,7 +51,7 @@
),
),
),
- 'Toggle Blue Background');
+ pht('Toggle Blue Background'));
$div = phutil_tag(
'div',
diff --git a/src/applications/uiexample/examples/JavelinViewUIExample.php b/src/applications/uiexample/examples/JavelinViewUIExample.php
--- a/src/applications/uiexample/examples/JavelinViewUIExample.php
+++ b/src/applications/uiexample/examples/JavelinViewUIExample.php
@@ -3,11 +3,11 @@
final class JavelinViewUIExample extends PhabricatorUIExample {
public function getName() {
- return 'Javelin Views';
+ return pht('Javelin Views');
}
public function getDescription() {
- return 'Mix and match client and server views.';
+ return pht('Mix and match client and server views.');
}
public function renderExample() {
@@ -33,7 +33,7 @@
$parent_server_template->appendChild($parent_client_template);
$parent_client_template->appendChild($child_server_template);
$child_server_template->appendChild($child_client_template);
- $child_client_template->appendChild('Hey, it worked.');
+ $child_client_template->appendChild(pht('Hey, it worked.'));
$panel = new PHUIObjectBoxView();
$panel->setHeaderText(pht('Example'));
diff --git a/src/applications/uiexample/examples/PHUIActionHeaderExample.php b/src/applications/uiexample/examples/PHUIActionHeaderExample.php
--- a/src/applications/uiexample/examples/PHUIActionHeaderExample.php
+++ b/src/applications/uiexample/examples/PHUIActionHeaderExample.php
@@ -3,11 +3,11 @@
final class PHUIActionHeaderExample extends PhabricatorUIExample {
public function getName() {
- return 'Action Headers';
+ return pht('Action Headers');
}
public function getDescription() {
- return 'Various header layouts with and without icons';
+ return pht('Various header layouts with and without icons');
}
public function renderExample() {
@@ -53,7 +53,7 @@
->appendChild($layout1)
->addMargin(PHUI::MARGIN_LARGE);
-/* Policy Icons */
+ // Policy Icons
$title2 = id(new PHUIHeaderView())
->setHeader(pht('With Icons'));
@@ -113,7 +113,7 @@
->addMargin(PHUI::MARGIN_LARGE);
-/* Action Icons */
+ // Action Icons
$title3 = id(new PHUIHeaderView())
->setHeader(pht('With Action Icons'));
@@ -142,18 +142,18 @@
$action6->setHref('#');
$header1 = id(new PHUIActionHeaderView())
- ->setHeaderTitle('Company')
+ ->setHeaderTitle(pht('Company'))
->setHeaderHref('http://example.com/')
->addAction($action1);
$header2 = id(new PHUIActionHeaderView())
- ->setHeaderTitle('Public')
+ ->setHeaderTitle(pht('Public'))
->setHeaderHref('http://example.com/')
->setHeaderColor(PHUIActionHeaderView::HEADER_GREY)
->addAction($action1);
$header3 = id(new PHUIActionHeaderView())
- ->setHeaderTitle('Restricted')
+ ->setHeaderTitle(pht('Restricted'))
->setHeaderHref('http://example.com/')
->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTBLUE)
->addAction($action2);
@@ -191,51 +191,51 @@
->appendChild($layout3)
->addMargin(PHUI::MARGIN_LARGE);
-/* Action Icons */
+ // Action Icons
$title4 = id(new PHUIHeaderView())
->setHeader(pht('With Tags'));
$tag1 = id(new PHUITagView())
->setType(PHUITagView::TYPE_STATE)
->setBackgroundColor(PHUITagView::COLOR_RED)
- ->setName('Open');
+ ->setName(pht('Open'));
$tag2 = id(new PHUITagView())
->setType(PHUITagView::TYPE_STATE)
->setBackgroundColor(PHUITagView::COLOR_BLUE)
- ->setName('Closed');
+ ->setName(pht('Closed'));
$action1 = new PHUIIconView();
$action1->setIconFont('fa-flag');
$action1->setHref('#');
$header1 = id(new PHUIActionHeaderView())
- ->setHeaderTitle('Company')
+ ->setHeaderTitle(pht('Company'))
->setTag($tag2);
$header2 = id(new PHUIActionHeaderView())
- ->setHeaderTitle('Public')
+ ->setHeaderTitle(pht('Public'))
->setHeaderColor(PHUIActionHeaderView::HEADER_GREY)
->addAction($action1)
->setTag($tag1);
$header3 = id(new PHUIActionHeaderView())
- ->setHeaderTitle('Restricted')
+ ->setHeaderTitle(pht('Restricted'))
->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTBLUE)
->setTag($tag2);
$header4 = id(new PHUIActionHeaderView())
- ->setHeaderTitle('Company')
+ ->setHeaderTitle(pht('Company'))
->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTGREEN)
->setTag($tag1);
$header5 = id(new PHUIActionHeaderView())
- ->setHeaderTitle('Public')
+ ->setHeaderTitle(pht('Public'))
->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTRED)
->setTag($tag2);
$header6 = id(new PHUIActionHeaderView())
- ->setHeaderTitle('Restricted')
+ ->setHeaderTitle(pht('Restricted'))
->setHeaderColor(PHUIActionHeaderView::HEADER_LIGHTVIOLET)
->setTag($tag1);
diff --git a/src/applications/uiexample/examples/PHUIActionPanelExample.php b/src/applications/uiexample/examples/PHUIActionPanelExample.php
--- a/src/applications/uiexample/examples/PHUIActionPanelExample.php
+++ b/src/applications/uiexample/examples/PHUIActionPanelExample.php
@@ -3,11 +3,11 @@
final class PHUIActionPanelExample extends PhabricatorUIExample {
public function getName() {
- return 'Action Panel';
+ return pht('Action Panel');
}
public function getDescription() {
- return 'A panel with strong tendencies for inciting ACTION!';
+ return pht('A panel with strong tendencies for inciting ACTION!');
}
public function renderExample() {
@@ -30,7 +30,7 @@
->setFontIcon('fa-server')
->setHeader(pht('Launch Instance'))
->setHref('#')
- ->setSubHeader(pht('Maybe this is what you\'re likely here for.'))
+ ->setSubHeader(pht("Maybe this is what you're likely here for."))
->setStatus(pht('You have no instances.'))
->setState(PHUIActionPanelView::STATE_ERROR);
$view->addColumn($panel2);
diff --git a/src/applications/uiexample/examples/PHUIBoxExample.php b/src/applications/uiexample/examples/PHUIBoxExample.php
--- a/src/applications/uiexample/examples/PHUIBoxExample.php
+++ b/src/applications/uiexample/examples/PHUIBoxExample.php
@@ -3,18 +3,18 @@
final class PHUIBoxExample extends PhabricatorUIExample {
public function getName() {
- return 'Box';
+ return pht('Box');
}
public function getDescription() {
- return 'It\'s a fancy or non-fancy box. Put stuff in it.';
+ return pht("It's a fancy or non-fancy box. Put stuff in it.");
}
public function renderExample() {
$content1 = 'Asmund and Signy';
$content2 = 'The Cottager and his Cat';
- $content3 = 'Geirlug The King\'s Daughter';
+ $content3 = "Geirlug The King's Daughter";
$layout1 =
array(
@@ -67,18 +67,18 @@
->setTag('a')
->setColor(PHUIButtonView::SIMPLE)
->setIcon($image)
- ->setText('Such Wow')
+ ->setText(pht('Such Wow'))
->addClass(PHUI::MARGIN_SMALL_RIGHT);
$header = id(new PHUIHeaderView())
- ->setHeader('Fancy Box')
+ ->setHeader(pht('Fancy Box'))
->addActionLink($button);
$obj4 = id(new PHUIObjectBoxView())
->setHeader($header)
->appendChild(id(new PHUIBoxView())
->addPadding(PHUI::PADDING_MEDIUM)
- ->appendChild('Such Fancy, Nice Box, Many Corners.'));
+ ->appendChild(pht('Such Fancy, Nice Box, Many Corners.')));
$head1 = id(new PHUIHeaderView())
->setHeader(pht('Plain Box'));
diff --git a/src/applications/uiexample/examples/PHUIButtonBarExample.php b/src/applications/uiexample/examples/PHUIButtonBarExample.php
--- a/src/applications/uiexample/examples/PHUIButtonBarExample.php
+++ b/src/applications/uiexample/examples/PHUIButtonBarExample.php
@@ -74,7 +74,7 @@
->addClass('mlr mll mlb');
$wrap1 = id(new PHUIObjectBoxView())
- ->setHeaderText('Button Bar Example')
+ ->setHeaderText(pht('Button Bar Example'))
->appendChild($layout1)
->appendChild($layout2)
->appendChild($layout3);
diff --git a/src/applications/uiexample/examples/PHUIButtonExample.php b/src/applications/uiexample/examples/PHUIButtonExample.php
--- a/src/applications/uiexample/examples/PHUIButtonExample.php
+++ b/src/applications/uiexample/examples/PHUIButtonExample.php
@@ -3,11 +3,13 @@
final class PHUIButtonExample extends PhabricatorUIExample {
public function getName() {
- return 'Buttons';
+ return pht('Buttons');
}
public function getDescription() {
- return hsprintf('Use <tt>&lt;button&gt;</tt> to render buttons.');
+ return pht(
+ 'Use %s to render buttons.',
+ phutil_tag('tt', array(), '&lt;button&gt;'));
}
public function renderExample() {
@@ -79,7 +81,7 @@
->setColor($color)
->setSize($size)
->setTag('a')
- ->setText('Clicky');
+ ->setText(pht('Clicky'));
$column[$key][] = hsprintf('<br /><br />');
}
}
@@ -87,7 +89,7 @@
$column[2][] = id(new PHUIButtonView())
->setColor($color)
->setTag('button')
- ->setText('Button')
+ ->setText(pht('Button'))
->setDropdown(true);
$column[2][] = hsprintf('<br /><br />');
}
@@ -110,7 +112,7 @@
);
foreach ($icons as $text => $icon) {
$image = id(new PHUIIconView())
- ->setIconFont($icon);
+ ->setIconFont($icon);
$column[] = id(new PHUIButtonView())
->setTag('a')
->setColor(PHUIButtonView::GREY)
@@ -160,14 +162,14 @@
$icons = array('Asana', 'Github', 'Facebook', 'Google', 'LDAP');
foreach ($icons as $icon) {
$image = id(new PHUIIconView())
- ->setSpriteSheet(PHUIIconView::SPRITE_LOGIN)
- ->setSpriteIcon($icon);
+ ->setSpriteSheet(PHUIIconView::SPRITE_LOGIN)
+ ->setSpriteIcon($icon);
$column[] = id(new PHUIButtonView())
->setTag('a')
->setSize(PHUIButtonView::BIG)
->setColor(PHUIButtonView::GREY)
->setIcon($image)
- ->setText('Login or Register')
+ ->setText(pht('Login or Register'))
->setSubtext($icon)
->addClass(PHUI::MARGIN_MEDIUM_RIGHT);
}
@@ -187,13 +189,13 @@
->setHeader('PHUIButtonView');
$head3 = id(new PHUIHeaderView())
- ->setHeader('Icon Buttons');
+ ->setHeader(pht('Icon Buttons'));
$head4 = id(new PHUIHeaderView())
- ->setHeader('Simple Buttons');
+ ->setHeader(pht('Simple Buttons'));
$head5 = id(new PHUIHeaderView())
- ->setHeader('Big Icon Buttons');
+ ->setHeader(pht('Big Icon Buttons'));
$wrap1 = id(new PHUIBoxView())
->appendChild($layout1)
@@ -215,8 +217,17 @@
->appendChild($layout5)
->addMargin(PHUI::MARGIN_LARGE);
- return array($head1, $wrap1, $head2, $wrap2, $head3, $wrap3,
- $head4, $wrap4, $head5, $wrap5,
+ return array(
+ $head1,
+ $wrap1,
+ $head2,
+ $wrap2,
+ $head3,
+ $wrap3,
+ $head4,
+ $wrap4,
+ $head5,
+ $wrap5,
);
}
}
diff --git a/src/applications/uiexample/examples/PHUIColorPalletteExample.php b/src/applications/uiexample/examples/PHUIColorPalletteExample.php
--- a/src/applications/uiexample/examples/PHUIColorPalletteExample.php
+++ b/src/applications/uiexample/examples/PHUIColorPalletteExample.php
@@ -3,11 +3,11 @@
final class PHUIColorPalletteExample extends PhabricatorUIExample {
public function getName() {
- return 'Colors';
+ return pht('Colors');
}
public function getDescription() {
- return 'A Standard Palette of Colors for use.';
+ return pht('A Standard Palette of Colors for use.');
}
public function renderExample() {
diff --git a/src/applications/uiexample/examples/PHUIDocumentExample.php b/src/applications/uiexample/examples/PHUIDocumentExample.php
--- a/src/applications/uiexample/examples/PHUIDocumentExample.php
+++ b/src/applications/uiexample/examples/PHUIDocumentExample.php
@@ -15,35 +15,35 @@
$user = $request->getUser();
$action = id(new PHUIListItemView())
- ->setName('Actions')
+ ->setName(pht('Actions'))
->setType(PHUIListItemView::TYPE_LABEL);
$action1 = id(new PHUIListItemView())
- ->setName('Edit Document')
+ ->setName(pht('Edit Document'))
->setHref('#')
->setIcon('fa-edit')
->setType(PHUIListItemView::TYPE_LINK);
$action2 = id(new PHUIListItemView())
- ->setName('Move Document')
+ ->setName(pht('Move Document'))
->setHref('#')
->setIcon('fa-arrows')
->setType(PHUIListItemView::TYPE_LINK);
$action3 = id(new PHUIListItemView())
- ->setName('Delete Document')
+ ->setName(pht('Delete Document'))
->setHref('#')
->setIcon('fa-times')
->setType(PHUIListItemView::TYPE_LINK);
$action4 = id(new PHUIListItemView())
- ->setName('View History')
+ ->setName(pht('View History'))
->setHref('#')
->setIcon('fa-list')
->setType(PHUIListItemView::TYPE_LINK);
$action5 = id(new PHUIListItemView())
- ->setName('Subscribe')
+ ->setName(pht('Subscribe'))
->setHref('#')
->setIcon('fa-plus-circle')
->setType(PHUIListItemView::TYPE_LINK);
@@ -52,33 +52,33 @@
->setType(PHUIListItemView::TYPE_DIVIDER);
$header = id(new PHUIHeaderView())
- ->setHeader('Installation');
+ ->setHeader(pht('Installation'));
$label1 = id(new PHUIListItemView())
- ->setName('Getting Started')
+ ->setName(pht('Getting Started'))
->setType(PHUIListItemView::TYPE_LABEL);
$label2 = id(new PHUIListItemView())
- ->setName('Documentation')
+ ->setName(pht('Documentation'))
->setType(PHUIListItemView::TYPE_LABEL);
$item1 = id(new PHUIListItemView())
- ->setName('Installation')
+ ->setName(pht('Installation'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$item2 = id(new PHUIListItemView())
- ->setName('Webserver Config')
+ ->setName(pht('Webserver Config'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$item3 = id(new PHUIListItemView())
- ->setName('Adding Users')
+ ->setName(pht('Adding Users'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$item4 = id(new PHUIListItemView())
- ->setName('Debugging')
+ ->setName(pht('Debugging'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
@@ -108,23 +108,23 @@
->setType(PHUIListItemView::TYPE_ICON);
$item1 = id(new PHUIListItemView())
- ->setName('Installation')
+ ->setName(pht('Installation'))
->setHref('#')
->setSelected(true)
->setType(PHUIListItemView::TYPE_LINK);
$item2 = id(new PHUIListItemView())
- ->setName('Webserver Config')
+ ->setName(pht('Webserver Config'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$item3 = id(new PHUIListItemView())
- ->setName('Adding Users')
+ ->setName(pht('Adding Users'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$item4 = id(new PHUIListItemView())
- ->setName('Debugging')
+ ->setName(pht('Debugging'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
@@ -187,7 +187,7 @@
'mollit anim id est laborum.</p>');
$content = new PHUIDocumentView();
- $content->setBook('Book or Project Name', 'Article');
+ $content->setBook(pht('Book or Project Name'), pht('Article'));
$content->setHeader($header);
$content->setFluid(true);
$content->setTopNav($topnav);
diff --git a/src/applications/uiexample/examples/PHUIFeedStoryExample.php b/src/applications/uiexample/examples/PHUIFeedStoryExample.php
--- a/src/applications/uiexample/examples/PHUIFeedStoryExample.php
+++ b/src/applications/uiexample/examples/PHUIFeedStoryExample.php
@@ -3,12 +3,12 @@
final class PHUIFeedStoryExample extends PhabricatorUIExample {
public function getName() {
- return 'Feed Story';
+ return pht('Feed Story');
}
public function getDescription() {
- return 'An outlandish exaggeration of intricate tales from '.
- 'around the realm';
+ return pht(
+ 'An outlandish exaggeration of intricate tales from around the realm');
}
public function renderExample() {
@@ -41,7 +41,8 @@
->setSpriteSheet(PHUIIconView::SPRITE_TOKENS)
->setSpriteIcon($token);
}
- $text = hsprintf('<strong><a>lincoln (Honest Abe)</a></strong> wrote a '.
+ $text = hsprintf(
+ '<strong><a>lincoln (Honest Abe)</a></strong> wrote a '.
'new blog post.');
$story2 = id(new PHUIFeedStoryView())
->setTitle($text)
@@ -51,7 +52,8 @@
->setAppIcon('fa-star')
->setUser($user)
->setTokenBar($tokenview)
- ->setPontification('Four score and seven years ago our fathers brought '.
+ ->setPontification(
+ 'Four score and seven years ago our fathers brought '.
'forth on this continent, a new nation, conceived in Liberty, and '.
'dedicated to the proposition that all men are created equal. '.
'Now we are engaged in a great civil war, testing whether that '.
@@ -64,7 +66,8 @@
/* Action Story, let's give people tokens! */
- $text = hsprintf('<strong><a>harding (Tom Harding)</a></strong> awarded '.
+ $text = hsprintf(
+ '<strong><a>harding (Tom Harding)</a></strong> awarded '.
'<a>M10: Workboards</a> a token.');
$action1 = id(new PHUIIconView())
->setIconFont('fa-trophy bluegrey')
@@ -84,7 +87,8 @@
->setUser($user);
/* Image Story, used in Pholio, Macro */
- $text = hsprintf('<strong><a>wgharding (Warren Harding)</a></strong> '.
+ $text = hsprintf(
+ '<strong><a>wgharding (Warren Harding)</a></strong> '.
'asked a new question.');
$action1 = id(new PHUIIconView())
->setIconFont('fa-chevron-up bluegrey')
@@ -98,14 +102,15 @@
->setImageHref('http://en.wikipedia.org/wiki/Warren_G._Harding')
->setEpoch(1)
->setAppIcon('fa-cogs')
- ->setPontification('Why does inline-block add space under my spans and '.
- 'anchors?')
+ ->setPontification(
+ 'Why does inline-block add space under my spans and anchors?')
->addAction($action1)
->addAction($action2)
->setUser($user);
/* Text Story, useful in Blogs, Ponders, Status */
- $text = hsprintf('<strong><a>lincoln (Honest Abe)</a></strong> updated '.
+ $text = hsprintf(
+ '<strong><a>lincoln (Honest Abe)</a></strong> updated '.
'his status.');
$story5 = id(new PHUIFeedStoryView())
->setTitle($text)
@@ -114,8 +119,9 @@
->setEpoch(strtotime('November 19, 1863'))
->setAppIcon('fa-rocket')
->setUser($user)
- ->setPontification('If we ever create a lightweight status app '.
- 'this story would be how that would be displayed.');
+ ->setPontification(
+ 'If we ever create a lightweight status app '.
+ 'this story would be how that would be displayed.');
/* Basic "One Line" Story */
$text = hsprintf(
diff --git a/src/applications/uiexample/examples/PHUIIconExample.php b/src/applications/uiexample/examples/PHUIIconExample.php
--- a/src/applications/uiexample/examples/PHUIIconExample.php
+++ b/src/applications/uiexample/examples/PHUIIconExample.php
@@ -3,11 +3,11 @@
final class PHUIIconExample extends PhabricatorUIExample {
public function getName() {
- return 'Icons and Images';
+ return pht('Icons and Images');
}
public function getDescription() {
- return 'Easily render icons or images with links and sprites.';
+ return pht('Easily render icons or images with links and sprites.');
}
private function listTransforms() {
diff --git a/src/applications/uiexample/examples/PHUIImageMaskExample.php b/src/applications/uiexample/examples/PHUIImageMaskExample.php
--- a/src/applications/uiexample/examples/PHUIImageMaskExample.php
+++ b/src/applications/uiexample/examples/PHUIImageMaskExample.php
@@ -3,15 +3,14 @@
final class PHUIImageMaskExample extends PhabricatorUIExample {
public function getName() {
- return 'Image Masks';
+ return pht('Image Masks');
}
public function getDescription() {
- return 'Display images with crops.';
+ return pht('Display images with crops.');
}
public function renderExample() {
-
$image = celerity_get_resource_uri('/rsrc/image/examples/hero.png');
$display_height = 100;
$display_width = 200;
diff --git a/src/applications/uiexample/examples/PHUIInfoExample.php b/src/applications/uiexample/examples/PHUIInfoExample.php
--- a/src/applications/uiexample/examples/PHUIInfoExample.php
+++ b/src/applications/uiexample/examples/PHUIInfoExample.php
@@ -3,12 +3,13 @@
final class PHUIInfoExample extends PhabricatorUIExample {
public function getName() {
- return 'Info View';
+ return pht('Info View');
}
public function getDescription() {
- return hsprintf(
- 'Use <tt>PHUIInfoView</tt> to render errors, warnings and notices.');
+ return pht(
+ 'Use %s to render errors, warnings and notices.',
+ phutil_tag('tt', array(), 'PHUIInfoView'));
}
public function renderExample() {
@@ -16,16 +17,16 @@
$user = $request->getUser();
$sevs = array(
- PHUIInfoView::SEVERITY_ERROR => 'Error',
- PHUIInfoView::SEVERITY_WARNING => 'Warning',
- PHUIInfoView::SEVERITY_NODATA => 'No Data',
- PHUIInfoView::SEVERITY_NOTICE => 'Notice',
- PHUIInfoView::SEVERITY_SUCCESS => 'Success',
+ PHUIInfoView::SEVERITY_ERROR => pht('Error'),
+ PHUIInfoView::SEVERITY_WARNING => pht('Warning'),
+ PHUIInfoView::SEVERITY_NODATA => pht('No Data'),
+ PHUIInfoView::SEVERITY_NOTICE => pht('Notice'),
+ PHUIInfoView::SEVERITY_SUCCESS => pht('Success'),
);
$button = id(new PHUIButtonView())
->setTag('a')
- ->setText('Resolve Issue')
+ ->setText(pht('Resolve Issue'))
->setHref('#');
$views = array();
@@ -42,7 +43,7 @@
foreach ($sevs as $sev => $title) {
$view = new PHUIInfoView();
$view->setSeverity($sev);
- $view->appendChild('Several issues were encountered.');
+ $view->appendChild(pht('Several issues were encountered.'));
$view->addButton($button);
$views[] = $view;
}
@@ -54,9 +55,9 @@
$view->setSeverity($sev);
$view->setErrors(
array(
- 'Overcooked.',
- 'Too much salt.',
- 'Full of sand.',
+ pht('Overcooked.'),
+ pht('Too much salt.'),
+ pht('Full of sand.'),
));
$views[] = $view;
}
@@ -67,12 +68,12 @@
$view = new PHUIInfoView();
$view->setSeverity($sev);
$view->setTitle($title);
- $view->appendChild('Several issues were encountered.');
+ $view->appendChild(pht('Several issues were encountered.'));
$view->setErrors(
array(
- 'Overcooked.',
- 'Too much salt.',
- 'Full of sand.',
+ pht('Overcooked.'),
+ pht('Too much salt.'),
+ pht('Full of sand.'),
));
$views[] = $view;
}
diff --git a/src/applications/uiexample/examples/PHUIInfoPanelExample.php b/src/applications/uiexample/examples/PHUIInfoPanelExample.php
--- a/src/applications/uiexample/examples/PHUIInfoPanelExample.php
+++ b/src/applications/uiexample/examples/PHUIInfoPanelExample.php
@@ -3,15 +3,14 @@
final class PHUIInfoPanelExample extends PhabricatorUIExample {
public function getName() {
- return 'Info Panel';
+ return pht('Info Panel');
}
public function getDescription() {
- return 'A medium sized box with bits of gooey information.';
+ return pht('A medium sized box with bits of gooey information.');
}
public function renderExample() {
-
$header1 = id(new PHUIHeaderView())
->setHeader(pht('Conpherence'));
@@ -42,60 +41,60 @@
$column1 = id(new PHUIInfoPanelView())
->setHeader($header1)
->setColumns(3)
- ->addInfoBlock(3, 'Needs Triage')
- ->addInfoBlock(5, 'Unbreak Now')
- ->addInfoBlock(0, 'High')
- ->addInfoBlock(0, 'Normal')
- ->addInfoBlock(12, 'Low')
- ->addInfoBlock(123, 'Wishlist');
+ ->addInfoBlock(3, pht('Needs Triage'))
+ ->addInfoBlock(5, pht('Unbreak Now'))
+ ->addInfoBlock(0, pht('High'))
+ ->addInfoBlock(0, pht('Normal'))
+ ->addInfoBlock(12, pht('Low'))
+ ->addInfoBlock(123, pht('Wishlist'));
$column2 = id(new PHUIInfoPanelView())
->setHeader($header2)
->setColumns(3)
- ->addInfoBlock(3, 'Needs Triage')
- ->addInfoBlock(5, 'Unbreak Now')
- ->addInfoBlock(0, 'High')
- ->addInfoBlock(0, 'Normal')
- ->addInfoBlock(12, 'Low')
- ->addInfoBlock(123, 'Wishlist');
+ ->addInfoBlock(3, pht('Needs Triage'))
+ ->addInfoBlock(5, pht('Unbreak Now'))
+ ->addInfoBlock(0, pht('High'))
+ ->addInfoBlock(0, pht('Normal'))
+ ->addInfoBlock(12, pht('Low'))
+ ->addInfoBlock(123, pht('Wishlist'));
$column3 = id(new PHUIInfoPanelView())
->setHeader($header3)
->setColumns(3)
- ->addInfoBlock(3, 'Needs Triage')
- ->addInfoBlock(5, 'Unbreak Now')
- ->addInfoBlock(0, 'High')
- ->addInfoBlock(0, 'Normal')
- ->addInfoBlock(12, 'Low')
- ->addInfoBlock(123, 'Wishlist');
+ ->addInfoBlock(3, pht('Needs Triage'))
+ ->addInfoBlock(5, pht('Unbreak Now'))
+ ->addInfoBlock(0, pht('High'))
+ ->addInfoBlock(0, pht('Normal'))
+ ->addInfoBlock(12, pht('Low'))
+ ->addInfoBlock(123, pht('Wishlist'));
$column4 = id(new PHUIInfoPanelView())
->setHeader($header4)
->setColumns(3)
->setProgress(90)
- ->addInfoBlock(3, 'Needs Triage')
- ->addInfoBlock(5, 'Unbreak Now')
- ->addInfoBlock(0, 'High')
- ->addInfoBlock(0, 'Normal')
- ->addInfoBlock(0, 'Wishlist');
+ ->addInfoBlock(3, pht('Needs Triage'))
+ ->addInfoBlock(5, pht('Unbreak Now'))
+ ->addInfoBlock(0, pht('High'))
+ ->addInfoBlock(0, pht('Normal'))
+ ->addInfoBlock(0, pht('Wishlist'));
$column5 = id(new PHUIInfoPanelView())
->setHeader($header5)
->setColumns(2)
->setProgress(25)
- ->addInfoBlock(3, 'Needs Triage')
- ->addInfoBlock(5, 'Unbreak Now')
- ->addInfoBlock(0, 'High')
- ->addInfoBlock(0, 'Normal');
+ ->addInfoBlock(3, pht('Needs Triage'))
+ ->addInfoBlock(5, pht('Unbreak Now'))
+ ->addInfoBlock(0, pht('High'))
+ ->addInfoBlock(0, pht('Normal'));
$column6 = id(new PHUIInfoPanelView())
->setHeader($header6)
->setColumns(2)
->setProgress(50)
- ->addInfoBlock(3, 'Needs Triage')
- ->addInfoBlock(5, 'Unbreak Now')
- ->addInfoBlock(0, 'High')
- ->addInfoBlock(0, 'Normal');
+ ->addInfoBlock(3, pht('Needs Triage'))
+ ->addInfoBlock(5, pht('Unbreak Now'))
+ ->addInfoBlock(0, pht('High'))
+ ->addInfoBlock(0, pht('Normal'));
$layout1 = id(new AphrontMultiColumnView())
->addColumn($column1)
diff --git a/src/applications/uiexample/examples/PHUIListExample.php b/src/applications/uiexample/examples/PHUIListExample.php
--- a/src/applications/uiexample/examples/PHUIListExample.php
+++ b/src/applications/uiexample/examples/PHUIListExample.php
@@ -3,44 +3,42 @@
final class PHUIListExample extends PhabricatorUIExample {
public function getName() {
- return 'Lists';
+ return pht('Lists');
}
public function getDescription() {
- return 'Create a fanciful list of objects and prismatic donuts.';
+ return pht('Create a fanciful list of objects and prismatic donuts.');
}
public function renderExample() {
-
-
/* Action Menu */
$action1 = id(new PHUIListItemView())
- ->setName('Edit Document')
+ ->setName(pht('Edit Document'))
->setHref('#')
->setIcon('fa-pencil')
->setType(PHUIListItemView::TYPE_LINK);
$action2 = id(new PHUIListItemView())
- ->setName('Move Document')
+ ->setName(pht('Move Document'))
->setHref('#')
->setIcon('fa-arrows')
->setType(PHUIListItemView::TYPE_LINK);
$action3 = id(new PHUIListItemView())
- ->setName('Delete Document')
+ ->setName(pht('Delete Document'))
->setHref('#')
->setIcon('fa-times')
->setType(PHUIListItemView::TYPE_LINK);
$action4 = id(new PHUIListItemView())
- ->setName('View History')
+ ->setName(pht('View History'))
->setHref('#')
->setIcon('fa-list')
->setType(PHUIListItemView::TYPE_LINK);
$action5 = id(new PHUIListItemView())
- ->setName('Subscribe')
+ ->setName(pht('Subscribe'))
->setHref('#')
->setIcon('fa-plus-circle')
->setType(PHUIListItemView::TYPE_LINK);
@@ -57,30 +55,30 @@
/* Side Navigation */
$label1 = id(new PHUIListItemView())
- ->setName('Getting Started')
+ ->setName(pht('Getting Started'))
->setType(PHUIListItemView::TYPE_LABEL);
$label2 = id(new PHUIListItemView())
- ->setName('Documentation')
+ ->setName(pht('Documentation'))
->setType(PHUIListItemView::TYPE_LABEL);
$item1 = id(new PHUIListItemView())
- ->setName('Installation')
+ ->setName(pht('Installation'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$item2 = id(new PHUIListItemView())
- ->setName('Webserver Config')
+ ->setName(pht('Webserver Config'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$item3 = id(new PHUIListItemView())
- ->setName('Adding Users')
+ ->setName(pht('Adding Users'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$item4 = id(new PHUIListItemView())
- ->setName('Debugging')
+ ->setName(pht('Debugging'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
@@ -105,16 +103,16 @@
/* Unstyled */
$item1 = id(new PHUIListItemView())
- ->setName('Rain');
+ ->setName(pht('Rain'));
$item2 = id(new PHUIListItemView())
- ->setName('Spain');
+ ->setName(pht('Spain'));
$item3 = id(new PHUIListItemView())
- ->setName('Mainly');
+ ->setName(pht('Mainly'));
$item4 = id(new PHUIListItemView())
- ->setName('Plains');
+ ->setName(pht('Plains'));
$unstyled = id(new PHUIListView())
->addMenuItem($item1)
@@ -130,61 +128,61 @@
->setType(PHUIListItemView::TYPE_ICON);
$item1 = id(new PHUIListItemView())
- ->setName('Installation')
+ ->setName(pht('Installation'))
->setHref('#')
->setSelected(true)
->setType(PHUIListItemView::TYPE_LINK);
$item2 = id(new PHUIListItemView())
- ->setName('Webserver Config')
+ ->setName(pht('Webserver Config'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$item3 = id(new PHUIListItemView())
- ->setName('Adding Users')
+ ->setName(pht('Adding Users'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$item4 = id(new PHUIListItemView())
- ->setName('Debugging')
+ ->setName(pht('Debugging'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$item1 = id(new PHUIListItemView())
- ->setName('Installation')
+ ->setName(pht('Installation'))
->setHref('#')
->setSelected(true)
->setType(PHUIListItemView::TYPE_LINK);
$item2 = id(new PHUIListItemView())
- ->setName('Webserver Config')
+ ->setName(pht('Webserver Config'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$details1 = id(new PHUIListItemView())
- ->setName('Details')
+ ->setName(pht('Details'))
->setHref('#')
->setSelected(true)
->setType(PHUIListItemView::TYPE_LINK);
$details2 = id(new PHUIListItemView())
- ->setName('Lint (OK)')
+ ->setName(pht('Lint (OK)'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$details3 = id(new PHUIListItemView())
- ->setName('Unit (5/5)')
+ ->setName(pht('Unit (5/5)'))
->setHref('#')
->setType(PHUIListItemView::TYPE_LINK);
$details4 = id(new PHUIListItemView())
- ->setName('Lint (Warn)')
+ ->setName(pht('Lint (Warn)'))
->setHref('#')
->setStatusColor(PHUIListItemView::STATUS_WARN)
->setType(PHUIListItemView::TYPE_LINK);
$details5 = id(new PHUIListItemView())
- ->setName('Unit (3/5)')
+ ->setName(pht('Unit (3/5)'))
->setHref('#')
->setStatusColor(PHUIListItemView::STATUS_FAIL)
->setType(PHUIListItemView::TYPE_LINK);
diff --git a/src/applications/uiexample/examples/PHUIObjectItemListExample.php b/src/applications/uiexample/examples/PHUIObjectItemListExample.php
--- a/src/applications/uiexample/examples/PHUIObjectItemListExample.php
+++ b/src/applications/uiexample/examples/PHUIObjectItemListExample.php
@@ -3,12 +3,13 @@
final class PHUIObjectItemListExample extends PhabricatorUIExample {
public function getName() {
- return 'Object Item List';
+ return pht('Object Item List');
}
public function getDescription() {
- return hsprintf(
- 'Use <tt>PHUIObjectItemListView</tt> to render lists of objects.');
+ return pht(
+ 'Use %s to render lists of objects.',
+ hsprintf('<tt>PHUIObjectItemListView</tt>'));
}
public function renderExample() {
@@ -146,9 +147,10 @@
->setBarColor('blue'));
$list->addItem(
id(new PHUIObjectItemView())
- ->setHeader(pht(
- 'The human cardiovascular system includes the heart, lungs, and '.
- 'some other parts; most of these parts are pretty squishy'))
+ ->setHeader(
+ pht(
+ 'The human cardiovascular system includes the heart, lungs, and '.
+ 'some other parts; most of these parts are pretty squishy'))
->addFootIcon('fa-search white', pht('Respiration!'))
->addHandleIcon($handle, pht('You have a cardiovascular system!'))
->setBarColor('indigo'));
@@ -405,7 +407,7 @@
->setState(PHUIObjectItemView::STATE_BUILD));
$box = id(new PHUIObjectBoxView())
- ->setHeaderText('Test Things')
+ ->setHeaderText(pht('Test Things'))
->appendChild($list);
$out[] = array($head, $box);
diff --git a/src/applications/uiexample/examples/PHUIPropertyListExample.php b/src/applications/uiexample/examples/PHUIPropertyListExample.php
--- a/src/applications/uiexample/examples/PHUIPropertyListExample.php
+++ b/src/applications/uiexample/examples/PHUIPropertyListExample.php
@@ -3,12 +3,13 @@
final class PHUIPropertyListExample extends PhabricatorUIExample {
public function getName() {
- return 'Property List';
+ return pht('Property List');
}
public function getDescription() {
- return hsprintf(
- 'Use <tt>PHUIPropertyListView</tt> to render object properties.');
+ return pht(
+ 'Use %s to render object properties.',
+ phutil_tag('tt', array(), 'PHUIPropertyListView'));
}
public function renderExample() {
@@ -16,15 +17,15 @@
$user = $request->getUser();
$details1 = id(new PHUIListItemView())
- ->setName('Details')
+ ->setName(pht('Details'))
->setSelected(true);
$details2 = id(new PHUIListItemView())
- ->setName('Rainbow Info')
+ ->setName(pht('Rainbow Info'))
->setStatusColor(PHUIListItemView::STATUS_WARN);
$details3 = id(new PHUIListItemView())
- ->setName('Pasta Haiku')
+ ->setName(pht('Pasta Haiku'))
->setStatusColor(PHUIListItemView::STATUS_FAIL);
$statustabs = id(new PHUIListView())
@@ -55,28 +56,29 @@
$view2 = new PHUIPropertyListView();
- $view2->addSectionHeader('Colors of the Rainbow');
+ $view2->addSectionHeader(pht('Colors of the Rainbow'));
- $view2->addProperty('R', 'Red');
- $view2->addProperty('O', 'Orange');
- $view2->addProperty('Y', 'Yellow');
- $view2->addProperty('G', 'Green');
- $view2->addProperty('B', 'Blue');
- $view2->addProperty('I', 'Indigo');
- $view2->addProperty('V', 'Violet');
+ $view2->addProperty('R', pht('Red'));
+ $view2->addProperty('O', pht('Orange'));
+ $view2->addProperty('Y', pht('Yellow'));
+ $view2->addProperty('G', pht('Green'));
+ $view2->addProperty('B', pht('Blue'));
+ $view2->addProperty('I', pht('Indigo'));
+ $view2->addProperty('V', pht('Violet'));
$view3 = new PHUIPropertyListView();
- $view3->addSectionHeader('Haiku About Pasta');
+ $view3->addSectionHeader(pht('Haiku About Pasta'));
$view3->addTextContent(
hsprintf(
- 'this is a pasta<br />'.
- 'haiku. it is very bad.<br />'.
- 'what did you expect?'));
+ '%s<br />%s<br />%s',
+ pht('this is a pasta'),
+ pht('haiku. it is very bad.'),
+ pht('what did you expect?')));
$object_box1 = id(new PHUIObjectBoxView())
- ->setHeaderText('PHUIPropertyListView Stackered')
+ ->setHeaderText(pht('%s Stackered', 'PHUIPropertyListView'))
->addPropertyList($view, $details1)
->addPropertyList($view2, $details2)
->addPropertyList($view3, $details3);
@@ -85,20 +87,23 @@
$edge_cases_view->addProperty(
pht('Description'),
- pht('These layouts test UI edge cases in the element. This block '.
- 'tests wrapping and overflow behavior.'));
+ pht(
+ 'These layouts test UI edge cases in the element. This block '.
+ 'tests wrapping and overflow behavior.'));
$edge_cases_view->addProperty(
pht('A Very Very Very Very Very Very Very Very Very Long Property Label'),
- pht('This property label and property value are quite long. They '.
- 'demonstrate the wrapping behavior of the element, or lack thereof '.
- 'if something terrible has happened.'));
+ pht(
+ 'This property label and property value are quite long. They '.
+ 'demonstrate the wrapping behavior of the element, or lack thereof '.
+ 'if something terrible has happened.'));
$edge_cases_view->addProperty(
pht('AVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLongUnbrokenPropertyLabel'),
- pht('Thispropertylabelandpropertyvaluearequitelongandhave'.
- 'nospacestheydemonstratetheoverflowbehavioroftheelement'.
- 'orlackthereof.'));
+ pht(
+ 'Thispropertylabelandpropertyvaluearequitelongandhave'.
+ 'nospacestheydemonstratetheoverflowbehavioroftheelement'.
+ 'orlackthereof.'));
$edge_cases_view->addProperty(
@@ -122,7 +127,7 @@
pht('Smith'));
$object_box2 = id(new PHUIObjectBoxView())
- ->setHeaderText('Some Bad Examples')
+ ->setHeaderText(pht('Some Bad Examples'))
->addPropertyList($edge_cases_view);
return array(
diff --git a/src/applications/uiexample/examples/PHUITagExample.php b/src/applications/uiexample/examples/PHUITagExample.php
--- a/src/applications/uiexample/examples/PHUITagExample.php
+++ b/src/applications/uiexample/examples/PHUITagExample.php
@@ -3,11 +3,13 @@
final class PHUITagExample extends PhabricatorUIExample {
public function getName() {
- return 'Tags';
+ return pht('Tags');
}
public function getDescription() {
- return hsprintf('Use <tt>PHUITagView</tt> to render various tags.');
+ return pht(
+ 'Use %s to render various tags.',
+ phutil_tag('tt', array(), 'PHUITagView'));
}
public function renderExample() {
@@ -103,19 +105,19 @@
->setType(PHUITagView::TYPE_STATE)
->setBackgroundColor(PHUITagView::COLOR_GREEN)
->setDotColor(PHUITagView::COLOR_RED)
- ->setName('Christmas');
+ ->setName(pht('Christmas'));
$tags[] = hsprintf('<br /><br />');
$tags[] = id(new PHUITagView())
->setType(PHUITagView::TYPE_OBJECT)
->setBackgroundColor(PHUITagView::COLOR_ORANGE)
->setDotColor(PHUITagView::COLOR_BLACK)
- ->setName('Halloween');
+ ->setName(pht('Halloween'));
$tags[] = hsprintf('<br /><br />');
$tags[] = id(new PHUITagView())
->setType(PHUITagView::TYPE_STATE)
->setBackgroundColor(PHUITagView::COLOR_INDIGO)
->setDotColor(PHUITagView::COLOR_YELLOW)
- ->setName('Easter');
+ ->setName(pht('Easter'));
$content2 = id(new PHUIBoxView())
->appendChild($tags)
@@ -126,31 +128,31 @@
->setType(PHUITagView::TYPE_STATE)
->setBackgroundColor(PHUITagView::COLOR_GREEN)
->setIcon('fa-check white')
- ->setName('Passed');
+ ->setName(pht('Passed'));
$icons[] = hsprintf('<br /><br />');
$icons[] = id(new PHUITagView())
->setType(PHUITagView::TYPE_STATE)
->setBackgroundColor(PHUITagView::COLOR_RED)
->setIcon('fa-times white')
- ->setName('Failed');
+ ->setName(pht('Failed'));
$icons[] = hsprintf('<br /><br />');
$icons[] = id(new PHUITagView())
->setType(PHUITagView::TYPE_STATE)
->setBackgroundColor(PHUITagView::COLOR_BLUE)
->setIcon('fa-refresh white')
- ->setName('Running');
+ ->setName(pht('Running'));
$icons[] = hsprintf('<br /><br />');
$icons[] = id(new PHUITagView())
->setType(PHUITagView::TYPE_STATE)
->setBackgroundColor(PHUITagView::COLOR_GREY)
->setIcon('fa-pause white')
- ->setName('Paused');
+ ->setName(pht('Paused'));
$icons[] = hsprintf('<br /><br />');
$icons[] = id(new PHUITagView())
->setType(PHUITagView::TYPE_STATE)
->setBackgroundColor(PHUITagView::COLOR_BLACK)
->setIcon('fa-stop white')
- ->setName('Stopped');
+ ->setName(pht('Stopped'));
$content3 = id(new PHUIBoxView())
->appendChild($icons)
@@ -181,23 +183,23 @@
->addPadding(PHUI::PADDING_LARGE);
$box = id(new PHUIObjectBoxView())
- ->setHeaderText('Inline')
+ ->setHeaderText(pht('Inline'))
->appendChild($intro);
$box1 = id(new PHUIObjectBoxView())
- ->setHeaderText('Colors')
+ ->setHeaderText(pht('Colors'))
->appendChild($content1);
$box2 = id(new PHUIObjectBoxView())
- ->setHeaderText('Holidays')
+ ->setHeaderText(pht('Holidays'))
->appendChild($content2);
$box3 = id(new PHUIObjectBoxView())
- ->setHeaderText('Icons')
+ ->setHeaderText(pht('Icons'))
->appendChild($content3);
$box4 = id(new PHUIObjectBoxView())
- ->setHeaderText('Shades')
+ ->setHeaderText(pht('Shades'))
->appendChild($content4);
return array($box, $box1, $box2, $box3, $box4);
diff --git a/src/applications/uiexample/examples/PHUITextExample.php b/src/applications/uiexample/examples/PHUITextExample.php
--- a/src/applications/uiexample/examples/PHUITextExample.php
+++ b/src/applications/uiexample/examples/PHUITextExample.php
@@ -3,28 +3,28 @@
final class PHUITextExample extends PhabricatorUIExample {
public function getName() {
- return 'Text';
+ return pht('Text');
}
public function getDescription() {
- return 'Simple styles for displaying text.';
+ return pht('Simple styles for displaying text.');
}
public function renderExample() {
- $color1 = 'This is RED. ';
- $color2 = 'This is ORANGE. ';
- $color3 = 'This is YELLOW. ';
- $color4 = 'This is GREEN. ';
- $color5 = 'This is BLUE. ';
- $color6 = 'This is INDIGO. ';
- $color7 = 'This is VIOLET. ';
- $color8 = 'This is WHITE. ';
- $color9 = 'This is BLACK. ';
+ $color1 = pht('This is RED.');
+ $color2 = pht('This is ORANGE.');
+ $color3 = pht('This is YELLOW.');
+ $color4 = pht('This is GREEN.');
+ $color5 = pht('This is BLUE.');
+ $color6 = pht('This is INDIGO.');
+ $color7 = pht('This is VIOLET.');
+ $color8 = pht('This is WHITE.');
+ $color9 = pht('This is BLACK.');
- $text1 = 'This is BOLD. ';
- $text2 = 'This is Uppercase. ';
- $text3 = 'This is Stricken.';
+ $text1 = pht('This is BOLD.');
+ $text2 = pht('This is Uppercase.');
+ $text3 = pht('This is Stricken.');
$content =
array(
@@ -72,7 +72,7 @@
$layout1 = id(new PHUIBoxView())
->appendChild($content)
- ->setBorder(true)
+ ->setBorder(true)
->addPadding(PHUI::PADDING_MEDIUM);
$head1 = id(new PHUIHeaderView())
diff --git a/src/applications/uiexample/examples/PHUITimelineExample.php b/src/applications/uiexample/examples/PHUITimelineExample.php
--- a/src/applications/uiexample/examples/PHUITimelineExample.php
+++ b/src/applications/uiexample/examples/PHUITimelineExample.php
@@ -3,12 +3,13 @@
final class PHUITimelineExample extends PhabricatorUIExample {
public function getName() {
- return 'Timeline View';
+ return pht('Timeline View');
}
public function getDescription() {
- return hsprintf(
- 'Use <tt>PHUITimelineView</tt> to comments and transactions.');
+ return pht(
+ 'Use %s to comments and transactions.',
+ hsprintf('<tt>PHUITimelineView</tt>'));
}
public function renderExample() {
@@ -24,23 +25,23 @@
$events[] = id(new PHUITimelineEventView())
->setUserHandle($handle)
- ->setTitle('A major event.')
- ->appendChild('This is a major timeline event.');
+ ->setTitle(pht('A major event.'))
+ ->appendChild(pht('This is a major timeline event.'));
$events[] = id(new PHUITimelineEventView())
->setUserHandle($handle)
->setIcon('fa-heart')
- ->setTitle('A minor event.');
+ ->setTitle(pht('A minor event.'));
$events[] = id(new PHUITimelineEventView())
->setUserHandle($handle)
->setIcon('fa-comment')
- ->appendChild('A major event with no title.');
+ ->appendChild(pht('A major event with no title.'));
$events[] = id(new PHUITimelineEventView())
->setUserHandle($handle)
->setIcon('fa-star')
- ->setTitle('Another minor event.');
+ ->setTitle(pht('Another minor event.'));
$events[] = id(new PHUITimelineEventView())
->setIcon('fa-trophy')
@@ -54,33 +55,33 @@
$events[] = id(new PHUITimelineEventView())
->setUserHandle($handle)
- ->setTitle('Major Red Event')
+ ->setTitle(pht('Major Red Event'))
->setIcon('fa-heart-o')
- ->appendChild('This event is red!')
+ ->appendChild(pht('This event is red!'))
->setColor(PhabricatorTransactions::COLOR_RED);
$events[] = id(new PHUITimelineEventView())
->setUserHandle($handle)
->setIcon('fa-female')
- ->setTitle('Minor Red Event')
+ ->setTitle(pht('Minor Red Event'))
->setColor(PhabricatorTransactions::COLOR_RED);
$events[] = id(new PHUITimelineEventView())
->setIcon('fa-refresh')
->setUserHandle($handle)
- ->setTitle('Minor Not-Red Event')
+ ->setTitle(pht('Minor Not-Red Event'))
->setColor(PhabricatorTransactions::COLOR_GREEN);
$events[] = id(new PHUITimelineEventView())
->setUserHandle($handle)
->setIcon('fa-calendar-o')
- ->setTitle('Minor Red Event')
+ ->setTitle(pht('Minor Red Event'))
->setColor(PhabricatorTransactions::COLOR_RED);
$events[] = id(new PHUITimelineEventView())
->setUserHandle($handle)
->setIcon('fa-check')
- ->setTitle('Historically Important Action')
+ ->setTitle(pht('Historically Important Action'))
->setColor(PhabricatorTransactions::COLOR_BLACK)
->setReallyMajorEvent(true);
@@ -88,8 +89,8 @@
$events[] = id(new PHUITimelineEventView())
->setUserHandle($handle)
->setIcon('fa-circle-o')
- ->setTitle('Major Green Disagreement Action')
- ->appendChild('This event is green!')
+ ->setTitle(pht('Major Green Disagreement Action'))
+ ->appendChild(pht('This event is green!'))
->setColor(PhabricatorTransactions::COLOR_GREEN);
$events[] = id(new PHUITimelineEventView())
@@ -120,13 +121,13 @@
$events[] = id(new PHUITimelineEventView())
->setUserHandle($handle)
- ->setTitle('Colorless')
+ ->setTitle(pht('Colorless'))
->setIcon('fa-lock');
foreach ($colors as $color) {
$events[] = id(new PHUITimelineEventView())
->setUserHandle($handle)
- ->setTitle("Color '{$color}'")
+ ->setTitle(pht("Color '%s'", $color))
->setIcon('fa-paw')
->setColor($color);
}
diff --git a/src/applications/uiexample/examples/PHUITypeaheadExample.php b/src/applications/uiexample/examples/PHUITypeaheadExample.php
--- a/src/applications/uiexample/examples/PHUITypeaheadExample.php
+++ b/src/applications/uiexample/examples/PHUITypeaheadExample.php
@@ -3,7 +3,7 @@
final class PHUITypeaheadExample extends PhabricatorUIExample {
public function getName() {
- return 'Typeaheads';
+ return pht('Typeaheads');
}
public function getDescription() {
@@ -50,7 +50,7 @@
$output = array();
$output[] = id(new PHUIObjectBoxView())
- ->setHeaderText('Tokens')
+ ->setHeaderText(pht('Tokens'))
->appendChild($token_list);
return $output;
diff --git a/src/applications/uiexample/examples/PhabricatorAphrontBarUIExample.php b/src/applications/uiexample/examples/PhabricatorAphrontBarUIExample.php
--- a/src/applications/uiexample/examples/PhabricatorAphrontBarUIExample.php
+++ b/src/applications/uiexample/examples/PhabricatorAphrontBarUIExample.php
@@ -3,11 +3,11 @@
final class PhabricatorAphrontBarUIExample extends PhabricatorUIExample {
public function getName() {
- return 'Bars';
+ return pht('Bars');
}
public function getDescription() {
- return 'Like fractions, but more horizontal.';
+ return pht('Like fractions, but more horizontal.');
}
public function renderExample() {
diff --git a/src/applications/uiexample/examples/PhabricatorBarePageUIExample.php b/src/applications/uiexample/examples/PhabricatorBarePageUIExample.php
--- a/src/applications/uiexample/examples/PhabricatorBarePageUIExample.php
+++ b/src/applications/uiexample/examples/PhabricatorBarePageUIExample.php
@@ -3,11 +3,11 @@
final class PhabricatorBarePageUIExample extends PhabricatorUIExample {
public function getName() {
- return 'Bare Page';
+ return pht('Bare Page');
}
public function getDescription() {
- return 'This is a bare page.';
+ return pht('This is a bare page.');
}
public function renderExample() {
diff --git a/src/applications/uiexample/examples/PhabricatorBusyUIExample.php b/src/applications/uiexample/examples/PhabricatorBusyUIExample.php
--- a/src/applications/uiexample/examples/PhabricatorBusyUIExample.php
+++ b/src/applications/uiexample/examples/PhabricatorBusyUIExample.php
@@ -3,11 +3,11 @@
final class PhabricatorBusyUIExample extends PhabricatorUIExample {
public function getName() {
- return 'Busy';
+ return pht('Busy');
}
public function getDescription() {
- return 'Busy.';
+ return pht('Busy.');
}
public function renderExample() {
diff --git a/src/applications/uiexample/examples/PhabricatorGestureUIExample.php b/src/applications/uiexample/examples/PhabricatorGestureUIExample.php
--- a/src/applications/uiexample/examples/PhabricatorGestureUIExample.php
+++ b/src/applications/uiexample/examples/PhabricatorGestureUIExample.php
@@ -3,18 +3,18 @@
final class PhabricatorGestureUIExample extends PhabricatorUIExample {
public function getName() {
- return 'Gestures';
+ return pht('Gestures');
}
public function getDescription() {
- return hsprintf(
- 'Use <tt>touchable</tt> to listen for gesture events. Note that you '.
+ return pht(
+ 'Use %s to listen for gesture events. Note that you '.
'must be in device mode for this to work (you can narrow your browser '.
- 'window if you are on a desktop).');
+ 'window if you are on a desktop).',
+ phutil_tag('tt', array(), 'touchable'));
}
public function renderExample() {
-
$id = celerity_generate_unique_node_id();
Javelin::initBehavior(
diff --git a/src/applications/uiexample/examples/PhabricatorHovercardUIExample.php b/src/applications/uiexample/examples/PhabricatorHovercardUIExample.php
--- a/src/applications/uiexample/examples/PhabricatorHovercardUIExample.php
+++ b/src/applications/uiexample/examples/PhabricatorHovercardUIExample.php
@@ -3,12 +3,13 @@
final class PhabricatorHovercardUIExample extends PhabricatorUIExample {
public function getName() {
- return 'Hovercard';
+ return pht('Hovercard');
}
public function getDescription() {
- return hsprintf('Use <tt>PhabricatorHovercardView</tt> to render '.
- 'hovercards. Aren\'t I genius?');
+ return pht(
+ "Use %s to render hovercards. Aren't I genius?",
+ phutil_tag('tt', array(), 'PhabricatorHovercardView'));
}
public function renderExample() {
@@ -20,9 +21,9 @@
$diff_handle = $this->createBasicDummyHandle(
'D123',
DifferentialRevisionPHIDType::TYPECONST,
- 'Introduce cooler Differential Revisions');
+ pht('Introduce cooler Differential Revisions'));
- $panel = $this->createPanel('Differential Hovercard');
+ $panel = $this->createPanel(pht('Differential Hovercard'));
$panel->appendChild(id(new PhabricatorHovercardView())
->setObjectHandle($diff_handle)
->addField(pht('Author'), $user->getUsername())
@@ -34,12 +35,12 @@
$task_handle = $this->createBasicDummyHandle(
'T123',
ManiphestTaskPHIDType::TYPECONST,
- 'Improve Mobile Experience for Phabricator');
+ pht('Improve Mobile Experience for Phabricator'));
$tag = id(new PHUITagView())
->setType(PHUITagView::TYPE_STATE)
- ->setName('Closed, Resolved');
- $panel = $this->createPanel('Maniphest Hovercard');
+ ->setName(pht('Closed, Resolved'));
+ $panel = $this->createPanel(pht('Maniphest Hovercard'));
$panel->appendChild(id(new PhabricatorHovercardView())
->setObjectHandle($task_handle)
->setUser($user)
@@ -56,10 +57,10 @@
'George Washington');
$user_handle->setImageURI(
celerity_get_resource_uri('/rsrc/image/people/washington.png'));
- $panel = $this->createPanel('Whatevery Hovercard');
+ $panel = $this->createPanel(pht('Whatevery Hovercard'));
$panel->appendChild(id(new PhabricatorHovercardView())
->setObjectHandle($user_handle)
- ->addField(pht('Status'), 'Available')
+ ->addField(pht('Status'), pht('Available'))
->addField(pht('Member since'), '30. February 1750')
->addAction(pht('Send a Message'), '/dev/null')
->setUser($user));
diff --git a/src/applications/uiexample/examples/PhabricatorListFilterUIExample.php b/src/applications/uiexample/examples/PhabricatorListFilterUIExample.php
--- a/src/applications/uiexample/examples/PhabricatorListFilterUIExample.php
+++ b/src/applications/uiexample/examples/PhabricatorListFilterUIExample.php
@@ -3,13 +3,14 @@
final class PhabricatorListFilterUIExample extends PhabricatorUIExample {
public function getName() {
- return 'ListFilter';
+ return pht('ListFilter');
}
public function getDescription() {
- return hsprintf(
- 'Use <tt>AphrontListFilterView</tt> to layout controls for filtering '.
- 'and manipulating lists of objects.');
+ return pht(
+ 'Use %s to layout controls for filtering '.
+ 'and manipulating lists of objects.',
+ phutil_tag('tt', array(), 'AphrontListFilterView'));
}
public function renderExample() {
@@ -21,10 +22,10 @@
$form
->appendChild(
id(new AphrontFormTextControl())
- ->setLabel('Query'))
+ ->setLabel(pht('Query')))
->appendChild(
id(new AphrontFormSubmitControl())
- ->setValue('Search'));
+ ->setValue(pht('Search')));
$filter->appendChild($form);
diff --git a/src/applications/uiexample/examples/PhabricatorMultiColumnUIExample.php b/src/applications/uiexample/examples/PhabricatorMultiColumnUIExample.php
--- a/src/applications/uiexample/examples/PhabricatorMultiColumnUIExample.php
+++ b/src/applications/uiexample/examples/PhabricatorMultiColumnUIExample.php
@@ -3,12 +3,13 @@
final class PhabricatorMultiColumnUIExample extends PhabricatorUIExample {
public function getName() {
- return 'Multiple Column Layouts';
+ return pht('Multiple Column Layouts');
}
public function getDescription() {
- return 'A container good for 1-7 equally spaced columns. '.
- 'Fixed and Fluid layouts.';
+ return pht(
+ 'A container good for 1-7 equally spaced columns. '.
+ 'Fixed and Fluid layouts.');
}
public function renderExample() {
@@ -104,27 +105,27 @@
->setFullWidth(true)
->appendChild(
id(new AphrontFormTextControl())
- ->setLabel('Name')
- ->setDisableAutocomplete(true)
+ ->setLabel(pht('Name'))
+ ->setDisableAu4tocomplete(true)
->setSigil('name-input'))
->appendChild(
id(new AphrontFormTextControl())
- ->setLabel('Address')
+ ->setLabel(pht('Address'))
->setDisableAutocomplete(true)
->setSigil('address-input'))
->appendChild(
id(new AphrontFormTextControl())
- ->setLabel('City/State')
+ ->setLabel(pht('City/State'))
->setDisableAutocomplete(true)
->setSigil('city-input'))
->appendChild(
id(new AphrontFormTextControl())
- ->setLabel('Country')
+ ->setLabel(pht('Country'))
->setDisableAutocomplete(true)
->setSigil('country-input'))
->appendChild(
id(new AphrontFormTextControl())
- ->setLabel('Postal Code')
+ ->setLabel(pht('Postal Code'))
->setDisableAutocomplete(true)
->setSigil('postal-input'));
@@ -133,19 +134,19 @@
->setFullWidth(true)
->appendChild(
id(new AphrontFormTextControl())
- ->setLabel('Card Number')
+ ->setLabel(pht('Card Number'))
->setDisableAutocomplete(true)
->setSigil('number-input')
->setError(''))
->appendChild(
id(new AphrontFormTextControl())
- ->setLabel('CVC')
+ ->setLabel(pht('CVC'))
->setDisableAutocomplete(true)
->setSigil('cvc-input')
->setError(''))
->appendChild(
id(new PhortuneMonthYearExpiryControl())
- ->setLabel('Expiration')
+ ->setLabel(pht('Expiration'))
->setUser($user)
->setError(''));
@@ -154,7 +155,7 @@
$cc_title = pht('Payment Information');
$head6 = id(new PHUIHeaderView())
- ->setHeader(pht('Let\'s Go Shopping'));
+ ->setHeader(pht("Let's Go Shopping"));
$layout6 = id(new AphrontMultiColumnView())
->addColumn(hsprintf('<h1>%s</h1>%s', $shipping_title, $shipping))
->addColumn(hsprintf('<h1>%s</h1>%s', $billing_title, $shipping))
diff --git a/src/applications/uiexample/examples/PhabricatorNotificationUIExample.php b/src/applications/uiexample/examples/PhabricatorNotificationUIExample.php
--- a/src/applications/uiexample/examples/PhabricatorNotificationUIExample.php
+++ b/src/applications/uiexample/examples/PhabricatorNotificationUIExample.php
@@ -3,15 +3,16 @@
final class PhabricatorNotificationUIExample extends PhabricatorUIExample {
public function getName() {
- return 'Notifications';
+ return pht('Notifications');
}
public function getDescription() {
- return hsprintf('Use <tt>JX.Notification</tt> to create notifications.');
+ return pht(
+ 'Use %s to create notifications.',
+ phutil_tag('tt', array(), 'JX.Notification'));
}
public function renderExample() {
-
require_celerity_resource('phabricator-notification-css');
Javelin::initBehavior('phabricator-notification-example');
@@ -21,7 +22,7 @@
'sigil' => 'notification-example',
'class' => 'button green',
),
- 'Show Notification');
+ pht('Show Notification'));
$content = hsprintf('<div style="padding: 1em 3em;">%s</div>', $content);
diff --git a/src/applications/uiexample/examples/PhabricatorPagerUIExample.php b/src/applications/uiexample/examples/PhabricatorPagerUIExample.php
--- a/src/applications/uiexample/examples/PhabricatorPagerUIExample.php
+++ b/src/applications/uiexample/examples/PhabricatorPagerUIExample.php
@@ -3,17 +3,17 @@
final class PhabricatorPagerUIExample extends PhabricatorUIExample {
public function getName() {
- return 'Pager';
+ return pht('Pager');
}
public function getDescription() {
- return hsprintf(
- 'Use <tt>AphrontPagerView</tt> to create a control which allows '.
- 'users to paginate through large amounts of content.');
+ return pht(
+ 'Use %s to create a control which allows '.
+ 'users to paginate through large amounts of content.',
+ phutil_tag('tt', array(), 'AphrontPagerView'));
}
public function renderExample() {
-
$request = $this->getRequest();
$offset = (int)$request->getInt('offset');
@@ -37,9 +37,10 @@
$panel->appendChild($table);
$panel->appendChild(hsprintf(
- '<p class="phabricator-ui-example-note">'.
- 'Use <tt>AphrontPagerView</tt> to render a pager element.'.
- '</p>'));
+ '<p class="phabricator-ui-example-note">%s</p>',
+ pht(
+ 'Use %s to render a pager element.',
+ phutil_tag('tt', array(), 'AphrontPagerView'))));
$pager = new AphrontPagerView();
$pager->setPageSize($page_size);
@@ -49,9 +50,8 @@
$panel->appendChild($pager);
$panel->appendChild(hsprintf(
- '<p class="phabricator-ui-example-note">'.
- 'You can show more or fewer pages of surrounding context.'.
- '</p>'));
+ '<p class="phabricator-ui-example-note">%s</p>',
+ pht('You can show more or fewer pages of surrounding context.')));
$many_pages_pager = new AphrontPagerView();
$many_pages_pager->setPageSize($page_size);
@@ -62,11 +62,12 @@
$panel->appendChild($many_pages_pager);
$panel->appendChild(hsprintf(
- '<p class="phabricator-ui-example-note">'.
+ '<p class="phabricator-ui-example-note">%s</p>',
+ pht(
'When it is prohibitively expensive or complex to attain a complete '.
'count of the items, you can select one extra item and set '.
- '<tt>hasMorePages(true)</tt> if it exists, creating an inexact pager.'.
- '</p>'));
+ '%s if it exists, creating an inexact pager.',
+ phutil_tag('tt', array(), 'hasMorePages(true)'))));
$inexact_pager = new AphrontPagerView();
$inexact_pager->setPageSize($page_size);
diff --git a/src/applications/uiexample/examples/PhabricatorSetupIssueUIExample.php b/src/applications/uiexample/examples/PhabricatorSetupIssueUIExample.php
--- a/src/applications/uiexample/examples/PhabricatorSetupIssueUIExample.php
+++ b/src/applications/uiexample/examples/PhabricatorSetupIssueUIExample.php
@@ -3,11 +3,11 @@
final class PhabricatorSetupIssueUIExample extends PhabricatorUIExample {
public function getName() {
- return 'Setup Issue';
+ return pht('Setup Issue');
}
public function getDescription() {
- return 'Setup errors and warnings.';
+ return pht('Setup errors and warnings.');
}
public function renderExample() {
diff --git a/src/applications/uiexample/examples/PhabricatorSortTableUIExample.php b/src/applications/uiexample/examples/PhabricatorSortTableUIExample.php
--- a/src/applications/uiexample/examples/PhabricatorSortTableUIExample.php
+++ b/src/applications/uiexample/examples/PhabricatorSortTableUIExample.php
@@ -3,11 +3,11 @@
final class PhabricatorSortTableUIExample extends PhabricatorUIExample {
public function getName() {
- return 'Sortable Tables';
+ return pht('Sortable Tables');
}
public function getDescription() {
- return 'Using sortable tables.';
+ return pht('Using sortable tables.');
}
public function renderExample() {
@@ -66,11 +66,11 @@
$table = new AphrontTableView($rows);
$table->setHeaders(
array(
- 'Make',
- 'Model',
- 'Year',
- 'Price',
- 'Color',
+ pht('Make'),
+ pht('Model'),
+ pht('Year'),
+ pht('Price'),
+ pht('Color'),
));
$table->setColumnClasses(
array(
@@ -88,7 +88,7 @@
$orders);
$panel = new PHUIObjectBoxView();
- $panel->setHeaderText('Sortable Table of Vehicles');
+ $panel->setHeaderText(pht('Sortable Table of Vehicles'));
$panel->appendChild($table);
return $panel;
diff --git a/src/applications/uiexample/examples/PhabricatorStatusUIExample.php b/src/applications/uiexample/examples/PhabricatorStatusUIExample.php
--- a/src/applications/uiexample/examples/PhabricatorStatusUIExample.php
+++ b/src/applications/uiexample/examples/PhabricatorStatusUIExample.php
@@ -3,16 +3,16 @@
final class PhabricatorStatusUIExample extends PhabricatorUIExample {
public function getName() {
- return 'Status List';
+ return pht('Status List');
}
public function getDescription() {
- return hsprintf(
- 'Use <tt>PHUIStatusListView</tt> to show relationships with objects.');
+ return pht(
+ 'Use %s to show relationships with objects.',
+ phutil_tag('tt', array(), 'PHUIStatusListView'));
}
public function renderExample() {
-
$out = array();
$view = new PHUIStatusListView();
diff --git a/src/applications/uiexample/examples/PhabricatorTooltipUIExample.php b/src/applications/uiexample/examples/PhabricatorTooltipUIExample.php
--- a/src/applications/uiexample/examples/PhabricatorTooltipUIExample.php
+++ b/src/applications/uiexample/examples/PhabricatorTooltipUIExample.php
@@ -3,11 +3,13 @@
final class PhabricatorTooltipUIExample extends PhabricatorUIExample {
public function getName() {
- return 'Tooltips';
+ return pht('Tooltips');
}
public function getDescription() {
- return hsprintf('Use <tt>JX.Tooltip</tt> to create tooltips.');
+ return pht(
+ 'Use %s to create tooltips.',
+ phutil_tag('tt', array(), 'JX.Tooltip'));
}
public function renderExample() {
diff --git a/src/applications/uiexample/examples/PhabricatorTwoColumnUIExample.php b/src/applications/uiexample/examples/PhabricatorTwoColumnUIExample.php
--- a/src/applications/uiexample/examples/PhabricatorTwoColumnUIExample.php
+++ b/src/applications/uiexample/examples/PhabricatorTwoColumnUIExample.php
@@ -3,11 +3,11 @@
final class PhabricatorTwoColumnUIExample extends PhabricatorUIExample {
public function getName() {
- return 'Two Column Layout';
+ return pht('Two Column Layout');
}
public function getDescription() {
- return 'Two Column mobile friendly layout';
+ return pht('Two Column mobile friendly layout');
}
public function renderExample() {
diff --git a/src/applications/uiexample/examples/PhabricatorUIExample.php b/src/applications/uiexample/examples/PhabricatorUIExample.php
--- a/src/applications/uiexample/examples/PhabricatorUIExample.php
+++ b/src/applications/uiexample/examples/PhabricatorUIExample.php
@@ -29,10 +29,11 @@
if ($fullname) {
$handle->setFullName($fullname);
} else {
- $handle->setFullName(sprintf('%s%d: %s',
- substr($type, 0, 1),
- $id,
- $name));
+ $handle->setFullName(
+ sprintf('%s%d: %s',
+ substr($type, 0, 1),
+ $id,
+ $name));
}
if ($uri) {
diff --git a/src/applications/xhprof/view/PhabricatorXHProfProfileTopLevelView.php b/src/applications/xhprof/view/PhabricatorXHProfProfileTopLevelView.php
--- a/src/applications/xhprof/view/PhabricatorXHProfProfileTopLevelView.php
+++ b/src/applications/xhprof/view/PhabricatorXHProfProfileTopLevelView.php
@@ -89,26 +89,28 @@
array(
'sigil' => 'has-tooltip',
'meta' => array(
- 'tip' => pht('Total wall time spent in this function and all of '.
- 'its children (children are other functions it called '.
- 'while executing).'),
+ 'tip' => pht(
+ 'Total wall time spent in this function and all of '.
+ 'its children (children are other functions it called '.
+ 'while executing).'),
'size' => 200,
),
),
- 'Wall Time (Inclusive)'),
+ pht('Wall Time (Inclusive)')),
'%',
javelin_tag(
'span',
array(
'sigil' => 'has-tooltip',
'meta' => array(
- 'tip' => pht('Wall time spent in this function, excluding time '.
- 'spent in children (children are other functions it '.
- 'called while executing).'),
+ 'tip' => pht(
+ 'Wall time spent in this function, excluding time '.
+ 'spent in children (children are other functions it '.
+ 'called while executing).'),
'size' => 200,
),
),
- 'Wall Time (Exclusive)'),
+ pht('Wall Time (Exclusive)')),
'%',
));
$table->setColumnClasses(
@@ -128,7 +130,7 @@
if ($this->file) {
$button = id(new PHUIButtonView())
->setHref($this->file->getBestURI())
- ->setText(pht('Download .xhprof Profile'))
+ ->setText(pht('Download %s Profile', '.xhprof'))
->setTag('a');
$header->addActionLink($button);
}
diff --git a/src/infrastructure/customfield/exception/PhabricatorCustomFieldDataNotAvailableException.php b/src/infrastructure/customfield/exception/PhabricatorCustomFieldDataNotAvailableException.php
--- a/src/infrastructure/customfield/exception/PhabricatorCustomFieldDataNotAvailableException.php
+++ b/src/infrastructure/customfield/exception/PhabricatorCustomFieldDataNotAvailableException.php
@@ -1,16 +1,15 @@
<?php
-final class PhabricatorCustomFieldDataNotAvailableException
- extends Exception {
+final class PhabricatorCustomFieldDataNotAvailableException extends Exception {
public function __construct(PhabricatorCustomField $field) {
- $key = $field->getFieldKey();
- $name = $field->getFieldName();
- $class = get_class($field);
-
parent::__construct(
- "Custom field '{$name}' (with key '{$key}', of class '{$class}') is ".
- "attempting to access data which is not available in this context.");
+ pht(
+ "Custom field '%s' (with key '%s', of class '%s') is attempting ".
+ "to access data which is not available in this context.",
+ $field->getFieldName(),
+ $field->getFieldKey(),
+ get_class($field)));
}
}
diff --git a/src/infrastructure/customfield/exception/PhabricatorCustomFieldNotProxyException.php b/src/infrastructure/customfield/exception/PhabricatorCustomFieldNotProxyException.php
--- a/src/infrastructure/customfield/exception/PhabricatorCustomFieldNotProxyException.php
+++ b/src/infrastructure/customfield/exception/PhabricatorCustomFieldNotProxyException.php
@@ -1,17 +1,18 @@
<?php
-final class PhabricatorCustomFieldNotProxyException
- extends Exception {
+final class PhabricatorCustomFieldNotProxyException extends Exception {
public function __construct(PhabricatorCustomField $field) {
- $key = $field->getFieldKey();
- $name = $field->getFieldName();
- $class = get_class($field);
-
parent::__construct(
- "Custom field '{$name}' (with key '{$key}', of class '{$class}') can ".
- "not have a proxy set with setProxy(), because it returned false from ".
- "canSetProxy().");
+ pht(
+ "Custom field '%s' (with key '%s', of class '%s') can not have a ".
+ "proxy set with %s, because it returned %s from %s.",
+ $field->getFieldName(),
+ $field->getFieldKey(),
+ get_class($field),
+ 'setProxy()',
+ 'false',
+ 'canSetProxy()'));
}
}
diff --git a/src/infrastructure/customfield/field/PhabricatorCustomFieldList.php b/src/infrastructure/customfield/field/PhabricatorCustomFieldList.php
--- a/src/infrastructure/customfield/field/PhabricatorCustomFieldList.php
+++ b/src/infrastructure/customfield/field/PhabricatorCustomFieldList.php
@@ -147,8 +147,12 @@
break;
default:
throw new Exception(
- "Unknown field property view style '{$style}'; valid styles are ".
- "'block' and 'property'.");
+ pht(
+ "Unknown field property view style '%s'; valid styles are ".
+ "'%s' and '%s'.",
+ $style,
+ 'block',
+ 'property'));
}
}
$fields = $head + $tail;
diff --git a/src/infrastructure/customfield/storage/PhabricatorCustomFieldIndexStorage.php b/src/infrastructure/customfield/storage/PhabricatorCustomFieldIndexStorage.php
--- a/src/infrastructure/customfield/storage/PhabricatorCustomFieldIndexStorage.php
+++ b/src/infrastructure/customfield/storage/PhabricatorCustomFieldIndexStorage.php
@@ -1,7 +1,6 @@
<?php
-abstract class PhabricatorCustomFieldIndexStorage
- extends PhabricatorLiskDAO {
+abstract class PhabricatorCustomFieldIndexStorage extends PhabricatorLiskDAO {
protected $objectPHID;
protected $indexKey;
diff --git a/src/infrastructure/daemon/bot/PhabricatorBot.php b/src/infrastructure/daemon/bot/PhabricatorBot.php
--- a/src/infrastructure/daemon/bot/PhabricatorBot.php
+++ b/src/infrastructure/daemon/bot/PhabricatorBot.php
@@ -19,7 +19,7 @@
protected function run() {
$argv = $this->getArgv();
if (count($argv) !== 1) {
- throw new Exception('usage: PhabricatorBot <json_config_file>');
+ throw new Exception(pht('Usage: %s %s', __CLASS__, '<json_config_file>'));
}
$json_raw = Filesystem::readFile($argv[0]);
@@ -151,8 +151,12 @@
public function getConduit() {
if (empty($this->conduit)) {
throw new Exception(
- "This bot is not configured with a Conduit uplink. Set 'conduit.uri', ".
- "'conduit.user' and 'conduit.cert' in the configuration to connect.");
+ pht(
+ "This bot is not configured with a Conduit uplink. Set '%s', ".
+ "'%s' and '%s' in the configuration to connect.",
+ 'conduit.uri',
+ 'conduit.user',
+ 'conduit.cert'));
}
return $this->conduit;
}
diff --git a/src/infrastructure/daemon/bot/adapter/PhabricatorIRCProtocolAdapter.php b/src/infrastructure/daemon/bot/adapter/PhabricatorIRCProtocolAdapter.php
--- a/src/infrastructure/daemon/bot/adapter/PhabricatorIRCProtocolAdapter.php
+++ b/src/infrastructure/daemon/bot/adapter/PhabricatorIRCProtocolAdapter.php
@@ -33,7 +33,9 @@
if (!preg_match('/^[A-Za-z0-9_`[{}^|\]\\-]+$/', $nick)) {
throw new Exception(
- "Nickname '{$nick}' is invalid!");
+ pht(
+ "Nickname '%s' is invalid!",
+ $nick));
}
$errno = null;
@@ -44,11 +46,11 @@
$socket = fsockopen('ssl://'.$server, $port, $errno, $error);
}
if (!$socket) {
- throw new Exception("Failed to connect, #{$errno}: {$error}");
+ throw new Exception(pht('Failed to connect, #%d: %s', $errno, $error));
}
$ok = stream_set_blocking($socket, false);
if (!$ok) {
- throw new Exception('Failed to set stream nonblocking.');
+ throw new Exception(pht('Failed to set stream nonblocking.'));
}
$this->socket = $socket;
@@ -77,7 +79,7 @@
// was most likely because we were signaled.
$ok = @stream_select($read, $write, $except, $timeout_sec = 0);
if ($ok === false) {
- throw new Exception('stream_select() failed!');
+ throw new Exception(pht('%s failed!', 'stream_select()'));
}
}
@@ -88,12 +90,12 @@
// This indicates the connection was terminated on the other side,
// just exit via exception and let the overseer restart us after a
// delay so we can reconnect.
- throw new Exception('Remote host closed connection.');
+ throw new Exception(pht('Remote host closed connection.'));
}
do {
$data = fread($this->socket, 4096);
if ($data === false) {
- throw new Exception('fread() failed!');
+ throw new Exception(pht('%s failed!', 'fread()'));
} else {
$messages[] = id(new PhabricatorBotMessage())
->setCommand('LOG')
@@ -107,7 +109,7 @@
do {
$len = fwrite($this->socket, $this->writeBuffer);
if ($len === false) {
- throw new Exception('fwrite() failed!');
+ throw new Exception(pht('%s failed!', 'fwrite()'));
} else if ($len === 0) {
break;
} else {
diff --git a/src/infrastructure/daemon/bot/handler/PhabricatorBotDebugLogHandler.php b/src/infrastructure/daemon/bot/handler/PhabricatorBotDebugLogHandler.php
--- a/src/infrastructure/daemon/bot/handler/PhabricatorBotDebugLogHandler.php
+++ b/src/infrastructure/daemon/bot/handler/PhabricatorBotDebugLogHandler.php
@@ -1,7 +1,7 @@
<?php
/**
- * Logs messages to stdout
+ * Logs messages to stdout.
*/
final class PhabricatorBotDebugLogHandler extends PhabricatorBotHandler {
public function receiveMessage(PhabricatorBotMessage $message) {
diff --git a/src/infrastructure/daemon/bot/handler/PhabricatorBotWhatsNewHandler.php b/src/infrastructure/daemon/bot/handler/PhabricatorBotWhatsNewHandler.php
--- a/src/infrastructure/daemon/bot/handler/PhabricatorBotWhatsNewHandler.php
+++ b/src/infrastructure/daemon/bot/handler/PhabricatorBotWhatsNewHandler.php
@@ -1,7 +1,7 @@
<?php
/**
- * Responds to "Whats new?" with some recent feed content
+ * Responds to "Whats new?" with some recent feed content.
*/
final class PhabricatorBotWhatsNewHandler extends PhabricatorBotHandler {
diff --git a/src/infrastructure/daemon/workers/clock/PhabricatorMetronomicTriggerClock.php b/src/infrastructure/daemon/workers/clock/PhabricatorMetronomicTriggerClock.php
--- a/src/infrastructure/daemon/workers/clock/PhabricatorMetronomicTriggerClock.php
+++ b/src/infrastructure/daemon/workers/clock/PhabricatorMetronomicTriggerClock.php
@@ -6,8 +6,7 @@
*
* For example, this clock can trigger an event every 30 seconds.
*/
-final class PhabricatorMetronomicTriggerClock
- extends PhabricatorTriggerClock {
+final class PhabricatorMetronomicTriggerClock extends PhabricatorTriggerClock {
public function validateProperties(array $properties) {
PhutilTypeSpec::checkMap(
diff --git a/src/infrastructure/daemon/workers/clock/PhabricatorNeverTriggerClock.php b/src/infrastructure/daemon/workers/clock/PhabricatorNeverTriggerClock.php
--- a/src/infrastructure/daemon/workers/clock/PhabricatorNeverTriggerClock.php
+++ b/src/infrastructure/daemon/workers/clock/PhabricatorNeverTriggerClock.php
@@ -5,8 +5,7 @@
*
* This clock can be used for testing, or to cancel events.
*/
-final class PhabricatorNeverTriggerClock
- extends PhabricatorTriggerClock {
+final class PhabricatorNeverTriggerClock extends PhabricatorTriggerClock {
public function validateProperties(array $properties) {
PhutilTypeSpec::checkMap(
diff --git a/src/infrastructure/daemon/workers/management/PhabricatorWorkerTriggerManagementWorkflow.php b/src/infrastructure/daemon/workers/management/PhabricatorWorkerTriggerManagementWorkflow.php
--- a/src/infrastructure/daemon/workers/management/PhabricatorWorkerTriggerManagementWorkflow.php
+++ b/src/infrastructure/daemon/workers/management/PhabricatorWorkerTriggerManagementWorkflow.php
@@ -18,7 +18,7 @@
$ids = $args->getArg('id');
if (!$ids) {
throw new PhutilArgumentUsageException(
- pht('Use --id to select triggers by ID.'));
+ pht('Use %s to select triggers by ID.', '--id'));
}
$triggers = id(new PhabricatorWorkerTriggerQuery())
diff --git a/src/infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php b/src/infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php
--- a/src/infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php
+++ b/src/infrastructure/daemon/workers/query/PhabricatorWorkerLeaseQuery.php
@@ -75,15 +75,17 @@
public function execute() {
if (!$this->limit) {
throw new Exception(
- pht('You must setLimit() when leasing tasks.'));
+ pht('You must %s when leasing tasks.', 'setLimit()'));
}
if ($this->leased !== false) {
if (!$this->skipLease) {
throw new Exception(
pht(
- 'If you potentially select leased tasks using withLeasedTasks(), '.
- 'you MUST disable lease acquisition by calling setSkipLease().'));
+ 'If you potentially select leased tasks using %s, '.
+ 'you MUST disable lease acquisition by calling %s.',
+ 'withLeasedTasks()',
+ 'setSkipLease()'));
}
}
@@ -253,7 +255,7 @@
throw new Exception(
pht(
'Trying to lease tasks selected in the leased phase! This is '.
- 'intended to be imposssible.'));
+ 'intended to be impossible.'));
case self::PHASE_UNLEASED:
$where[] = qsprintf($conn_w, 'leaseOwner IS NULL');
$where[] = qsprintf($conn_w, 'id IN (%Ld)', ipull($rows, 'id'));
@@ -270,7 +272,7 @@
$where[] = qsprintf($conn_w, '(%Q)', implode(' OR ', $in));
break;
default:
- throw new Exception("Unknown phase '{$phase}'!");
+ throw new Exception(pht('Unknown phase "%s"!', $phase));
}
return $this->formatWhereClause($where);
diff --git a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php
--- a/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php
+++ b/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php
@@ -89,24 +89,27 @@
if ($this->leaseOwner) {
$current_server_time = $this->serverTime + (time() - $this->localTime);
if ($current_server_time >= $this->leaseExpires) {
- $id = $this->getID();
- $class = $this->getTaskClass();
throw new Exception(
- "Trying to update Task {$id} ({$class}) after lease expiration!");
+ pht(
+ 'Trying to update Task %d (%s) after lease expiration!',
+ $this->getID(),
+ $this->getTaskClass()));
}
}
}
public function delete() {
throw new Exception(
- 'Active tasks can not be deleted directly. '.
- 'Use archiveTask() to move tasks to the archive.');
+ pht(
+ 'Active tasks can not be deleted directly. '.
+ 'Use %s to move tasks to the archive.',
+ 'archiveTask()'));
}
public function archiveTask($result, $duration) {
if ($this->getID() === null) {
throw new Exception(
- "Attempting to archive a task which hasn't been save()d!");
+ pht("Attempting to archive a task which hasn't been saved!"));
}
$this->checkLease();
@@ -142,10 +145,11 @@
$maximum_failures = $worker->getMaximumRetryCount();
if ($maximum_failures !== null) {
if ($this->getFailureCount() > $maximum_failures) {
- $id = $this->getID();
throw new PhabricatorWorkerPermanentFailureException(
- "Task {$id} has exceeded the maximum number of failures ".
- "({$maximum_failures}).");
+ pht(
+ 'Task % has exceeded the maximum number of failures (%d).',
+ $this->getID(),
+ $maximum_failures));
}
}
diff --git a/src/infrastructure/diff/view/PHUIDiffInlineCommentEditView.php b/src/infrastructure/diff/view/PHUIDiffInlineCommentEditView.php
--- a/src/infrastructure/diff/view/PHUIDiffInlineCommentEditView.php
+++ b/src/infrastructure/diff/view/PHUIDiffInlineCommentEditView.php
@@ -76,10 +76,18 @@
public function render() {
if (!$this->uri) {
- throw new Exception('Call setSubmitURI() before render()!');
+ throw new Exception(
+ pht(
+ 'Call %s before %s!',
+ 'setSubmitURI()',
+ __FUNCTION__.'()'));
}
if (!$this->user) {
- throw new Exception('Call setUser() before render()!');
+ throw new Exception(
+ pht(
+ 'Call %s before %s!',
+ 'setUser()',
+ __FUNCTION__.'()'));
}
$content = phabricator_form(
diff --git a/src/infrastructure/edges/type/PhabricatorEdgeType.php b/src/infrastructure/edges/type/PhabricatorEdgeType.php
--- a/src/infrastructure/edges/type/PhabricatorEdgeType.php
+++ b/src/infrastructure/edges/type/PhabricatorEdgeType.php
@@ -18,16 +18,20 @@
if ($const === false) {
throw new Exception(
pht(
- 'EdgeType class "%s" must define an EDGECONST property.',
- get_class($this)));
+ '%s class "%s" must define an %s property.',
+ __CLASS__,
+ get_class($this),
+ 'EDGECONST'));
}
if (!is_int($const) || ($const <= 0)) {
throw new Exception(
pht(
- 'EdgeType class "%s" has an invalid EDGECONST property. Edge '.
- 'constants must be positive integers.',
- get_class($this)));
+ '%s class "%s" has an invalid %s property. '.
+ 'Edge constants must be positive integers.',
+ __CLASS__,
+ get_class($this),
+ 'EDGECONST'));
}
return $const;
diff --git a/src/infrastructure/edges/util/PhabricatorEdgeGraph.php b/src/infrastructure/edges/util/PhabricatorEdgeGraph.php
--- a/src/infrastructure/edges/util/PhabricatorEdgeGraph.php
+++ b/src/infrastructure/edges/util/PhabricatorEdgeGraph.php
@@ -11,7 +11,7 @@
protected function loadEdges(array $nodes) {
if (!$this->edgeType) {
- throw new Exception('Set edge type before loading graph!');
+ throw new Exception(pht('Set edge type before loading graph!'));
}
$edges = id(new PhabricatorEdgeQuery())
diff --git a/src/infrastructure/env/PhabricatorConfigFileSource.php b/src/infrastructure/env/PhabricatorConfigFileSource.php
--- a/src/infrastructure/env/PhabricatorConfigFileSource.php
+++ b/src/infrastructure/env/PhabricatorConfigFileSource.php
@@ -2,10 +2,9 @@
/**
* Configuration source which reads from a configuration file on disk (a
- * PHP file in the conf/ directory). This source
+ * PHP file in the `conf/` directory).
*/
-final class PhabricatorConfigFileSource
- extends PhabricatorConfigProxySource {
+final class PhabricatorConfigFileSource extends PhabricatorConfigProxySource {
/**
* @phutil-external-symbol function phabricator_read_config_file
diff --git a/src/infrastructure/env/PhabricatorConfigLocalSource.php b/src/infrastructure/env/PhabricatorConfigLocalSource.php
--- a/src/infrastructure/env/PhabricatorConfigLocalSource.php
+++ b/src/infrastructure/env/PhabricatorConfigLocalSource.php
@@ -1,7 +1,6 @@
<?php
-final class PhabricatorConfigLocalSource
- extends PhabricatorConfigProxySource {
+final class PhabricatorConfigLocalSource extends PhabricatorConfigProxySource {
public function __construct() {
$config = $this->loadConfig();
diff --git a/src/infrastructure/env/PhabricatorConfigStackSource.php b/src/infrastructure/env/PhabricatorConfigStackSource.php
--- a/src/infrastructure/env/PhabricatorConfigStackSource.php
+++ b/src/infrastructure/env/PhabricatorConfigStackSource.php
@@ -19,7 +19,7 @@
public function popSource() {
if (empty($this->stack)) {
- throw new Exception('Popping an empty config stack!');
+ throw new Exception(pht('Popping an empty %s!', __CLASS__));
}
return array_shift($this->stack);
}
diff --git a/src/infrastructure/env/__tests__/PhabricatorEnvTestCase.php b/src/infrastructure/env/__tests__/PhabricatorEnvTestCase.php
--- a/src/infrastructure/env/__tests__/PhabricatorEnvTestCase.php
+++ b/src/infrastructure/env/__tests__/PhabricatorEnvTestCase.php
@@ -20,7 +20,7 @@
$this->assertEqual(
$expect,
PhabricatorEnv::isValidLocalURIForLink($uri),
- "Valid local resource: {$uri}");
+ pht('Valid local resource: %s', $uri));
}
}
@@ -37,7 +37,7 @@
$this->assertEqual(
$expect,
PhabricatorEnv::isValidRemoteURIForLink($uri),
- "Valid linkable remote URI: {$uri}");
+ pht('Valid linkable remote URI: %s', $uri));
}
}
@@ -78,7 +78,7 @@
$this->assertEqual(
$expect,
PhabricatorEnv::isValidRemoteURIForFetch($uri, $protocols),
- "Valid fetchable remote URI: {$uri}");
+ pht('Valid fetchable remote URI: %s', $uri));
}
}
@@ -185,8 +185,9 @@
$this->assertTrue(
$caught instanceof Exception,
- 'Destroying a scoped environment which is not on the top of the stack '.
- 'should throw.');
+ pht(
+ 'Destroying a scoped environment which is not on the top of the '.
+ 'stack should throw.'));
if (phutil_is_hiphop_runtime()) {
$inner->__destruct();
diff --git a/src/infrastructure/events/PhabricatorEventEngine.php b/src/infrastructure/events/PhabricatorEventEngine.php
--- a/src/infrastructure/events/PhabricatorEventEngine.php
+++ b/src/infrastructure/events/PhabricatorEventEngine.php
@@ -23,7 +23,7 @@
}
}
- // Add builtin listeners.
+ // Add built-in listeners.
$listeners[] = new DarkConsoleEventPluginAPI();
// Add application listeners.
diff --git a/src/infrastructure/events/PhabricatorExampleEventListener.php b/src/infrastructure/events/PhabricatorExampleEventListener.php
--- a/src/infrastructure/events/PhabricatorExampleEventListener.php
+++ b/src/infrastructure/events/PhabricatorExampleEventListener.php
@@ -21,8 +21,11 @@
$console = PhutilConsole::getConsole();
$console->writeOut(
- "PhabricatorExampleEventListener got test event at %d\n",
- $event->getValue('time'));
+ "%s\n",
+ pht(
+ '%s got test event at %d',
+ __CLASS__,
+ $event->getValue('time')));
}
}
diff --git a/src/infrastructure/internationalization/translation/PhabricatorBritishEnglishTranslation.php b/src/infrastructure/internationalization/translation/PhabricatorBritishEnglishTranslation.php
--- a/src/infrastructure/internationalization/translation/PhabricatorBritishEnglishTranslation.php
+++ b/src/infrastructure/internationalization/translation/PhabricatorBritishEnglishTranslation.php
@@ -9,8 +9,8 @@
protected function getTranslations() {
return array(
- '%s set this project\'s color to %s.' =>
- '%s set this project\'s colour to %s.',
+ "%s set this project's color to %s." =>
+ "%s set this project's colour to %s.",
'Basic Colors' =>
'Basic Colours',
'Choose Icon and Color...' =>
diff --git a/src/infrastructure/markup/PhabricatorMarkupEngine.php b/src/infrastructure/markup/PhabricatorMarkupEngine.php
--- a/src/infrastructure/markup/PhabricatorMarkupEngine.php
+++ b/src/infrastructure/markup/PhabricatorMarkupEngine.php
@@ -190,12 +190,17 @@
private function requireKeyProcessed($key) {
if (empty($this->objects[$key])) {
throw new Exception(
- "Call addObject() before using results (key = '{$key}').");
+ pht(
+ "Call %s before using results (key = '%s').",
+ 'addObject()',
+ $key));
}
if (!isset($this->objects[$key]['output'])) {
throw new Exception(
- 'Call process() before using results.');
+ pht(
+ 'Call %s before using results.',
+ 'process()'));
}
}
@@ -417,7 +422,7 @@
$engine->setConfig('pygments.enabled', false);
break;
default:
- throw new Exception("Unknown engine ruleset: {$ruleset}!");
+ throw new Exception(pht('Unknown engine ruleset: %s!', $ruleset));
}
$engines[$ruleset] = $engine;
@@ -448,7 +453,6 @@
* @task engine
*/
public static function newMarkupEngine(array $options) {
-
$options += self::getMarkupEngineDefaultConfiguration();
$engine = new PhutilRemarkupEngine();
diff --git a/src/infrastructure/markup/interpreter/PhabricatorRemarkupCowsayBlockInterpreter.php b/src/infrastructure/markup/interpreter/PhabricatorRemarkupCowsayBlockInterpreter.php
--- a/src/infrastructure/markup/interpreter/PhabricatorRemarkupCowsayBlockInterpreter.php
+++ b/src/infrastructure/markup/interpreter/PhabricatorRemarkupCowsayBlockInterpreter.php
@@ -10,7 +10,9 @@
public function markupContent($content, array $argv) {
if (!Filesystem::binaryExists('cowsay')) {
return $this->markupError(
- pht('Unable to locate the `cowsay` binary. Install cowsay.'));
+ pht(
+ 'Unable to locate the `%s` binary. Install cowsay.',
+ 'cowsay'));
}
$bin = idx($argv, 'think') ? 'cowthink' : 'cowsay';
diff --git a/src/infrastructure/query/order/PhabricatorQueryOrderItem.php b/src/infrastructure/query/order/PhabricatorQueryOrderItem.php
--- a/src/infrastructure/query/order/PhabricatorQueryOrderItem.php
+++ b/src/infrastructure/query/order/PhabricatorQueryOrderItem.php
@@ -15,8 +15,7 @@
* This class is primarily internal to the query infrastructure, and most
* application code should not need to interact with it directly.
*/
-final class PhabricatorQueryOrderItem
- extends Phobject {
+final class PhabricatorQueryOrderItem extends Phobject {
private $orderKey;
private $isReversed;
diff --git a/src/infrastructure/sms/management/PhabricatorSMSManagementListOutboundWorkflow.php b/src/infrastructure/sms/management/PhabricatorSMSManagementListOutboundWorkflow.php
--- a/src/infrastructure/sms/management/PhabricatorSMSManagementListOutboundWorkflow.php
+++ b/src/infrastructure/sms/management/PhabricatorSMSManagementListOutboundWorkflow.php
@@ -6,17 +6,16 @@
protected function didConstruct() {
$this
->setName('list-outbound')
- ->setSynopsis('List outbound sms messages sent by Phabricator.')
- ->setExamples(
- '**list-outbound**')
+ ->setSynopsis(pht('List outbound SMS messages sent by Phabricator.'))
+ ->setExamples('**list-outbound**')
->setArguments(
array(
array(
'name' => 'limit',
'param' => 'N',
'default' => 100,
- 'help' =>
- 'Show a specific number of sms messages (default 100).',
+ 'help' => pht(
+ 'Show a specific number of SMS messages (default 100).'),
),
));
}
@@ -30,15 +29,15 @@
$args->getArg('limit'));
if (!$sms_messages) {
- $console->writeErr("%s\n", pht('No sent sms.'));
+ $console->writeErr("%s\n", pht('No sent SMS.'));
return 0;
}
$table = id(new PhutilConsoleTable())
->setShowHeader(false)
- ->addColumn('id', array('title' => 'ID'))
- ->addColumn('status', array('title' => 'Status'))
- ->addColumn('recv', array('title' => 'Recipient'));
+ ->addColumn('id', array('title' => pht('ID')))
+ ->addColumn('status', array('title' => pht('Status')))
+ ->addColumn('recv', array('title' => pht('Recipient')));
foreach (array_reverse($sms_messages) as $sms) {
$table->addRow(array(
diff --git a/src/infrastructure/sms/management/PhabricatorSMSManagementSendTestWorkflow.php b/src/infrastructure/sms/management/PhabricatorSMSManagementSendTestWorkflow.php
--- a/src/infrastructure/sms/management/PhabricatorSMSManagementSendTestWorkflow.php
+++ b/src/infrastructure/sms/management/PhabricatorSMSManagementSendTestWorkflow.php
@@ -8,22 +8,21 @@
->setName('send-test')
->setSynopsis(
pht(
- 'Simulate sending an sms. This may be useful to test your sms '.
- 'configuration, or while developing new sms adapters.'))
- ->setExamples(
- "**send-test** --to 12345678 --body 'pizza time yet?'")
+ 'Simulate sending an SMS. This may be useful to test your SMS '.
+ 'configuration, or while developing new SMS adapters.'))
+ ->setExamples("**send-test** --to 12345678 --body 'pizza time yet?'")
->setArguments(
array(
array(
'name' => 'to',
'param' => 'number',
- 'help' => 'Send sms "To:" the specified number.',
+ 'help' => pht('Send SMS "To:" the specified number.'),
'repeat' => true,
),
array(
'name' => 'body',
'param' => 'text',
- 'help' => 'Send sms with the specified body.',
+ 'help' => pht('Send SMS with the specified body.'),
),
));
}
diff --git a/src/infrastructure/sms/worker/PhabricatorSMSDemultiplexWorker.php b/src/infrastructure/sms/worker/PhabricatorSMSDemultiplexWorker.php
--- a/src/infrastructure/sms/worker/PhabricatorSMSDemultiplexWorker.php
+++ b/src/infrastructure/sms/worker/PhabricatorSMSDemultiplexWorker.php
@@ -1,7 +1,6 @@
<?php
-final class PhabricatorSMSDemultiplexWorker
- extends PhabricatorSMSWorker {
+final class PhabricatorSMSDemultiplexWorker extends PhabricatorSMSWorker {
protected function doWork() {
$viewer = PhabricatorUser::getOmnipotentUser();
diff --git a/src/infrastructure/sms/worker/PhabricatorSMSSendWorker.php b/src/infrastructure/sms/worker/PhabricatorSMSSendWorker.php
--- a/src/infrastructure/sms/worker/PhabricatorSMSSendWorker.php
+++ b/src/infrastructure/sms/worker/PhabricatorSMSSendWorker.php
@@ -1,7 +1,6 @@
<?php
-final class PhabricatorSMSSendWorker
- extends PhabricatorSMSWorker {
+final class PhabricatorSMSSendWorker extends PhabricatorSMSWorker {
public function getMaximumRetryCount() {
return PhabricatorSMS::MAXIMUM_SEND_TRIES;
@@ -60,8 +59,9 @@
$sms->save();
throw new PhabricatorWorkerPermanentFailureException(
pht(
- 'Phabricator is running in silent mode. See `phabricator.silent` '.
- 'in the configuration to change this setting.'));
+ 'Phabricator is running in silent mode. See `%s` '.
+ 'in the configuration to change this setting.',
+ 'phabricator.silent'));
}
try {
diff --git a/src/infrastructure/ssh/PhabricatorSSHPassthruCommand.php b/src/infrastructure/ssh/PhabricatorSSHPassthruCommand.php
--- a/src/infrastructure/ssh/PhabricatorSSHPassthruCommand.php
+++ b/src/infrastructure/ssh/PhabricatorSSHPassthruCommand.php
@@ -90,15 +90,24 @@
$error_channel = $this->errorChannel;
if (!$command_channel) {
- throw new Exception('Set a command channel before calling execute()!');
+ throw new Exception(
+ pht(
+ 'Set a command channel before calling %s!',
+ __FUNCTION__.'()'));
}
if (!$io_channel) {
- throw new Exception('Set an IO channel before calling execute()!');
+ throw new Exception(
+ pht(
+ 'Set an IO channel before calling %s!',
+ __FUNCTION__.'()'));
}
if (!$error_channel) {
- throw new Exception('Set an error channel before calling execute()!');
+ throw new Exception(
+ pht(
+ 'Set an error channel before calling %s!',
+ __FUNCTION__.'()'));
}
$channels = array($command_channel, $io_channel, $error_channel);
diff --git a/src/infrastructure/storage/lisk/LiskDAO.php b/src/infrastructure/storage/lisk/LiskDAO.php
--- a/src/infrastructure/storage/lisk/LiskDAO.php
+++ b/src/infrastructure/storage/lisk/LiskDAO.php
@@ -498,7 +498,9 @@
if (count($data) > 1) {
throw new AphrontCountQueryException(
- 'More than 1 result from loadOneWhere()!');
+ pht(
+ 'More than one result from %s!',
+ __FUNCTION__.'()'));
}
$data = reset($data);
@@ -545,7 +547,8 @@
*/
public function reload() {
if (!$this->getID()) {
- throw new Exception("Unable to reload object that hasn't been loaded!");
+ throw new Exception(
+ pht("Unable to reload object that hasn't been loaded!"));
}
$result = $this->loadOneWhere(
@@ -809,7 +812,9 @@
if (count($relatives) > 1) {
throw new AphrontCountQueryException(
- 'More than 1 result from loadOneRelative()!');
+ pht(
+ 'More than one result from %s!',
+ __FUNCTION__.'()'));
}
return reset($relatives);
@@ -954,7 +959,10 @@
*/
public function establishConnection($mode, $force_new = false) {
if ($mode != 'r' && $mode != 'w') {
- throw new Exception("Unknown mode '{$mode}', should be 'r' or 'w'.");
+ throw new Exception(
+ pht(
+ "Unknown mode '%s', should be 'r' or 'w'.",
+ $mode));
}
if ($this->forcedConnection) {
@@ -1218,7 +1226,7 @@
case self::IDS_MANUAL:
break;
default:
- throw new Exception('Unknown CONFIG_IDs mechanism!');
+ throw new Exception(pht('Unknown %s mechanism!', 'CONFIG_IDs'));
}
$this->willWriteData($data);
@@ -1237,7 +1245,7 @@
throw new PhutilProxyException(
pht(
"Unable to insert or update object of class %s, field '%s' ".
- "has a nonscalar value.",
+ "has a non-scalar value.",
get_class($this),
$key),
$parameter_exception);
@@ -1273,9 +1281,10 @@
if ($key_type == self::IDS_MANUAL) {
throw new Exception(
- 'You are using manual IDs. You must override the '.
- 'shouldInsertWhenSaved() method to properly detect '.
- 'when to insert a new record.');
+ pht(
+ 'You are using manual IDs. You must override the %s method '.
+ 'to properly detect when to insert a new record.',
+ __FUNCTION__.'()'));
} else {
return !$this->getID();
}
@@ -1314,8 +1323,9 @@
$id_key = $this->getIDKey();
if (!$id_key) {
throw new Exception(
- 'This DAO does not have a single-part primary key. The method you '.
- 'called requires a single-part primary key.');
+ pht(
+ 'This DAO does not have a single-part primary key. The method you '.
+ 'called requires a single-part primary key.'));
}
return $id_key;
}
@@ -1330,8 +1340,10 @@
*/
public function generatePHID() {
throw new Exception(
- 'To use CONFIG_AUX_PHID, you need to overload '.
- 'generatePHID() to perform PHID generation.');
+ pht(
+ 'To use %s, you need to overload %s to perform PHID generation.',
+ 'CONFIG_AUX_PHID',
+ 'generatePHID()'));
}
@@ -1555,7 +1567,7 @@
self::$processIsolationLevel--;
if (self::$processIsolationLevel < 0) {
throw new Exception(
- 'Lisk process isolation level was reduced below 0.');
+ pht('Lisk process isolation level was reduced below 0.'));
}
}
@@ -1591,7 +1603,7 @@
self::$transactionIsolationLevel--;
if (self::$transactionIsolationLevel < 0) {
throw new Exception(
- 'Lisk transaction isolation level was reduced below 0.');
+ pht('Lisk transaction isolation level was reduced below 0.'));
} else if (self::$transactionIsolationLevel == 0) {
foreach (self::$connections as $key => $conn) {
if ($conn) {
@@ -1643,7 +1655,8 @@
}
break;
default:
- throw new Exception("Unknown serialization format '{$format}'.");
+ throw new Exception(
+ pht("Unknown serialization format '%s'.", $format));
}
}
}
@@ -1680,11 +1693,11 @@
$property = $dispatch_map[$method];
} else {
if (substr($method, 0, 3) !== 'get') {
- throw new Exception("Unable to resolve method '{$method}'!");
+ throw new Exception(pht("Unable to resolve method '%s'!", $method));
}
$property = substr($method, 3);
if (!($property = $this->checkProperty($property))) {
- throw new Exception("Bad getter call: {$method}");
+ throw new Exception(pht('Bad getter call: %s', $method));
}
$dispatch_map[$method] = $property;
}
@@ -1697,12 +1710,12 @@
$property = $dispatch_map[$method];
} else {
if (substr($method, 0, 3) !== 'set') {
- throw new Exception("Unable to resolve method '{$method}'!");
+ throw new Exception(pht("Unable to resolve method '%s'!", $method));
}
$property = substr($method, 3);
$property = $this->checkProperty($property);
if (!$property) {
- throw new Exception("Bad setter call: {$method}");
+ throw new Exception(pht('Bad setter call: %s', $method));
}
$dispatch_map[$method] = $property;
}
@@ -1712,7 +1725,7 @@
return $this;
}
- throw new Exception("Unable to resolve method '{$method}'.");
+ throw new Exception(pht("Unable to resolve method '%s'.", $method));
}
/**
@@ -1721,7 +1734,10 @@
* @task util
*/
public function __set($name, $value) {
- phlog('Wrote to undeclared property '.get_class($this).'::$'.$name.'.');
+ phlog(
+ pht(
+ 'Wrote to undeclared property %s.',
+ get_class($this).'::$'.$name));
$this->$name = $value;
}
diff --git a/src/infrastructure/storage/lisk/__tests__/LiskFixtureTestCase.php b/src/infrastructure/storage/lisk/__tests__/LiskFixtureTestCase.php
--- a/src/infrastructure/storage/lisk/__tests__/LiskFixtureTestCase.php
+++ b/src/infrastructure/storage/lisk/__tests__/LiskFixtureTestCase.php
@@ -67,7 +67,7 @@
$this->assertTrue(
($loaded !== null),
- 'Reads inside transactions should have transaction visibility.');
+ pht('Reads inside transactions should have transaction visibility.'));
LiskDAO::beginIsolateAllLiskEffectsToTransactions();
} catch (Exception $ex) {
diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementAdjustWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementAdjustWorkflow.php
--- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementAdjustWorkflow.php
+++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementAdjustWorkflow.php
@@ -41,8 +41,9 @@
throw new PhutilArgumentUsageException(
pht(
'You have not initialized the database yet. You must initialize '.
- 'the database before you can adjust schemata. Run `storage upgrade` '.
- 'to initialize the database.'));
+ 'the database before you can adjust schemata. Run `%s` '.
+ 'to initialize the database.',
+ 'storage upgrade'));
}
$applied = array_fuse($applied);
@@ -56,8 +57,9 @@
pht(
'You have not applied all available storage patches yet. You must '.
'apply all available patches before you can adjust schemata. '.
- 'Run `storage status` to show patch status, and `storage upgrade` '.
- 'to apply missing patches.'));
+ 'Run `%s` to show patch status, and `%s` to apply missing patches.',
+ 'storage status',
+ 'storage upgrade'));
}
}
diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementQuickstartWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementQuickstartWorkflow.php
--- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementQuickstartWorkflow.php
+++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementQuickstartWorkflow.php
@@ -26,7 +26,8 @@
if (!$output) {
throw new PhutilArgumentUsageException(
pht(
- 'Specify a file to write with `--output`.'));
+ 'Specify a file to write with `%s`.',
+ '--output'));
}
$namespace = 'phabricator_quickstart_'.Filesystem::readRandomCharacters(8);
@@ -95,7 +96,9 @@
// If we didn't make any changes, yell about it. We'll produce an invalid
// dump otherwise.
throw new PhutilArgumentUsageException(
- pht('Failed to apply hack to adjust FULLTEXT search column!'));
+ pht(
+ 'Failed to apply hack to adjust %s search column!',
+ 'FULLTEXT'));
}
$dump = str_replace(
diff --git a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementShellWorkflow.php b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementShellWorkflow.php
--- a/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementShellWorkflow.php
+++ b/src/infrastructure/storage/management/workflow/PhabricatorStorageManagementShellWorkflow.php
@@ -7,7 +7,7 @@
$this
->setName('shell')
->setExamples('**shell** [__options__]')
- ->setSynopsis('Launch an interactive shell.');
+ ->setSynopsis(pht('Launch an interactive shell.'));
}
public function execute(PhutilArgumentParser $args) {
diff --git a/src/infrastructure/testing/PhabricatorTestCase.php b/src/infrastructure/testing/PhabricatorTestCase.php
--- a/src/infrastructure/testing/PhabricatorTestCase.php
+++ b/src/infrastructure/testing/PhabricatorTestCase.php
@@ -138,8 +138,10 @@
unset($this->env);
} catch (Exception $ex) {
throw new Exception(
- 'Some test called PhabricatorEnv::beginScopedEnv(), but is still '.
- 'holding a reference to the scoped environment!');
+ pht(
+ 'Some test called %s, but is still holding '.
+ 'a reference to the scoped environment!',
+ 'PhabricatorEnv::beginScopedEnv()'));
}
}
@@ -216,8 +218,9 @@
public static function assertExecutingUnitTests() {
if (!self::$testsAreRunning) {
throw new Exception(
- 'Executing test code outside of test execution! This code path can '.
- 'only be run during unit tests.');
+ pht(
+ 'Executing test code outside of test execution! This code path can '.
+ 'only be run during unit tests.'));
}
}
diff --git a/src/view/__tests__/PhabricatorLocalTimeTestCase.php b/src/view/__tests__/PhabricatorLocalTimeTestCase.php
--- a/src/view/__tests__/PhabricatorLocalTimeTestCase.php
+++ b/src/view/__tests__/PhabricatorLocalTimeTestCase.php
@@ -12,25 +12,25 @@
$this->assertEqual(
'Jan 1 2000, 12:00 AM',
phabricator_datetime(946684800, $utc),
- 'Datetime formatting');
+ pht('Datetime formatting'));
$this->assertEqual(
'Jan 1 2000',
phabricator_date(946684800, $utc),
- 'Date formatting');
+ pht('Date formatting'));
$this->assertEqual(
'12:00 AM',
phabricator_time(946684800, $utc),
- 'Time formatting');
+ pht('Time formatting'));
$this->assertEqual(
'Dec 31 1999, 4:00 PM',
phabricator_datetime(946684800, $user),
- 'Localization');
+ pht('Localization'));
$this->assertEqual(
'',
phabricator_datetime(0, $user),
- 'Missing epoch should fail gracefully');
+ pht('Missing epoch should fail gracefully'));
}
}
diff --git a/src/view/control/AphrontCursorPagerView.php b/src/view/control/AphrontCursorPagerView.php
--- a/src/view/control/AphrontCursorPagerView.php
+++ b/src/view/control/AphrontCursorPagerView.php
@@ -93,7 +93,10 @@
public function getFirstPageURI() {
if (!$this->uri) {
throw new Exception(
- pht('You must call setURI() before you can call getFirstPageURI().'));
+ pht(
+ 'You must call %s before you can call %s.',
+ 'setURI()',
+ __FUNCTION__.'()'));
}
if (!$this->afterID && !($this->beforeID && $this->moreResults)) {
@@ -108,7 +111,10 @@
public function getPrevPageURI() {
if (!$this->uri) {
throw new Exception(
- pht('You must call setURI() before you can call getPrevPageURI().'));
+ pht(
+ 'You must call %s before you can call %s.',
+ 'getPrevPageURI()',
+ __FUNCTION__.'()'));
}
if (!$this->prevPageID) {
@@ -123,7 +129,10 @@
public function getNextPageURI() {
if (!$this->uri) {
throw new Exception(
- pht('You must call setURI() before you can call getNextPageURI().'));
+ pht(
+ 'You must call %s before you can call %s.',
+ 'setURI()',
+ __FUNCTION__.'()'));
}
if (!$this->nextPageID) {
@@ -138,7 +147,10 @@
public function render() {
if (!$this->uri) {
throw new Exception(
- pht('You must call setURI() before you can call render().'));
+ pht(
+ 'You must call %s before you can call %s.',
+ 'setURI()',
+ __FUNCTION__.'()'));
}
$links = array();
diff --git a/src/view/control/AphrontPagerView.php b/src/view/control/AphrontPagerView.php
--- a/src/view/control/AphrontPagerView.php
+++ b/src/view/control/AphrontPagerView.php
@@ -110,7 +110,10 @@
public function render() {
if (!$this->uri) {
throw new Exception(
- pht('You must call setURI() before you can call render().'));
+ pht(
+ 'You must call %s before you can call %s.',
+ 'setURI()',
+ __FUNCTION__.'()'));
}
require_celerity_resource('aphront-pager-view-css');
diff --git a/src/view/form/control/AphrontFormCheckboxControl.php b/src/view/form/control/AphrontFormCheckboxControl.php
--- a/src/view/form/control/AphrontFormCheckboxControl.php
+++ b/src/view/form/control/AphrontFormCheckboxControl.php
@@ -15,7 +15,7 @@
'value' => $value,
'label' => $label,
'checked' => $checked,
- 'id' => $id,
+ 'id' => $id,
);
return $this;
}
diff --git a/src/view/form/control/AphrontFormPasswordControl.php b/src/view/form/control/AphrontFormPasswordControl.php
--- a/src/view/form/control/AphrontFormPasswordControl.php
+++ b/src/view/form/control/AphrontFormPasswordControl.php
@@ -17,12 +17,12 @@
return phutil_tag(
'input',
array(
- 'type' => 'password',
- 'name' => $this->getName(),
- 'value' => $this->getValue(),
- 'disabled' => $this->getDisabled() ? 'disabled' : null,
+ 'type' => 'password',
+ 'name' => $this->getName(),
+ 'value' => $this->getValue(),
+ 'disabled' => $this->getDisabled() ? 'disabled' : null,
'autocomplete' => ($this->disableAutocomplete ? 'off' : null),
- 'id' => $this->getID(),
+ 'id' => $this->getID(),
));
}
diff --git a/src/view/form/control/PHUIFormMultiSubmitControl.php b/src/view/form/control/PHUIFormMultiSubmitControl.php
--- a/src/view/form/control/PHUIFormMultiSubmitControl.php
+++ b/src/view/form/control/PHUIFormMultiSubmitControl.php
@@ -6,7 +6,7 @@
public function addBackButton($label = null) {
if ($label === null) {
- $label = pht("\xC2\xAB Back");
+ $label = "\xC2\xAB ".pht('Back');
}
return $this->addButton('__back__', $label, 'grey');
}
diff --git a/src/view/layout/PhabricatorActionView.php b/src/view/layout/PhabricatorActionView.php
--- a/src/view/layout/PhabricatorActionView.php
+++ b/src/view/layout/PhabricatorActionView.php
@@ -139,7 +139,9 @@
if ($this->renderAsForm) {
if (!$this->user) {
throw new Exception(
- 'Call setUser() when rendering an action as a form.');
+ pht(
+ 'Call %s when rendering an action as a form.',
+ 'setUser()'));
}
$item = javelin_tag(
@@ -155,7 +157,7 @@
'action' => $this->getHref(),
'method' => 'POST',
'sigil' => $sigils,
- 'meta' => $this->metadata,
+ 'meta' => $this->metadata,
),
$item);
} else {
diff --git a/src/view/page/PhabricatorStandardPageView.php b/src/view/page/PhabricatorStandardPageView.php
--- a/src/view/page/PhabricatorStandardPageView.php
+++ b/src/view/page/PhabricatorStandardPageView.php
@@ -3,7 +3,6 @@
/**
* This is a standard Phabricator page with menus, Javelin, DarkConsole, and
* basic styles.
- *
*/
final class PhabricatorStandardPageView extends PhabricatorBarePageView {
@@ -160,7 +159,9 @@
if (!$this->getRequest()) {
throw new Exception(
pht(
- 'You must set the Request to render a PhabricatorStandardPageView.'));
+ 'You must set the %s to render a %s.',
+ 'Request',
+ __CLASS__));
}
$console = $this->getConsole();
@@ -184,8 +185,7 @@
if ($user) {
$default_img_uri =
- celerity_get_resource_uri(
- 'rsrc/image/icon/fatcow/document_black.png');
+ celerity_get_resource_uri('rsrc/image/icon/fatcow/document_black.png');
$download_form = phabricator_form(
$user,
array(
@@ -566,7 +566,7 @@
'message' => pht(
'Your session is in high security mode. When you '.
'finish using it, click here to leave.'),
- );
+ );
}
private function renderFooter() {
diff --git a/src/view/phui/PHUIObjectItemView.php b/src/view/phui/PHUIObjectItemView.php
--- a/src/view/phui/PHUIObjectItemView.php
+++ b/src/view/phui/PHUIObjectItemView.php
@@ -189,7 +189,7 @@
$this->addIcon('fa-clock-o red', $date, $attr);
break;
default:
- throw new Exception("Unknown age '{$age}'!");
+ throw new Exception(pht("Unknown age '%s'!", $age));
}
return $this;
@@ -197,7 +197,7 @@
public function addAction(PHUIListItemView $action) {
if (count($this->actions) >= 3) {
- throw new Exception('Limit 3 actions per item.');
+ throw new Exception(pht('Limit 3 actions per item.'));
}
$this->actions[] = $action;
return $this;
@@ -686,6 +686,4 @@
'');
}
-
-
}
diff --git a/src/view/phui/PHUIRemarkupPreviewPanel.php b/src/view/phui/PHUIRemarkupPreviewPanel.php
--- a/src/view/phui/PHUIRemarkupPreviewPanel.php
+++ b/src/view/phui/PHUIRemarkupPreviewPanel.php
@@ -42,8 +42,11 @@
);
if (empty($skins[$skin])) {
- $valid = implode(', ', array_keys($skins));
- throw new Exception("Invalid skin '{$skin}'. Valid skins are: {$valid}.");
+ throw new Exception(
+ pht(
+ "Invalid skin '%s'. Valid skins are: %s.",
+ $skin,
+ implode(', ', array_keys($skins))));
}
$this->skin = $skin;
@@ -69,10 +72,16 @@
protected function getTagContent() {
if ($this->previewURI === null) {
- throw new Exception('Call setPreviewURI() before rendering!');
+ throw new Exception(
+ pht(
+ 'Call %s before rendering!',
+ 'setPreviewURI()'));
}
if ($this->controlID === null) {
- throw new Exception('Call setControlID() before rendering!');
+ throw new Exception(
+ pht(
+ 'Call %s before rendering!',
+ 'setControlID()'));
}
$preview_id = celerity_generate_unique_node_id();
diff --git a/src/view/phui/calendar/PHUICalendarMonthView.php b/src/view/phui/calendar/PHUICalendarMonthView.php
--- a/src/view/phui/calendar/PHUICalendarMonthView.php
+++ b/src/view/phui/calendar/PHUICalendarMonthView.php
@@ -48,7 +48,11 @@
public function render() {
if (empty($this->user)) {
- throw new Exception('Call setUser() before render()!');
+ throw new Exception(
+ pht(
+ 'Call %s before %s!',
+ 'setUser()',
+ __FUNCTION__.'()'));
}
$events = msort($this->events, 'getEpochStart');
diff --git a/src/view/widget/hovercard/PhabricatorHovercardView.php b/src/view/widget/hovercard/PhabricatorHovercardView.php
--- a/src/view/widget/hovercard/PhabricatorHovercardView.php
+++ b/src/view/widget/hovercard/PhabricatorHovercardView.php
@@ -2,7 +2,7 @@
/**
* The default one-for-all hovercard. We may derive from this one to create
- * more specialized ones
+ * more specialized ones.
*/
final class PhabricatorHovercardView extends AphrontView {
@@ -62,7 +62,11 @@
public function render() {
if (!$this->handle) {
- throw new Exception('Call setObjectHandle() before calling render()!');
+ throw new Exception(
+ pht(
+ 'Call %s before calling %s!',
+ 'setObjectHandle()',
+ __FUNCTION__.'()'));
}
$handle = $this->handle;
diff --git a/webroot/index.php b/webroot/index.php
--- a/webroot/index.php
+++ b/webroot/index.php
@@ -31,7 +31,6 @@
throw $ex;
}
}
-
} catch (Exception $ex) {
PhabricatorStartup::didEncounterFatalException('Core Exception', $ex, false);
}

File Metadata

Mime Type
text/plain
Expires
Mar 23 2025, 9:09 AM (4 w, 3 d ago)
Storage Engine
amazon-s3
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
phabricator/secure/6z/wz/t5rc2s5v3kuljr4p
Default Alt Text
D12797.id30762.diff (837 KB)

Event Timeline