cluster deploy extension: Add localization support and fix " to ' strings (#4332)

* Add localization support and fix " to ' strings

* Fix ${ usage
This commit is contained in:
Kevin Cunnane
2019-03-07 14:26:31 -08:00
committed by GitHub
parent 029c69ecd3
commit a4d99b78d5
10 changed files with 62 additions and 41 deletions

View File

@@ -5,12 +5,15 @@
'use strict';
import vscode = require('vscode');
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
import { MainController } from './mainController';
import { fs } from './utility/fs';
import { host } from './kubectl/host';
import { sqlserverbigdataclusterchannel } from './kubectl/SqlServerBigDataClusterChannel';
import { sqlserverbigdataclusterchannel } from './kubectl/sqlServerBigDataClusterChannel';
import { shell, Shell } from './utility/shell';
import { CheckPresentMessageMode, create as kubectlCreate } from './kubectl/kubectl';
import { installKubectl } from './installer/installer';
@@ -36,22 +39,22 @@ export async function installDependencies() {
const installPromises = [
installDependency("kubectl", gotKubectl, installKubectl),
installDependency('kubectl', gotKubectl, installKubectl)
];
await Promise.all(installPromises);
sqlserverbigdataclusterchannel.showOutput("Done");
sqlserverbigdataclusterchannel.showOutput(localize('done', 'Done'));
}
async function installDependency(name: string, alreadyGot: boolean, installFunc: (shell: Shell) => Promise<Errorable<null>>): Promise<void> {
if (alreadyGot) {
sqlserverbigdataclusterchannel.showOutput(`Already got ${name}...`);
sqlserverbigdataclusterchannel.showOutput(localize('dependencyInstalled', '{0} already installed...', name));
} else {
sqlserverbigdataclusterchannel.showOutput(`Installing ${name}...`);
sqlserverbigdataclusterchannel.showOutput(localize('installingDependency', 'Installing {0}...', name));
const result = await installFunc(shell);
if (failed(result)) {
sqlserverbigdataclusterchannel.showOutput(`Unable to install ${name}: ${result.error[0]}`);
sqlserverbigdataclusterchannel.showOutput(localize('installingDependencyFailed', 'Unable to install {0}: {1}', name, result.error[0]));
}
}
}