Skip to content

Commit e1e2f8d

Browse files
epriestleydklawren
epriestley
authored andcommittedJun 22, 2022
Remove product literal strings in "pht()", part 1
Summary: Ref T13658. I used the linter in D21763 to identify these and `split` them into arbitrary groups of 10 files. Test Plan: This test plan is non-exhaustive, because some of these strings are difficult to reach. - Looked at "Create Service" in Almanac. - Used "bin/auth" to go through a one-time auth workflow (not all related strings can be hit on a single workflow). - Started the "Generate Keypair" worfklow in "SSH Public Keys". Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam Maniphest Tasks: T13658 Differential Revision: https://secure.phabricator.com/D21765
1 parent c22b9d0 commit e1e2f8d

10 files changed

+65
-49
lines changed
 

‎resources/sql/patches/20130820.file-mailkey-populate.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
echo pht('Populating Phabricator files with mail keys xactions...')."\n";
3+
echo pht('Populating files with mail keys...')."\n";
44

55
$table = new PhabricatorFile();
66
$table_name = $table->getTableName();

‎scripts/sql/manage_storage.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
require_once $root.'/scripts/init/init-setup.php';
66

77
$args = new PhutilArgumentParser($argv);
8-
$args->setTagline(pht('manage Phabricator storage and schemata'));
8+
$args->setTagline(pht('manage storage and schemata'));
99
$args->setSynopsis(<<<EOHELP
1010
**storage** __workflow__ [__options__]
11-
Manage Phabricator database storage and schema versioning.
11+
Manage database storage and schema versioning.
1212
1313
**storage** upgrade
14-
Initialize or upgrade Phabricator storage.
14+
Initialize or upgrade storage.
1515
1616
**storage** upgrade --user __root__ --password __hunter2__
1717
Use administrative credentials for schema changes.
@@ -74,7 +74,7 @@
7474
'name' => 'disable-utf8mb4',
7575
'help' => pht(
7676
'Disable %s, even if the database supports it. This is an '.
77-
'advanced feature used for testing changes to Phabricator; you '.
77+
'advanced feature used for testing internal changes; you '.
7878
'should not normally use this flag.',
7979
'utf8mb4'),
8080
),
@@ -168,9 +168,9 @@
168168
'Unable to connect to MySQL using the configured credentials. '.
169169
'You must configure standard credentials before you can upgrade '.
170170
'storage. Run these commands to set up credentials:'),
171-
" phabricator/ $ ./bin/config set mysql.host __host__\n".
172-
" phabricator/ $ ./bin/config set mysql.user __username__\n".
173-
" phabricator/ $ ./bin/config set mysql.pass __password__",
171+
" $ ./bin/config set mysql.host __host__\n".
172+
" $ ./bin/config set mysql.user __username__\n".
173+
" $ ./bin/config set mysql.pass __password__",
174174
pht(
175175
'These standard credentials are separate from any administrative '.
176176
'credentials provided to this command with __%s__ or '.

‎scripts/ssh/ssh-exec.php

+8-6
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@
130130
if (!PhabricatorEnv::isClusterAddress($remote_address)) {
131131
throw new Exception(
132132
pht(
133-
'This request originates from outside of the Phabricator cluster '.
134-
'address range. Requests signed with a trusted device key must '.
135-
'originate from trusted hosts.'));
133+
'This request originates from outside of the cluster address range. '.
134+
'Requests signed with a trusted device key must originate from '.
135+
'trusted hosts.'));
136136
}
137137

138138
$device = id(new AlmanacDeviceQuery())
@@ -228,15 +228,17 @@
228228
$command_list = implode(', ', $command_list);
229229

230230
$error_lines = array();
231-
$error_lines[] = pht('Welcome to Phabricator.');
231+
$error_lines[] = pht(
232+
'Welcome to %s.',
233+
PlatformSymbols::getPlatformServerName());
232234
$error_lines[] = pht(
233235
'You are logged in as %s.',
234236
$user_name);
235237

