Add double quotes for localize hygiene check (#6492)

* Add localize single quote hygiene task

* Update localize calls

* Update comment

* Fix build failures and remove test code
This commit is contained in:
Charles Gagnon
2019-07-25 10:35:14 -07:00
committed by GitHub
parent 69845b29ef
commit b2b2840990
141 changed files with 651 additions and 630 deletions

View File

@@ -151,7 +151,7 @@ export class AccountManagementService implements IAccountManagementService {
let refreshedAccount = await provider.provider.refresh(account);
if (self.isCanceledResult(refreshedAccount)) {
// Pattern here is to throw if this fails. Handled upstream.
throw new Error(localize('refreshFailed', 'Refresh account was canceled by the user'));
throw new Error(localize('refreshFailed', "Refresh account was canceled by the user"));
} else {
account = refreshedAccount;
}

View File

@@ -38,13 +38,13 @@ export class AdminService implements IAdminService {
let providerId: string = this._connectionService.getProviderIdFromUri(uri);
if (!providerId) {
return Promise.reject(new Error(localize('adminService.providerIdNotValidError', 'Connection is required in order to interact with adminservice')));
return Promise.reject(new Error(localize('adminService.providerIdNotValidError', "Connection is required in order to interact with adminservice")));
}
let handler = this._providers[providerId];
if (handler) {
return action(handler);
} else {
return Promise.reject(new Error(localize('adminService.noHandlerRegistered', 'No Handler Registered')));
return Promise.reject(new Error(localize('adminService.noHandlerRegistered', "No Handler Registered")));
}
}

View File

@@ -151,7 +151,7 @@ export class CommandLineService implements ICommandLineProcessing {
showFirewallRuleOnError: warnOnConnectFailure
};
if (this._notificationService) {
this._notificationService.status(localize('connectingQueryLabel', 'Connecting query file'), { hideAfter: 2500 });
this._notificationService.status(localize('connectingQueryLabel', "Connecting query file"), { hideAfter: 2500 });
}
await this._connectionManagementService.connect(profile, uriString, options);
}

View File

@@ -118,7 +118,7 @@ export class CmsConnectionWidget extends ConnectionWidget {
// Registered Server Description
let serverDescriptionOption = this._optionsMaps['serverDescription'];
if (serverDescriptionOption) {
serverDescriptionOption.displayName = localize('serverDescription', 'Server Description (optional)');
serverDescriptionOption.displayName = localize('serverDescription', "Server Description (optional)");
let serverDescriptionBuilder = DialogHelper.appendRow(this._tableContainer, serverDescriptionOption.displayName, 'connection-label', 'connection-input', 'server-description-input');
this._serverDescriptionInputBox = new InputBox(serverDescriptionBuilder, this._contextViewService, { type: 'textarea', flexibleHeight: true });
this._serverDescriptionInputBox.setHeight('75px');

View File

@@ -70,7 +70,7 @@ export class ConnectionDialogService implements IConnectionDialogService {
private _providerDisplayNames: string[] = [];
private _currentProviderType: string = Constants.mssqlProviderName;
private _connecting: boolean = false;
private _connectionErrorTitle = localize('connectionError', 'Connection error');
private _connectionErrorTitle = localize('connectionError', "Connection error");
private _dialogDeferredPromise: Deferred<IConnectionProfile>;
/**

View File

@@ -46,7 +46,7 @@ export class ConnectionWidget {
private _azureAccountDropdown: SelectBox;
private _azureTenantDropdown: SelectBox;
private _refreshCredentialsLink: HTMLLinkElement;
private _addAzureAccountMessage: string = localize('connectionWidget.AddAzureAccount', 'Add an account...');
private _addAzureAccountMessage: string = localize('connectionWidget.AddAzureAccount', "Add an account...");
private readonly _azureProviderId = 'azurePublicCloud';
private _azureTenantId: string;
private _azureAccountList: azdata.Account[];
@@ -54,9 +54,9 @@ export class ConnectionWidget {
private _focusedBeforeHandleOnConnection: HTMLElement;
private _saveProfile: boolean;
private _databaseDropdownExpanded: boolean = false;
private _defaultDatabaseName: string = localize('defaultDatabaseOption', '<Default>');
private _loadingDatabaseName: string = localize('loadingDatabaseOption', 'Loading...');
private _serverGroupDisplayString: string = localize('serverGroup', 'Server group');
private _defaultDatabaseName: string = localize('defaultDatabaseOption', "<Default>");
private _loadingDatabaseName: string = localize('loadingDatabaseOption', "Loading...");
private _serverGroupDisplayString: string = localize('serverGroup', "Server group");
protected _container: HTMLElement;
protected _serverGroupSelectBox: SelectBox;
protected _authTypeSelectBox: SelectBox;
@@ -72,7 +72,7 @@ export class ConnectionWidget {
protected _advancedButton: Button;
public DefaultServerGroup: IConnectionProfileGroup = {
id: '',
name: localize('defaultServerGroup', '<Default>'),
name: localize('defaultServerGroup', "<Default>"),
parentId: undefined,
color: undefined,
description: undefined,
@@ -80,14 +80,14 @@ export class ConnectionWidget {
private _addNewServerGroup = {
id: '',
name: localize('addNewServerGroup', 'Add new group...'),
name: localize('addNewServerGroup', "Add new group..."),
parentId: undefined,
color: undefined,
description: undefined,
};
public NoneServerGroup: IConnectionProfileGroup = {
id: '',
name: localize('noneServerGroup', '<Do not save>'),
name: localize('noneServerGroup', "<Do not save>"),
parentId: undefined,
color: undefined,
description: undefined,
@@ -223,20 +223,20 @@ export class ConnectionWidget {
this._password = '';
// Remember password
let rememberPasswordLabel = localize('rememberPassword', 'Remember password');
let rememberPasswordLabel = localize('rememberPassword', "Remember password");
this._rememberPasswordCheckBox = this.appendCheckbox(this._tableContainer, rememberPasswordLabel, 'connection-input', 'username-password-row', false);
// Azure account picker
let accountLabel = localize('connection.azureAccountDropdownLabel', 'Account');
let accountLabel = localize('connection.azureAccountDropdownLabel', "Account");
let accountDropdown = DialogHelper.appendRow(this._tableContainer, accountLabel, 'connection-label', 'connection-input', 'azure-account-row');
this._azureAccountDropdown = new SelectBox([], undefined, this._contextViewService, accountDropdown, { ariaLabel: accountLabel });
DialogHelper.appendInputSelectBox(accountDropdown, this._azureAccountDropdown);
let refreshCredentials = DialogHelper.appendRow(this._tableContainer, '', 'connection-label', 'connection-input', ['azure-account-row', 'refresh-credentials-link']);
this._refreshCredentialsLink = DOM.append(refreshCredentials, DOM.$('a'));
this._refreshCredentialsLink.href = '#';
this._refreshCredentialsLink.innerText = localize('connectionWidget.refreshAzureCredentials', 'Refresh account credentials');
this._refreshCredentialsLink.innerText = localize('connectionWidget.refreshAzureCredentials', "Refresh account credentials");
// Azure tenant picker
let tenantLabel = localize('connection.azureTenantDropdownLabel', 'Azure AD tenant');
let tenantLabel = localize('connection.azureTenantDropdownLabel', "Azure AD tenant");
let tenantDropdown = DialogHelper.appendRow(this._tableContainer, tenantLabel, 'connection-label', 'connection-input', ['azure-account-row', 'azure-tenant-row']);
this._azureTenantDropdown = new SelectBox([], undefined, this._contextViewService, tenantDropdown, { ariaLabel: tenantLabel });
DialogHelper.appendInputSelectBox(tenantDropdown, this._azureTenantDropdown);
@@ -253,7 +253,7 @@ export class ConnectionWidget {
placeholder: this._defaultDatabaseName,
maxHeight: 125,
ariaLabel: databaseOption.displayName,
actionLabel: localize('connectionWidget.toggleDatabaseNameDropdown', 'Select Database Toggle Dropdown')
actionLabel: localize('connectionWidget.toggleDatabaseNameDropdown', "Select Database Toggle Dropdown")
});
}
}
@@ -269,13 +269,13 @@ export class ConnectionWidget {
protected addConnectionNameOptions(): void {
// Connection name
let connectionNameOption = this._optionsMaps[ConnectionOptionSpecialType.connectionName];
connectionNameOption.displayName = localize('connectionName', 'Name (optional)');
connectionNameOption.displayName = localize('connectionName', "Name (optional)");
let connectionNameBuilder = DialogHelper.appendRow(this._tableContainer, connectionNameOption.displayName, 'connection-label', 'connection-input');
this._connectionNameInputBox = new InputBox(connectionNameBuilder, this._contextViewService, { ariaLabel: connectionNameOption.displayName });
}
protected addAdvancedOptions(): void {
let AdvancedLabel = localize('advanced', 'Advanced...');
let AdvancedLabel = localize('advanced', "Advanced...");
this._advancedButton = this.createAdvancedButton(this._tableContainer, AdvancedLabel);
}
@@ -754,7 +754,7 @@ export class ConnectionWidget {
if (selected === '' || selected === this._addAzureAccountMessage) {
if (showMessage) {
this._azureAccountDropdown.showMessage({
content: localize('connectionWidget.invalidAzureAccount', 'You must select an account'),
content: localize('connectionWidget.invalidAzureAccount', "You must select an account"),
type: MessageType.ERROR
});
}

View File

@@ -115,7 +115,7 @@ export class NewDashboardTabDialog extends Modal {
@ILogService logService: ILogService
) {
super(
localize('newDashboardTab.openDashboardExtensions', 'Open dashboard extensions'),
localize('newDashboardTab.openDashboardExtensions', "Open dashboard extensions"),
TelemetryKeys.AddNewDashboardTab,
telemetryService,
layoutService,
@@ -143,8 +143,8 @@ export class NewDashboardTabDialog extends Modal {
super.render();
attachModalDialogStyler(this, this._themeService);
this._addNewTabButton = this.addFooterButton(localize('newDashboardTab.ok', 'OK'), () => this.addNewTabs());
this._cancelButton = this.addFooterButton(localize('newDashboardTab.cancel', 'Cancel'), () => this.cancel());
this._addNewTabButton = this.addFooterButton(localize('newDashboardTab.ok', "OK"), () => this.addNewTabs());
this._cancelButton = this.addFooterButton(localize('newDashboardTab.cancel', "Cancel"), () => this.cancel());
this.registerListeners();
}
@@ -155,7 +155,7 @@ export class NewDashboardTabDialog extends Modal {
this.createExtensionList(this._extensionViewContainer);
this._noExtensionViewContainer = DOM.$('.no-extension-view');
let noExtensionTitle = DOM.append(this._noExtensionViewContainer, DOM.$('.no-extensionTab-label'));
let noExtensionLabel = localize('newdashboardTabDialog.noExtensionLabel', 'No dashboard extensions are installed at this time. Go to Extension Manager to explore recommended extensions.');
let noExtensionLabel = localize('newdashboardTabDialog.noExtensionLabel', "No dashboard extensions are installed at this time. Go to Extension Manager to explore recommended extensions.");
noExtensionTitle.textContent = noExtensionLabel;
DOM.append(container, this._noExtensionViewContainer);

View File

@@ -50,8 +50,8 @@ export class ErrorMessageDialog extends Modal {
@ILogService logService: ILogService
) {
super('', TelemetryKeys.ErrorMessage, telemetryService, layoutService, clipboardService, themeService, logService, contextKeyService, { isFlyout: false, hasTitleIcon: true });
this._okLabel = localize('errorMessageDialog.ok', 'OK');
this._closeLabel = localize('errorMessageDialog.close', 'Close');
this._okLabel = localize('errorMessageDialog.ok', "OK");
this._closeLabel = localize('errorMessageDialog.close', "Close");
}
protected renderBody(container: HTMLElement) {
@@ -71,7 +71,7 @@ export class ErrorMessageDialog extends Modal {
}
private createCopyButton() {
let copyButtonLabel = localize('copyDetails', 'Copy details');
let copyButtonLabel = localize('copyDetails', "Copy details");
this._copyButton = this.addFooterButton(copyButtonLabel, () => this._clipboardService.writeText(this._messageDetails), 'left');
this._copyButton.icon = 'icon scriptToClipboard';
this._copyButton.element.title = copyButtonLabel;

View File

@@ -43,13 +43,13 @@ export class ErrorMessageService implements IErrorMessageService {
let defaultTitle: string;
switch (severity) {
case Severity.Error:
defaultTitle = localize('error', 'Error');
defaultTitle = localize('error', "Error");
break;
case Severity.Warning:
defaultTitle = localize('warning', 'Warning');
defaultTitle = localize('warning', "Warning");
break;
case Severity.Info:
defaultTitle = localize('info', 'Info');
defaultTitle = localize('info', "Info");
}
return defaultTitle;
}

View File

@@ -86,20 +86,20 @@ export class FileBrowserDialog extends Modal {
this._treeContainer = DOM.append(this._body, DOM.$('.tree-view'));
let tableContainer: HTMLElement = DOM.append(DOM.append(this._body, DOM.$('.option-section')), DOM.$('table.file-table-content'));
let pathLabel = localize('filebrowser.filepath', 'Selected path');
let pathLabel = localize('filebrowser.filepath', "Selected path");
let pathBuilder = DialogHelper.appendRow(tableContainer, pathLabel, 'file-input-label', 'file-input-box');
this._filePathInputBox = new InputBox(pathBuilder, this._contextViewService, {
ariaLabel: pathLabel
});
this._fileFilterSelectBox = new SelectBox(['*'], '*', this._contextViewService);
let filterLabel = localize('fileFilter', 'Files of type');
let filterLabel = localize('fileFilter', "Files of type");
let filterBuilder = DialogHelper.appendRow(tableContainer, filterLabel, 'file-input-label', 'file-input-box');
DialogHelper.appendInputSelectBox(filterBuilder, this._fileFilterSelectBox);
this._okButton = this.addFooterButton(localize('fileBrowser.ok', 'OK'), () => this.ok());
this._okButton = this.addFooterButton(localize('fileBrowser.ok', "OK"), () => this.ok());
this._okButton.enabled = false;
this._cancelButton = this.addFooterButton(localize('fileBrowser.discard', 'Discard'), () => this.close());
this._cancelButton = this.addFooterButton(localize('fileBrowser.discard', "Discard"), () => this.close());
this.registerListeners();
this.updateTheme();

View File

@@ -37,7 +37,7 @@ export class FileBrowserViewModel {
this._fileValidationServiceType = fileValidationServiceType;
if (!fileFilters) {
this._fileFilters = [{ label: localize('allFiles', 'All files'), filters: ['*'] }];
this._fileFilters = [{ label: localize('allFiles', "All files"), filters: ['*'] }];
} else {
this._fileFilters = fileFilters;
}

View File

@@ -41,5 +41,5 @@ export async function resolveQueryFilePath(services: ServicesAccessor, filePath:
}
}
throw Error(localize('insightsDidNotFindResolvedFile', 'Could not find query file at any of the following paths :\n {0}', resolvedFilePaths.join('\n')));
throw Error(localize('insightsDidNotFindResolvedFile', "Could not find query file at any of the following paths :\n {0}", resolvedFilePaths.join('\n')));
}

View File

@@ -26,11 +26,11 @@ let notebookProviderType: IJSONSchema = {
default: { provider: '', fileExtensions: [], standardKernels: [] },
properties: {
provider: {
description: localize('carbon.extension.contributes.notebook.provider', 'Identifier of the notebook provider.'),
description: localize('carbon.extension.contributes.notebook.provider', "Identifier of the notebook provider."),
type: 'string'
},
fileExtensions: {
description: localize('carbon.extension.contributes.notebook.fileExtensions', 'What file extensions should be registered to this notebook provider'),
description: localize('carbon.extension.contributes.notebook.fileExtensions', "What file extensions should be registered to this notebook provider"),
oneOf: [
{ type: 'string' },
{
@@ -42,7 +42,7 @@ let notebookProviderType: IJSONSchema = {
]
},
standardKernels: {
description: localize('carbon.extension.contributes.notebook.standardKernels', 'What kernels should be standard with this notebook provider'),
description: localize('carbon.extension.contributes.notebook.standardKernels', "What kernels should be standard with this notebook provider"),
oneOf: [
{
type: 'object',
@@ -101,19 +101,19 @@ let notebookLanguageMagicType: IJSONSchema = {
default: { magic: '', language: '', kernels: [], executionTarget: null },
properties: {
magic: {
description: localize('carbon.extension.contributes.notebook.magic', 'Name of the cell magic, such as "%%sql".'),
description: localize('carbon.extension.contributes.notebook.magic', "Name of the cell magic, such as '%%sql'."),
type: 'string'
},
language: {
description: localize('carbon.extension.contributes.notebook.language', 'The cell language to be used if this cell magic is included in the cell'),
description: localize('carbon.extension.contributes.notebook.language', "The cell language to be used if this cell magic is included in the cell"),
type: 'string'
},
executionTarget: {
description: localize('carbon.extension.contributes.notebook.executionTarget', 'Optional execution target this magic indicates, for example Spark vs SQL'),
description: localize('carbon.extension.contributes.notebook.executionTarget', "Optional execution target this magic indicates, for example Spark vs SQL"),
type: 'string'
},
kernels: {
description: localize('carbon.extension.contributes.notebook.kernels', 'Optional set of kernels this is valid for, e.g. python3, pyspark3, sql'),
description: localize('carbon.extension.contributes.notebook.kernels', "Optional set of kernels this is valid for, e.g. python3, pyspark3, sql"),
oneOf: [
{ type: 'string' },
{

View File

@@ -348,7 +348,7 @@ export class NotebookService extends Disposable implements INotebookService {
async getOrCreateNotebookManager(providerId: string, uri: URI): Promise<INotebookManager> {
if (!uri) {
throw new Error(localize('notebookUriNotDefined', 'No URI was passed when creating a notebook manager'));
throw new Error(localize('notebookUriNotDefined', "No URI was passed when creating a notebook manager"));
}
let uriString = uri.toString();
let managers: INotebookManager[] = this._managersMap.get(uriString);
@@ -472,7 +472,7 @@ export class NotebookService extends Disposable implements INotebookService {
// Should never happen, but if default wasn't registered we should throw
if (!instance) {
throw new Error(localize('notebookServiceNoProvider', 'Notebook provider does not exist'));
throw new Error(localize('notebookServiceNoProvider', "Notebook provider does not exist"));
}
return instance;
}

View File

@@ -8,8 +8,8 @@ import { localize } from 'vs/nls';
import { FutureInternal } from 'sql/workbench/parts/notebook/node/models/modelInterfaces';
import { ConnectionProfile } from 'sql/platform/connection/common/connectionProfile';
export const noKernel: string = localize('noKernel', 'No Kernel');
const runNotebookDisabled = localize('runNotebookDisabled', 'Cannot run cells as no kernel has been configured');
export const noKernel: string = localize('noKernel', "No Kernel");
const runNotebookDisabled = localize('runNotebookDisabled', "Cannot run cells as no kernel has been configured");
let noKernelSpec: nb.IKernelSpec = ({
name: noKernel,
@@ -210,7 +210,7 @@ export class EmptyFuture implements FutureInternal {
msg_type: 'error'
},
content: <nb.IErrorResult>{
ename: localize('errorName', 'Error'),
ename: localize('errorName', "Error"),
evalue: runNotebookDisabled,
output_type: 'error'
},

View File

@@ -39,7 +39,7 @@ export class LocalContentManager implements nb.ContentManager {
}
// else, fallthrough condition
throw new TypeError(localize('nbNotSupported', 'This file does not have a valid notebook format'));
throw new TypeError(localize('nbNotSupported', "This file does not have a valid notebook format"));
}
@@ -69,7 +69,7 @@ export class LocalContentManager implements nb.ContentManager {
}
// else, fallthrough condition
throw new TypeError(localize('nbNotSupported', 'This file does not have a valid notebook format'));
throw new TypeError(localize('nbNotSupported', "This file does not have a valid notebook format"));
}

View File

@@ -232,7 +232,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
this.handleSessionCreated(session);
} else {
let errorMessage = session && session.errorMessage ? session.errorMessage :
nls.localize('OeSessionFailedError', 'Failed to create Object Explorer session');
nls.localize('OeSessionFailedError', "Failed to create Object Explorer session");
this.logService.error(errorMessage);
}
}
@@ -252,7 +252,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
}
else {
errorMessage = session && session.errorMessage ? session.errorMessage :
nls.localize('OeSessionFailedError', 'Failed to create Object Explorer session');
nls.localize('OeSessionFailedError', "Failed to create Object Explorer session");
this.logService.error(errorMessage);
}
// Send on session created about the session to all node providers so they can prepare for node expansion
@@ -472,7 +472,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
if (finalResult) {
if (errorMessages.length > 0) {
if (errorMessages.length > 1) {
errorMessages.unshift(nls.localize('nodeExpansionError', 'Multiple errors:'));
errorMessages.unshift(nls.localize('nodeExpansionError', "Multiple errors:"));
}
errorNode.errorMessage = errorMessages.join('\n');
errorNode.label = errorNode.errorMessage;
@@ -772,7 +772,7 @@ export class ObjectExplorerService implements IObjectExplorerService {
private getUpdatedTreeNode(treeNode: TreeNode): Promise<TreeNode> {
return this.getTreeNode(treeNode.getConnectionProfile().id, treeNode.nodePath).then(treeNode => {
if (!treeNode) {
// throw new Error(nls.localize('treeNodeNoLongerExists', 'The given tree node no longer exists'));
// throw new Error(nls.localize('treeNodeNoLongerExists', "The given tree node no longer exists"));
return undefined;
}
return treeNode;