Adopt l10n for grunt and php-language-features (#165552)

* Adopt l10n for grunt

For #164438

* Adopt l10n for php-language-features

For #164438
This commit is contained in:
Matt Bierner 2022-11-04 13:50:21 -07:00 committed by GitHub
parent 4001e9d6d8
commit ac26690ed8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 26 deletions

View file

@ -16,9 +16,7 @@
"compile": "gulp compile-extension:grunt",
"watch": "gulp watch-extension:grunt"
},
"dependencies": {
"vscode-nls": "^5.2.0"
},
"dependencies": {},
"devDependencies": {
"@types/node": "16.x"
},

View file

@ -7,8 +7,6 @@ import * as path from 'path';
import * as fs from 'fs';
import * as cp from 'child_process';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
type AutoDetect = 'on' | 'off';
@ -60,8 +58,8 @@ function getOutputChannel(): vscode.OutputChannel {
}
function showError() {
vscode.window.showWarningMessage(localize('gruntTaskDetectError', 'Problem finding grunt tasks. See the output for more information.'),
localize('gruntShowOutput', 'Go to output')).then(() => {
vscode.window.showWarningMessage(vscode.l10n.t("Problem finding grunt tasks. See the output for more information."),
vscode.l10n.t("Go to output")).then(() => {
getOutputChannel().show(true);
});
}
@ -215,7 +213,7 @@ class FolderDetector {
if (err.stdout) {
channel.appendLine(err.stdout);
}
channel.appendLine(localize('execFailed', 'Auto detecting Grunt for folder {0} failed with error: {1}', this.workspaceFolder.name, err.error ? err.error.toString() : 'unknown'));
channel.appendLine(vscode.l10n.t("Auto detecting Grunt for folder {0} failed with error: {1}', this.workspaceFolder.name, err.error ? err.error.toString() : 'unknown"));
showError();
return emptyTasks;
}

View file

@ -6,8 +6,3 @@
version "16.11.6"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.6.tgz#6bef7a2a0ad684cf6e90fcfe31cecabd9ce0a3ae"
integrity sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==
vscode-nls@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f"
integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng==

View file

@ -74,7 +74,6 @@
"watch": "npx gulp watch-extension:php-language-features"
},
"dependencies": {
"vscode-nls": "^5.2.0",
"which": "^2.0.2"
},
"devDependencies": {

View file

@ -9,8 +9,6 @@ import * as which from 'which';
import * as path from 'path';
import * as vscode from 'vscode';
import { ThrottledDelayer } from './utils/async';
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
const enum Setting {
Run = 'php.validate.run',
@ -179,7 +177,7 @@ export default class PHPValidationProvider {
return new Promise<void>(resolve => {
const executable = this.config!.executable;
if (!executable) {
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.'));
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."));
this.pauseValidation = true;
resolve();
return;
@ -254,12 +252,12 @@ export default class PHPValidationProvider {
let message: string | null = null;
if (error.code === 'ENOENT') {
if (this.config!.executable) {
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);
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);
} else {
message = localize('noExecutable', 'Cannot validate since no PHP executable is set. Use the setting \'php.validate.executablePath\' to configure the PHP executable.');
message = vscode.l10n.t("Cannot validate since no PHP executable is set. Use the setting 'php.validate.executablePath' to configure the PHP executable.");
}
} else {
message = error.message ? error.message : localize('unknownReason', 'Failed to run php using path: {0}. Reason is unknown.', executable);
message = error.message ? error.message : vscode.l10n.t("Failed to run php using path: {0}. Reason is unknown.", executable);
}
if (!message) {
return;
@ -269,7 +267,7 @@ export default class PHPValidationProvider {
}
private async showErrorMessage(message: string): Promise<void> {
const openSettings = localize('goToSetting', 'Open Settings');
const openSettings = vscode.l10n.t("Open Settings");
if (await vscode.window.showInformationMessage(message, openSettings) === openSettings) {
vscode.commands.executeCommand('workbench.action.openSettings', Setting.ExecutablePath);
}

View file

@ -17,11 +17,6 @@ isexe@^2.0.0:
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=
vscode-nls@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f"
integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng==
which@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"