236238
if (!$original_argv) {
237239
$error_lines[] = pht(
238240
'You have not specified a command to run. This means you are requesting '.
239-
'an interactive shell, but Phabricator does not provide interactive '.
241+
'an interactive shell, but this server does not provide interactive '.
240242
'shells over SSH.');
241243
$error_lines[] = pht(
242244
'(Usually, you should run a command like "git clone" or "hg push" '.
@@ -270,7 +272,7 @@
270272
if (empty($workflows[$command])) {
271273
$error_lines[] = pht(
272274
'You have specified the command "%s", but that command is not '.
273-
'supported by Phabricator. As received by Phabricator, your entire '.
275+
'supported by this server. As received by this server, your entire '.
274276
'argument list was:',
275277
$command);
276278

‎src/applications/almanac/servicetype/AlmanacClusterDatabaseServiceType.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ public function getServiceTypeShortName() {
1010
}
1111

1212
public function getServiceTypeName() {
13-
return pht('Phabricator Cluster: Database');
13+
return pht('Cluster: Database');
1414
}
1515

1616
public function getServiceTypeDescription() {
1717
return pht(
18-
'Defines a database service for use in a Phabricator cluster.');
18+
'Defines a database service for use in a cluster.');
1919
}
2020

2121
}

‎src/applications/almanac/servicetype/AlmanacClusterRepositoryServiceType.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ public function getServiceTypeShortName() {
1010
}
1111

1212
public function getServiceTypeName() {
13-
return pht('Phabricator Cluster: Repository');
13+
return pht('Cluster: Repository');
1414
}
1515

1616
public function getServiceTypeDescription() {
1717
return pht(
18-
'Defines a repository service for use in a Phabricator cluster.');
18+
'Defines a repository service for use in a cluster.');
1919
}
2020

2121
public function getFieldSpecifications() {

‎src/applications/auth/adapter/PhutilPhabricatorAuthAdapter.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ protected function loadOAuthAccountData() {
8989
} catch (PhutilJSONParserException $ex) {
9090
throw new Exception(
9191
pht(
92-
'Expected valid JSON response from Phabricator %s request.',
93-
'user.whoami'),
92+
'Expected valid JSON response from "user.whoami" request.'),
9493
$ex);
9594
}
9695
}

‎src/applications/auth/controller/PhabricatorAuthController.php

+7-3
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,16 @@ protected function renderInviteHeader(PhabricatorAuthInvite $invite) {
254254
}
255255

256256
$invite_item = id(new PHUIObjectItemView())
257-
->setHeader(pht('Welcome to Phabricator!'))
257+
->setHeader(
258+
pht(
259+
'Welcome to %s!',
260+
PlatformSymbols::getPlatformServerName()))
258261
->setImageURI($invite_author->getProfileImageURI())
259262
->addAttribute(
260263
pht(
261-
'%s has invited you to join Phabricator.',
262-
$invite_author->getFullName()));
264+
'%s has invited you to join %s.',
265+
$invite_author->getFullName(),
266+
PlatformSymbols::getPlatformServerName()));
263267

264268
$invite_list = id(new PHUIObjectItemListView())
265269
->addItem($invite_item)

