Skip to content

Commit ac26690

Browse files
authored
Adopt l10n for grunt and php-language-features (microsoft#165552)
* Adopt l10n for grunt For microsoft#164438 * Adopt l10n for php-language-features For microsoft#164438
1 parent 4001e9d commit ac26690

File tree

6 files changed

+9
-26
lines changed

6 files changed

+9
-26
lines changed

extensions/grunt/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,7 @@
1616
"compile": "gulp compile-extension:grunt",
1717
"watch": "gulp watch-extension:grunt"
1818
},
19-
"dependencies": {
20-
"vscode-nls": "^5.2.0"
21-
},
19+
"dependencies": {},
2220
"devDependencies": {
2321
"@types/node": "16.x"
2422
},

extensions/grunt/src/main.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import * as path from 'path';
77
import * as fs from 'fs';
88
import * as cp from 'child_process';
99
import * as vscode from 'vscode';
10-
import * as nls from 'vscode-nls';
11-
const localize = nls.loadMessageBundle();
1210

1311
type AutoDetect = 'on' | 'off';
1412

@@ -60,8 +58,8 @@ function getOutputChannel(): vscode.OutputChannel {
6058
}
6159

6260
function showError() {
63-
vscode.window.showWarningMessage(localize('gruntTaskDetectError', 'Problem finding grunt tasks. See the output for more information.'),
64-
localize('gruntShowOutput', 'Go to output')).then(() => {
61+
vscode.window.showWarningMessage(vscode.l10n.t("Problem finding grunt tasks. See the output for more information."),
62+
vscode.l10n.t("Go to output")).then(() => {
6563
getOutputChannel().show(true);
6664
});
6765
}
@@ -215,7 +213,7 @@ class FolderDetector {
215213
if (err.stdout) {
216214
channel.appendLine(err.stdout);
217215
}
218-
channel.appendLine(localize('execFailed', 'Auto detecting Grunt for folder {0} failed with error: {1}', this.workspaceFolder.name, err.error ? err.error.toString() : 'unknown'));
216+
channel.appendLine(vscode.l10n.t("Auto detecting Grunt for folder {0} failed with error: {1}', this.workspaceFolder.name, err.error ? err.error.toString() : 'unknown"));
219217
showError();
220218
return emptyTasks;
221219
}

extensions/grunt/yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,3 @@
66
version "16.11.6"
77
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.6.tgz#6bef7a2a0ad684cf6e90fcfe31cecabd9ce0a3ae"
88
integrity sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==
9-
10-
vscode-nls@^5.2.0:
11-
version "5.2.0"
12-
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f"
13-
integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng==

extensions/php-language-features/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
"watch": "npx gulp watch-extension:php-language-features"
7575
},
7676
"dependencies": {
77-
"vscode-nls": "^5.2.0",
7877
"which": "^2.0.2"
7978
},
8079
"devDependencies": {

extensions/php-language-features/src/features/validationProvider.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import * as which from 'which';
99
import * as path from 'path';
1010
import * as vscode from 'vscode';
1111
import { ThrottledDelayer } from './utils/async';
12-
import * as nls from 'vscode-nls';
13-
const localize = nls.loadMessageBundle();
1412

1513
const enum Setting {
1614
Run = 'php.validate.run',
@@ -179,7 +177,7 @@ export default class PHPValidationProvider {
179177
return new Promise<void>(resolve => {
180178
const executable = this.config!.executable;
181179
if (!executable) {
182-
this.showErrorMessage(localize('noPhp', 'Cannot validate since a PHP installation could not be found. Use the setting \'php.validate.executablePath\' to configure the PHP executable.'));
180+
this.showErrorMessage(vscode.l10n.t("Cannot validate since a PHP installation could not be found. Use the setting 'php.validate.executablePath' to configure the PHP executable."));
183181
this.pauseValidation = true;
184182
resolve();
185183
return;
@@ -254,12 +252,12 @@ export default class PHPValidationProvider {
254252
let message: string | null = null;
255253
if (error.code === 'ENOENT') {
256254
if (this.config!.executable) {
257-
message = localize('wrongExecutable', 'Cannot validate since {0} is not a valid php executable. Use the setting \'php.validate.executablePath\' to configure the PHP executable.', executable);
255+
message = vscode.l10n.t("Cannot validate since {0} is not a valid php executable. Use the setting 'php.validate.executablePath' to configure the PHP executable.", executable);
258256
} else {
259-
message = localize('noExecutable', 'Cannot validate since no PHP executable is set. Use the setting \'php.validate.executablePath\' to configure the PHP executable.');
257+
message = vscode.l10n.t("Cannot validate since no PHP executable is set. Use the setting 'php.validate.executablePath' to configure the PHP executable.");
260258
}
261259
} else {
262-
message = error.message ? error.message : localize('unknownReason', 'Failed to run php using path: {0}. Reason is unknown.', executable);
260+
message = error.message ? error.message : vscode.l10n.t("Failed to run php using path: {0}. Reason is unknown.", executable);
263261
}
264262
if (!message) {
265263
return;
@@ -269,7 +267,7 @@ export default class PHPValidationProvider {
269267
}
270268

271269
private async showErrorMessage(message: string): Promise<void> {
272-
const openSettings = localize('goToSetting', 'Open Settings');
270+
const openSettings = vscode.l10n.t("Open Settings");
273271
if (await vscode.window.showInformationMessage(message, openSettings) === openSettings) {
274272
vscode.commands.executeCommand('workbench.action.openSettings', Setting.ExecutablePath);
275273
}

extensions/php-language-features/yarn.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ isexe@^2.0.0:
1717
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
1818
integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=
1919

20-
vscode-nls@^5.2.0:
21-
version "5.2.0"
22-
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f"
23-
integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng==
24-
2520
which@^2.0.2:
2621
version "2.0.2"
2722
resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"

0 commit comments

Comments
 (0)