‎src/applications/auth/controller/PhabricatorAuthOneTimeLoginController.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,19 @@ public function handleRequest(AphrontRequest $request) {
151151

152152
switch ($link_type) {
153153
case PhabricatorAuthSessionEngine::ONETIME_WELCOME:
154-
$title = pht('Welcome to Phabricator');
154+
$title = pht(
155+
'Welcome to %s',
156+
PlatformSymbols::getPlatformServerName());
155157
break;
156158
case PhabricatorAuthSessionEngine::ONETIME_RECOVER:
157159
$title = pht('Account Recovery');
158160
break;
159161
case PhabricatorAuthSessionEngine::ONETIME_USERNAME:
160162
case PhabricatorAuthSessionEngine::ONETIME_RESET:
161163
default:
162-
$title = pht('Log in to Phabricator');
164+
$title = pht(
165+
'Log in to %s',
166+
PlatformSymbols::getPlatformServerName());
163167
break;
164168
}
165169

‎src/applications/auth/controller/PhabricatorAuthRegisterController.php

+30-23
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ public function handleRequest(AphrontRequest $request) {
8383
if (!PhabricatorUserEmail::isValidAddress($default_email)) {
8484
$errors[] = pht(
8585
'The email address associated with this external account ("%s") is '.
86-
'not a valid email address and can not be used to register a '.
87-
'Phabricator account. Choose a different, valid address.',
86+
'not a valid email address and can not be used to register an '.
87+
'account. Choose a different, valid address.',
8888
phutil_tag('strong', array(), $default_email));
8989
$default_email = null;
9090
}
@@ -102,8 +102,7 @@ public function handleRequest(AphrontRequest $request) {
102102
$errors[] = pht(
103103
'The email address associated with this account ("%s") is '.
104104
'already in use by an application and can not be used to '.
105-
'register a new Phabricator account. Choose a different, valid '.
106-
'address.',
105+
'register a new account. Choose a different, valid address.',
107106
phutil_tag('strong', array(), $default_email));
108107
$default_email = null;
109108
}
@@ -122,8 +121,8 @@ public function handleRequest(AphrontRequest $request) {
122121
array(
123122
pht(
124123
'The account you are attempting to register with has an invalid '.
125-
'email address (%s). This Phabricator install only allows '.
126-
'registration with specific email addresses:',
124+
'email address (%s). This server only allows registration with '.
125+
'specific email addresses:',
127126
$debug_email),
128127
phutil_tag('br'),
129128
phutil_tag('br'),
@@ -157,27 +156,29 @@ public function handleRequest(AphrontRequest $request) {
157156
->addHiddenInput('phase', 1)
158157
->appendParagraph(
159158
pht(
160-
'You are creating a new Phabricator account linked to an '.
161-
'existing external account from outside Phabricator.'))
159+
'You are creating a new account linked to an existing '.
160+
'external account.'))
162161
->appendParagraph(
163162
pht(
164163
'The email address ("%s") associated with the external account '.
165-
'is already in use by an existing Phabricator account. Multiple '.
166-
'Phabricator accounts may not have the same email address, so '.
167-
'you can not use this email address to register a new '.
168-
'Phabricator account.',
169-
phutil_tag('strong', array(), $show_existing)))
164+
'is already in use by an existing %s account. Multiple '.
165+
'%s accounts may not have the same email address, so '.
166+
'you can not use this email address to register a new account.',
167+
phutil_tag('strong', array(), $show_existing),
168+
PlatformSymbols::getPlatformServerName(),
169+
PlatformSymbols::getPlatformServerName()))
170170
->appendParagraph(
171171
pht(
172172
'If you want to register a new account, continue with this '.
173173
'registration workflow and choose a new, unique email address '.
174174
'for the new account.'))
175175
->appendParagraph(
176176
pht(
177-
'If you want to link an existing Phabricator account to this '.
177+
'If you want to link an existing %s account to this '.
178178
'external account, do not continue. Instead: log in to your '.
179179
'existing account, then go to "Settings" and link the account '.
180-
'in the "External Accounts" panel.'))
180+
'in the "External Accounts" panel.',
181+
PlatformSymbols::getPlatformServerName()))
181182
->appendParagraph(
182183
pht(
183184
'If you continue, you will create a new account. You will not '.
@@ -187,10 +188,10 @@ public function handleRequest(AphrontRequest $request) {
187188
} else {
188189
$errors[] = pht(
189190
'The external account you are registering with has an email address '.
190-
'that is already in use ("%s") by an existing Phabricator account. '.
191-
'Choose a new, valid email address to register a new Phabricator '.
192-
'account.',
193-
phutil_tag('strong', array(), $show_existing));
191+
'that is already in use ("%s") by an existing %s account. '.
192+
'Choose a new, valid email address to register a new account.',
193+
phutil_tag('strong', array(), $show_existing),
194+
PlatformSymbols::getPlatformServerName());
194195
}
195196
}
196197

@@ -595,7 +596,9 @@ public function handleRequest(AphrontRequest $request) {
595596

596597
if ($is_setup) {
597598
$crumbs->addTextCrumb(pht('Setup Admin Account'));
598-
$title = pht('Welcome to Phabricator');
599+
$title = pht(
600+
'Welcome to %s',
601+
PlatformSymbols::getPlatformServerName());
599602
} else {
600603
$crumbs->addTextCrumb(pht('Register'));
601604
$crumbs->addTextCrumb($provider->getProviderName());
@@ -607,7 +610,10 @@ public function handleRequest(AphrontRequest $request) {
607610
if ($is_setup) {
608611
$welcome_view = id(new PHUIInfoView())
609612
->setSeverity(PHUIInfoView::SEVERITY_NOTICE)
610-
->setTitle(pht('Welcome to Phabricator'))
613+
->setTitle(
614+
pht(
615+
'Welcome to %s',
616+
PlatformSymbols::getPlatformServerName()))
611617
->appendChild(
612618
pht(
613619
'Installation is complete. Register your administrator account '.
@@ -710,8 +716,9 @@ protected function renderError($message) {
710716
}
711717

712718
private function sendWaitingForApprovalEmail(PhabricatorUser $user) {
713-
$title = '[Phabricator] '.pht(
714-
'New User "%s" Awaiting Approval',
719+
$title = pht(
720+
'[%s] New User "%s" Awaiting Approval',
721+
PlatformSymbols::getPlatformServerName(),
715722
$user->getUsername());
716723

717724
$body = new PhabricatorMetaMTAMailBody();

‎src/applications/auth/controller/PhabricatorAuthSSHKeyGenerateController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function handleRequest(AphrontRequest $request) {
105105
'This workflow will generate a new SSH keypair, add the public '.
106106
'key, and let you download the private key.'))
107107
->appendParagraph(
108-
pht('Phabricator will not retain a copy of the private key.'))
108+
pht('The private key will not be retained.'))
109109
->addSubmitButton(pht('Generate New Keypair'))
110110
->addCancelButton($cancel_uri);
111111
} catch (Exception $ex) {

0 commit comments

Comments
 (0)
Failed to load comments.