Move dacpac and schema compare localized strings (#9107)

* move localized strings

* move schema compare localized strings
This commit is contained in:
Kim Santiago
2020-02-10 13:30:52 -08:00
committed by GitHub
parent eac05c85f1
commit 45341d786b
17 changed files with 1166 additions and 1078 deletions

View File

@@ -0,0 +1,68 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vscode-nls';
const localize = nls.loadMessageBundle();
// Labels
export const targetServer = localize('dacFx.targetServer', "Target Server");
export const sourceServer = localize('dacFx.sourceServer', "Source Server");
export const sourceDatabase = localize('dacFx.sourceDatabase', "Source Database");
export const targetDatabase = localize('dacFx.targetDatabase', "Target Database");
export const fileLocation = localize('dacfx.fileLocation', "File Location");
export const selectFile = localize('dacfx.selectFile', "Select file");
export const summaryTableTitle = localize('dacfx.summaryTableTitle', "Summary of settings");
export const version = localize('dacfx.version', "Version");
export const setting = localize('dacfx.setting', "Setting");
export const value = localize('dacfx.value', "Value");
export const databaseName = localize('dacFx.databaseName', "Database Name");
export const open = localize('dacFxDeploy.openFile', "Open");
export const upgradeExistingDatabase = localize('dacFx.upgradeExistingDatabase', "Upgrade Existing Database");
export const newDatabase = localize('dacFx.newDatabase', "New Database");
export function dataLossTextWithCount(count: number): string { return localize('dacfx.dataLossTextWithCount', "{0} of the deploy actions listed may result in data loss. Please ensure you have a backup or snapshot available in the event of an issue with the deployment.", count); }
export const proceedDataLossMessage = localize('dacFx.proceedDataLoss', "Proceed despite possible data loss");
export const noDataLossMessage = localize('dacfx.noDataLoss', "No data loss will occur from the listed deploy actions.");
export const dataLossMessage = localize('dacfx.dataLossText', "The deploy actions may result in data loss. Please ensure you have a backup or snapshot available in the event of an issue with the deployment.");
export const operation = localize('dacfx.operation', "Operation");
export const operationTooltip = localize('dacfx.operationTooltip', "Operation(Create, Alter, Delete) that will occur during deployment");
export const type = localize('dacfx.type', "Type");
export const typeTooltip = localize('dacfx.typeTooltip', "Type of object that will be affected by deployment");
export const object = localize('dacfx.object', "Object");
export const objectTooltip = localize('dacfx.objecTooltip', "Name of object that will be affected by deployment");
export const dataLoss = localize('dacfx.dataLoss', "Data Loss");
export const dataLossTooltip = localize('dacfx.dataLossTooltip', "Operations that may result in data loss are marked with a warning sign");
export const save = localize('dacfx.save', "Save");
export const versionText = localize('dacFx.versionText', "Version (use x.x.x.x where x is a number)");
export const deployDescription = localize('dacFx.deployDescription', "Deploy a data-tier application .dacpac file to an instance of SQL Server [Deploy Dacpac]");
export const extractDescription = localize('dacFx.extractDescription', "Extract a data-tier application from an instance of SQL Server to a .dacpac file [Extract Dacpac]");
export const importDescription = localize('dacFx.importDescription', "Create a database from a .bacpac file [Import Bacpac]");
export const exportDescription = localize('dacFx.exportDescription', "Export the schema and data from a database to the logical .bacpac file format [Export Bacpac]");
export const wizardTitle = localize('dacfx.wizardTitle', "Data-tier Application Wizard");
export const selectOperationPageName = localize('dacFx.selectOperationPageName', "Select an Operation");
export const deployConfigPageName = localize('dacFx.deployConfigPageName', "Select Deploy Dacpac Settings");
export const deployPlanPageName = localize('dacFx.deployPlanPageName', "Review the deploy plan");
export const summaryPageName = localize('dacFx.summaryPageName', "Summary");
export const extractConfigPageName = localize('dacFx.extractConfigPageName', "Select Extract Dacpac Settings");
export const importConfigPageName = localize('dacFx.importConfigPageName', "Select Import Bacpac Settings");
export const exportConfigPageName = localize('dacFx.exportConfigPageName', "Select Export Bacpac Settings");
export const deploy = localize('dacFx.deployButton', "Deploy");
export const extract = localize('dacFx.extract', "Extract");
export const importText = localize('dacFx.import', "Import");
export const exportText = localize('dacFx.export', "Export");
export const generateScript = localize('dacFx.generateScriptButton', "Generate Script");
export const generatingScriptMessage = localize('dacfx.scriptGeneratingMessage', "You can view the status of script generation in the Tasks View once the wizard is closed. The generated script will open when complete.");
export const defaultText = localize('dacfx.default', "default");
// Error messages
export const databaseNameExistsErrorMessage = localize('dacfx.databaseNameExistsErrorMessage', "A database with the same name already exists on the instance of SQL Server");
export const undefinedFilenameErrorMessage = localize('dacfx.undefinedFilenameErrorMessage', "Undefined name");
export const filenameEndingIsPeriodErrorMessage = localize('dacfx.filenameEndingInPeriodErrorMessage', "File name cannot end with a period");
export const whitespaceFilenameErrorMessage = localize('dacfx.whitespaceFilenameErrorMessage', "File name cannot be whitespace");
export const invalidFileCharsErrorMessage = localize('dacfx.invalidFileCharsErrorMessage', "Invalid file characters");
export const reservedWindowsFilenameErrorMessage = localize('dacfx.reservedWindowsFilenameErrorMessage', "This file name is reserved for use by Windows. Choose another name and try again");
export const reservedValueErrorMessage = localize('dacfx.reservedValueErrorMessage', "Reserved file name. Choose another name and try again");
export const trailingWhitespaceErrorMessage = localize('dacfx.trailingWhitespaceErrorMessage', "File name cannot end with a whitespace");
export const tooLongFilenameErrorMessage = localize('dacfx.tooLongFilenameErrorMessage', "File name is over 255 characters");
export function deployPlanErrorMessage(errorMessage: string): string { return localize('dacfx.deployPlanErrorMessage', "Generating deploy plan failed '{0}'", errorMessage ? errorMessage : 'Unknown'); }

View File

@@ -4,11 +4,9 @@
*--------------------------------------------------------------------------------------------*/
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
import * as loc from '../../localizedConstants';
import { DacFxDataModel } from './models';
const localize = nls.loadMessageBundle();
export abstract class BasePage {
protected readonly wizardPage: azdata.window.WizardPage;
@@ -75,7 +73,7 @@ export abstract class BasePage {
let srv = c.options.server;
if (!usr) {
usr = localize('basePage.defaultUser', "default");
usr = loc.defaultText;
}
let finalName = `${srv} (${usr})`;

View File

@@ -4,17 +4,15 @@
*--------------------------------------------------------------------------------------------*/
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
import * as vscode from 'vscode';
import * as os from 'os';
import * as path from 'path';
import * as loc from '../../localizedConstants';
import { DataTierApplicationWizard, Operation } from '../dataTierApplicationWizard';
import { DacFxDataModel } from './models';
import { BasePage } from './basePage';
import { sanitizeStringForFilename, isValidBasename, isValidBasenameErrorMessage } from './utils';
const localize = nls.loadMessageBundle();
export abstract class DacFxConfigPage extends BasePage {
protected readonly wizardPage: azdata.window.WizardPage;
@@ -44,7 +42,7 @@ export abstract class DacFxConfigPage extends BasePage {
}
protected async createServerDropdown(isTargetServer: boolean): Promise<azdata.FormComponent> {
const serverDropDownTitle = isTargetServer ? localize('dacFx.targetServerDropdownTitle', "Target Server") : localize('dacFx.sourceServerDropdownTitle', "Source Server");
const serverDropDownTitle = isTargetServer ? loc.targetServer : loc.sourceServer;
this.serverDropdown = this.view.modelBuilder.dropDown().withProperties({
required: true,
ariaLabel: serverDropDownTitle
@@ -87,7 +85,7 @@ export abstract class DacFxConfigPage extends BasePage {
.withValidation(component => !this.databaseNameExists(component.value))
.withProperties({
required: true,
validationErrorMessage: localize('dacfx.databaseNameExistsErrorMessage', "A database with the same name already exists on the instance of SQL Server")
validationErrorMessage: loc.databaseNameExistsErrorMessage
}).component();
this.databaseTextBox.ariaLabel = title;
@@ -102,7 +100,7 @@ export abstract class DacFxConfigPage extends BasePage {
}
protected async createDatabaseDropdown(): Promise<azdata.FormComponent> {
const databaseDropdownTitle = localize('dacFx.sourceDatabaseDropdownTitle', "Source Database");
const databaseDropdownTitle = loc.sourceDatabase;
this.databaseDropdown = this.view.modelBuilder.dropDown().withProperties({
ariaLabel: databaseDropdownTitle
}).component();
@@ -174,11 +172,11 @@ export abstract class DacFxConfigPage extends BasePage {
}
});
this.fileTextBox.ariaLabel = localize('dacfx.fileLocationAriaLabel', "File Location");
this.fileTextBox.ariaLabel = loc.fileLocation;
this.fileButton = this.view.modelBuilder.button().withProperties({
label: '•••',
title: localize('dacfx.selectFile', "Select file"),
ariaLabel: localize('dacfx.selectFile', "Select file")
title: loc.selectFile,
ariaLabel: loc.selectFile
}).component();
}

View File

@@ -4,12 +4,11 @@
*--------------------------------------------------------------------------------------------*/
import * as os from 'os';
import * as path from 'path';
import * as nls from 'vscode-nls';
import * as loc from '../../localizedConstants';
const WINDOWS_INVALID_FILE_CHARS = /[\\/:\*\?"<>\|]/g;
const UNIX_INVALID_FILE_CHARS = /[\\/]/g;
const isWindows = os.platform() === 'win32';
const WINDOWS_FORBIDDEN_NAMES = /^(con|prn|aux|clock\$|nul|lpt[0-9]|com[0-9])$/i;
const localize = nls.loadMessageBundle();
/**
* Determines if a given character is a valid filename character
@@ -99,38 +98,37 @@ export function isValidBasename(name: string | null | undefined): boolean {
export function isValidBasenameErrorMessage(name: string | null | undefined): string {
const invalidFileChars = isWindows ? WINDOWS_INVALID_FILE_CHARS : UNIX_INVALID_FILE_CHARS;
if (!name) {
return localize('dacfx.undefinedFileNameErrorMessage', "Undefined name");
return loc.undefinedFilenameErrorMessage;
}
if (isWindows && name[name.length - 1] === '.') {
return localize('dacfx.fileNameEndingInPeriodErrorMessage', "File name cannot end with a period"); // Windows: file cannot end with a "."
return loc.filenameEndingIsPeriodErrorMessage; // Windows: file cannot end with a "."
}
let basename = path.parse(name).name;
if (!basename || basename.length === 0 || /^\s+$/.test(basename)) {
return localize('dacfx.whitespaceFilenameErrorMessage', "File name cannot be whitespace"); // require a name that is not just whitespace
return loc.whitespaceFilenameErrorMessage; // require a name that is not just whitespace
}
invalidFileChars.lastIndex = 0;
if (invalidFileChars.test(basename)) {
return localize('dacfx.invalidFileCharsErrorMessage', "Invalid file characters"); // check for certain invalid file characters
return loc.invalidFileCharsErrorMessage; // check for certain invalid file characters
}
if (isWindows && WINDOWS_FORBIDDEN_NAMES.test(basename)) {
console.error('here');
return localize('dacfx.reservedWindowsFileNameErrorMessage', "This file name is reserved for use by Windows. Choose another name and try again"); // check for certain invalid file names
return loc.reservedWindowsFilenameErrorMessage; // check for certain invalid file names
}
if (basename === '.' || basename === '..') {
return localize('dacfx.reservedValueErrorMessage', "Reserved file name. Choose another name and try again"); // check for reserved values
return loc.reservedWindowsFilenameErrorMessage; // check for reserved values
}
if (isWindows && basename.length !== basename.trim().length) {
return localize('dacfx.trailingWhitespaceErrorMessage', "File name cannot end with a whitespace"); // Windows: file cannot end with a whitespace
return loc.trailingWhitespaceErrorMessage; // Windows: file cannot end with a whitespace
}
if (basename.length > 255) {
return localize('dacfx.tooLongFileNameErrorMessage', "File name is over 255 characters"); // most file systems do not allow files > 255 length
return loc.tooLongFilenameErrorMessage; // most file systems do not allow files > 255 length
}
return '';

View File

@@ -4,8 +4,8 @@
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import * as azdata from 'azdata';
import * as loc from '../localizedConstants';
import { SelectOperationPage } from './pages/selectOperationpage';
import { DeployConfigPage } from './pages/deployConfigPage';
import { DeployPlanPage } from './pages/deployPlanPage';
@@ -17,7 +17,6 @@ import { DacFxDataModel } from './api/models';
import { BasePage } from './api/basePage';
import * as mssql from '../../../mssql';
const localize = nls.loadMessageBundle();
const msSqlProvider = 'MSSQL';
class Page {
wizardPage: azdata.window.WizardPage;
@@ -109,14 +108,14 @@ export class DataTierApplicationWizard {
this.model.serverId = this.connection.connectionId;
this.wizard = azdata.window.createWizard(localize('dacfx.wizardTitle', "Data-tier Application Wizard"));
let selectOperationWizardPage = azdata.window.createWizardPage(localize('dacFx.selectOperationPageName', "Select an Operation"));
let deployConfigWizardPage = azdata.window.createWizardPage(localize('dacFx.deployConfigPageName', "Select Deploy Dacpac Settings"));
let deployPlanWizardPage = azdata.window.createWizardPage(localize('dacFx.deployPlanPage', "Review the deploy plan"));
let summaryWizardPage = azdata.window.createWizardPage(localize('dacFx.summaryPageName', "Summary"));
let extractConfigWizardPage = azdata.window.createWizardPage(localize('dacFx.extractConfigPageName', "Select Extract Dacpac Settings"));
let importConfigWizardPage = azdata.window.createWizardPage(localize('dacFx.importConfigPageName', "Select Import Bacpac Settings"));
let exportConfigWizardPage = azdata.window.createWizardPage(localize('dacFx.exportConfigPageName', "Select Export Bacpac Settings"));
this.wizard = azdata.window.createWizard(loc.wizardTitle);
let selectOperationWizardPage = azdata.window.createWizardPage(loc.selectOperationPageName);
let deployConfigWizardPage = azdata.window.createWizardPage(loc.deployConfigPageName);
let deployPlanWizardPage = azdata.window.createWizardPage(loc.deployPlanPageName);
let summaryWizardPage = azdata.window.createWizardPage(loc.summaryPageName);
let extractConfigWizardPage = azdata.window.createWizardPage(loc.extractConfigPageName);
let importConfigWizardPage = azdata.window.createWizardPage(loc.importConfigPageName);
let exportConfigWizardPage = azdata.window.createWizardPage(loc.exportConfigPageName);
this.pages.set(PageName.selectOperation, new Page(selectOperationWizardPage));
this.pages.set(PageName.deployConfig, new Page(deployConfigWizardPage));
@@ -201,27 +200,27 @@ export class DataTierApplicationWizard {
public setDoneButton(operation: Operation): void {
switch (operation) {
case Operation.deploy: {
this.wizard.doneButton.label = localize('dacFx.deployButton', "Deploy");
this.wizard.doneButton.label = loc.deploy;
this.selectedOperation = Operation.deploy;
break;
}
case Operation.extract: {
this.wizard.doneButton.label = localize('dacFx.extractButton', "Extract");
this.wizard.doneButton.label = loc.extract;
this.selectedOperation = Operation.extract;
break;
}
case Operation.import: {
this.wizard.doneButton.label = localize('dacFx.importButton', "Import");
this.wizard.doneButton.label = loc.importText;
this.selectedOperation = Operation.import;
break;
}
case Operation.export: {
this.wizard.doneButton.label = localize('dacFx.exportButton', "Export");
this.wizard.doneButton.label = loc.exportText;
this.selectedOperation = Operation.export;
break;
}
case Operation.generateDeployScript: {
this.wizard.doneButton.label = localize('dacFx.generateScriptButton', "Generate Script");
this.wizard.doneButton.label = loc.generateScript;
this.selectedOperation = Operation.generateDeployScript;
break;
}
@@ -289,7 +288,7 @@ export class DataTierApplicationWizard {
const service = await DataTierApplicationWizard.getService(msSqlProvider);
const ownerUri = await azdata.connection.getUriForConnection(this.model.server.connectionId);
this.wizard.message = {
text: localize('dacfx.scriptGeneratingMessage', "You can view the status of script generation in the Tasks View once the wizard is closed. The generated script will open when complete."),
text: loc.generatingScriptMessage,
level: azdata.window.MessageLevel.Information,
description: ''
};
@@ -343,8 +342,7 @@ export class DataTierApplicationWizard {
const result = await service.generateDeployPlan(this.model.filePath, this.model.database, ownerUri, azdata.TaskExecutionMode.execute);
if (!result || !result.success) {
vscode.window.showErrorMessage(
localize('alertData.deployPlanErrorMessage', "Generating deploy plan failed '{0}'", result.errorMessage ? result.errorMessage : 'Unknown'));
vscode.window.showErrorMessage(loc.deployPlanErrorMessage(result.errorMessage));
}
return result.report;

View File

@@ -4,13 +4,11 @@
*--------------------------------------------------------------------------------------------*/
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
import * as loc from '../../localizedConstants';
import { DacFxDataModel } from '../api/models';
import { DataTierApplicationWizard, Operation } from '../dataTierApplicationWizard';
import { BasePage } from '../api/basePage';
const localize = nls.loadMessageBundle();
export class DacFxSummaryPage extends BasePage {
protected readonly wizardPage: azdata.window.WizardPage;
@@ -32,7 +30,7 @@ export class DacFxSummaryPage extends BasePage {
async start(): Promise<boolean> {
this.table = this.view.modelBuilder.table().withProperties({
title: localize('dacfx.summaryTableTitle', "Summary of settings")
title: loc.summaryTableTitle
}).component();
this.loader = this.view.modelBuilder.loadingComponent().withItem(this.table).component();
this.form = this.view.modelBuilder.formContainer().withFormItems(
@@ -75,11 +73,11 @@ export class DacFxSummaryPage extends BasePage {
private populateTable() {
let data = [];
let targetServer = localize('dacfx.targetServerName', "Target Server");
let targetDatabase = localize('dacfx.targetDatabaseName', "Target Database");
let sourceServer = localize('dacfx.sourceServerName', "Source Server");
let sourceDatabase = localize('dacfx.sourceDatabaseName', "Source Database");
let fileLocation = localize('dacfx.fileLocation', "File Location");
let targetServer = loc.targetServer;
let targetDatabase = loc.targetDatabase;
let sourceServer = loc.sourceServer;
let sourceDatabase = loc.sourceDatabase;
let fileLocation = loc.fileLocation;
switch (this.instance.selectedOperation) {
case Operation.deploy: {
@@ -93,7 +91,7 @@ export class DacFxSummaryPage extends BasePage {
data = [
[sourceServer, this.model.serverName],
[sourceDatabase, this.model.database],
[localize('dacfxExtract.version', "Version"), this.model.version],
[loc.version, this.model.version],
[fileLocation, this.model.filePath]];
break;
}
@@ -124,11 +122,11 @@ export class DacFxSummaryPage extends BasePage {
data: data,
columns: [
{
value: localize('dacfx.settingColumn', "Setting"),
value: loc.setting,
cssClass: 'align-with-header'
},
{
value: localize('dacfx.valueColumn', "Value"),
value: loc.value,
cssClass: 'align-with-header'
}],
width: 700,

View File

@@ -4,15 +4,13 @@
*--------------------------------------------------------------------------------------------*/
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
import * as vscode from 'vscode';
import * as path from 'path';
import * as loc from '../../localizedConstants';
import { DacFxDataModel } from '../api/models';
import { DataTierApplicationWizard, DeployOperationPath, Operation, DeployNewOperationPath, PageName } from '../dataTierApplicationWizard';
import { DacFxConfigPage } from '../api/dacFxConfigPage';
const localize = nls.loadMessageBundle();
export class DeployConfigPage extends DacFxConfigPage {
protected readonly wizardPage: azdata.window.WizardPage;
@@ -32,9 +30,9 @@ export class DeployConfigPage extends DacFxConfigPage {
async start(): Promise<boolean> {
let serverComponent = await this.createServerDropdown(true);
let fileBrowserComponent = await this.createFileBrowser();
this.databaseComponent = await this.createDatabaseTextBox(localize('dacFx.databaseNameTextBox', "Database Name"));
this.databaseComponent = await this.createDatabaseTextBox(loc.databaseName);
this.databaseDropdownComponent = await this.createDeployDatabaseDropdown();
this.databaseDropdownComponent.title = localize('dacFx.databaseNameDropdown', "Database Name");
this.databaseDropdownComponent.title = loc.databaseName;
let radioButtons = await this.createRadiobuttons();
this.formBuilder = this.view.modelBuilder.formContainer()
@@ -72,7 +70,7 @@ export class DeployConfigPage extends DacFxConfigPage {
canSelectFolders: false,
canSelectMany: false,
defaultUri: vscode.Uri.file(this.getRootPath()),
openLabel: localize('dacFxDeploy.openFile', "Open"),
openLabel: loc.open,
filters: {
'dacpac Files': ['dacpac'],
}
@@ -98,7 +96,7 @@ export class DeployConfigPage extends DacFxConfigPage {
return {
component: this.fileTextBox,
title: localize('dacFxDeploy.fileTextboxTitle', "File Location"),
title: loc.fileLocation,
actions: [this.fileButton]
};
}
@@ -107,13 +105,13 @@ export class DeployConfigPage extends DacFxConfigPage {
let upgradeRadioButton = this.view.modelBuilder.radioButton()
.withProperties({
name: 'updateExisting',
label: localize('dacFx.upgradeRadioButtonLabel', "Upgrade Existing Database"),
label: loc.upgradeExistingDatabase,
}).component();
let newRadioButton = this.view.modelBuilder.radioButton()
.withProperties({
name: 'updateExisting',
label: localize('dacFx.newRadioButtonLabel', "New Database"),
label: loc.newDatabase,
}).component();
upgradeRadioButton.onDidClick(() => {
@@ -157,12 +155,12 @@ export class DeployConfigPage extends DacFxConfigPage {
return {
component: flexRadioButtonsModel,
title: localize('dacFx.targetDatabaseRadioButtonsTitle', "Target Database")
title: loc.targetDatabase
};
}
protected async createDeployDatabaseDropdown(): Promise<azdata.FormComponent> {
const targetDatabaseTitle = localize('dacFx.targetDatabaseDropdownTitle', "Database Name");
const targetDatabaseTitle = loc.databaseName;
this.databaseDropdown = this.view.modelBuilder.dropDown().withProperties({
ariaLabel: targetDatabaseTitle
}).component();

View File

@@ -4,14 +4,12 @@
*--------------------------------------------------------------------------------------------*/
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
import * as parser from 'htmlparser2';
import * as loc from '../../localizedConstants';
import { DacFxDataModel } from '../api/models';
import { DataTierApplicationWizard } from '../dataTierApplicationWizard';
import { DacFxConfigPage } from '../api/dacFxConfigPage';
const localize = nls.loadMessageBundle();
enum deployPlanXml {
AlertElement = 'Alert',
OperationElement = 'Operation',
@@ -105,7 +103,7 @@ export class DeployPlanPage extends DacFxConfigPage {
if (result.dataLossAlerts.size > 0) {
// update message to list how many operations could result in data loss
this.dataLossText.updateProperties({
value: localize('dacfx.dataLossTextWithCount', "{0} of the deploy actions listed may result in data loss. Please ensure you have a backup or snapshot available in the event of an issue with the deployment.", result.dataLossAlerts.size)
value: loc.dataLossTextWithCount(result.dataLossAlerts.size)
});
this.dataLossCheckbox.enabled = true;
} else {
@@ -120,7 +118,7 @@ export class DeployPlanPage extends DacFxConfigPage {
this.dataLossCheckbox = this.view.modelBuilder.checkBox()
.withValidation(component => component.checked === true)
.withProperties({
label: localize('dacFx.dataLossCheckbox', "Proceed despite possible data loss"),
label: loc.proceedDataLossMessage,
}).component();
return {
@@ -133,7 +131,7 @@ export class DeployPlanPage extends DacFxConfigPage {
private async createNoDataLossText(): Promise<azdata.FormComponent> {
let noDataLossText = this.view.modelBuilder.text()
.withProperties({
value: localize('dacfx.noDataLossText', "No data loss will occur from the listed deploy actions.")
value: loc.noDataLossMessage
}).component();
return {
@@ -146,7 +144,7 @@ export class DeployPlanPage extends DacFxConfigPage {
let dataLossComponent = await this.createDataLossCheckbox();
this.dataLossText = this.view.modelBuilder.text()
.withProperties({
value: localize('dacfx.dataLossText', "The deploy actions may result in data loss. Please ensure you have a backup or snapshot available in the event of an issue with the deployment.")
value: loc.dataLossMessage
}).component();
return {
@@ -179,31 +177,31 @@ export class DeployPlanPage extends DacFxConfigPage {
private getTableColumns(dataloss: boolean): azdata.TableColumn[] {
let columns: azdata.TableColumn[] = [
{
value: localize('dacfx.operationColumn', "Operation"),
value: loc.operation,
width: 75,
cssClass: 'align-with-header',
toolTip: localize('dacfx.operationTooltip', "Operation(Create, Alter, Delete) that will occur during deployment")
toolTip: loc.operationTooltip
},
{
value: localize('dacfx.typeColumn', "Type"),
value: loc.type,
width: 100,
cssClass: 'align-with-header',
toolTip: localize('dacfx.typeTooltip', "Type of object that will be affected by deployment")
toolTip: loc.typeTooltip
},
{
value: localize('dacfx.objectColumn', "Object"),
value: loc.object,
width: 300,
cssClass: 'align-with-header',
toolTip: localize('dacfx.objecTooltip', "Name of object that will be affected by deployment")
toolTip: loc.objectTooltip
}];
if (dataloss) {
columns.unshift(
{
value: localize('dacfx.dataLossColumn', "Data Loss"),
value: loc.dataLoss,
width: 50,
cssClass: 'center-align',
toolTip: localize('dacfx.dataLossTooltip', "Operations that may result in data loss are marked with a warning sign")
toolTip: loc.dataLossTooltip
});
}
return columns;

View File

@@ -4,14 +4,12 @@
*--------------------------------------------------------------------------------------------*/
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
import * as vscode from 'vscode';
import * as loc from '../../localizedConstants';
import { DacFxDataModel } from '../api/models';
import { DataTierApplicationWizard } from '../dataTierApplicationWizard';
import { DacFxConfigPage } from '../api/dacFxConfigPage';
const localize = nls.loadMessageBundle();
export class ExportConfigPage extends DacFxConfigPage {
protected readonly wizardPage: azdata.window.WizardPage;
@@ -77,7 +75,7 @@ export class ExportConfigPage extends DacFxConfigPage {
let fileUri = await vscode.window.showSaveDialog(
{
defaultUri: vscode.Uri.file(this.fileTextBox.value),
saveLabel: localize('dacfxExport.saveFile', "Save"),
saveLabel: loc.save,
filters: {
'bacpac Files': ['bacpac'],
}
@@ -98,7 +96,7 @@ export class ExportConfigPage extends DacFxConfigPage {
return {
component: this.fileTextBox,
title: localize('dacFxExport.fileTextboxTitle', "File Location"),
title: loc.fileLocation,
actions: [this.fileButton]
};
}

View File

@@ -4,14 +4,12 @@
*--------------------------------------------------------------------------------------------*/
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
import * as vscode from 'vscode';
import * as loc from '../../localizedConstants';
import { DacFxDataModel } from '../api/models';
import { DataTierApplicationWizard } from '../dataTierApplicationWizard';
import { DacFxConfigPage } from '../api/dacFxConfigPage';
const localize = nls.loadMessageBundle();
export class ExtractConfigPage extends DacFxConfigPage {
protected readonly wizardPage: azdata.window.WizardPage;
@@ -79,7 +77,7 @@ export class ExtractConfigPage extends DacFxConfigPage {
let fileUri = await vscode.window.showSaveDialog(
{
defaultUri: vscode.Uri.file(this.fileTextBox.value),
saveLabel: localize('dacfxExtract.saveFile', "Save"),
saveLabel: loc.save,
filters: {
'dacpac Files': ['dacpac'],
}
@@ -100,7 +98,7 @@ export class ExtractConfigPage extends DacFxConfigPage {
return {
component: this.fileTextBox,
title: localize('dacFxExtract.fileTextboxTitle', "File Location"),
title: loc.fileLocation,
actions: [this.fileButton]
};
}
@@ -108,7 +106,7 @@ export class ExtractConfigPage extends DacFxConfigPage {
private async createVersionTextBox(): Promise<azdata.FormComponent> {
this.versionTextBox = this.view.modelBuilder.inputBox().withProperties({
required: true,
ariaLabel: localize('dacFxExtract.versionTextBoxAriaLabel', "Version")
ariaLabel: loc.version
}).component();
// default version
@@ -121,7 +119,7 @@ export class ExtractConfigPage extends DacFxConfigPage {
return {
component: this.versionTextBox,
title: localize('dacFxExtract.versionTextboxTitle', "Version (use x.x.x.x where x is a number)"),
title: loc.versionText,
};
}
}

View File

@@ -4,15 +4,13 @@
*--------------------------------------------------------------------------------------------*/
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
import * as vscode from 'vscode';
import * as path from 'path';
import * as loc from '../../localizedConstants';
import { DacFxDataModel } from '../api/models';
import { DataTierApplicationWizard } from '../dataTierApplicationWizard';
import { DacFxConfigPage } from '../api/dacFxConfigPage';
const localize = nls.loadMessageBundle();
export class ImportConfigPage extends DacFxConfigPage {
protected readonly wizardPage: azdata.window.WizardPage;
@@ -28,7 +26,7 @@ export class ImportConfigPage extends DacFxConfigPage {
}
async start(): Promise<boolean> {
let databaseComponent = await this.createDatabaseTextBox(localize('dacfx.targetDatabaseAriaLabel', "Target Database"));
let databaseComponent = await this.createDatabaseTextBox(loc.targetDatabase);
let serverComponent = await this.createServerDropdown(true);
let fileBrowserComponent = await this.createFileBrowser();
@@ -63,7 +61,7 @@ export class ImportConfigPage extends DacFxConfigPage {
canSelectFolders: false,
canSelectMany: false,
defaultUri: vscode.Uri.file(this.getRootPath()),
openLabel: localize('dacFxImport.openFile', "Open"),
openLabel: loc.open,
filters: {
'bacpac Files': ['bacpac'],
}
@@ -89,7 +87,7 @@ export class ImportConfigPage extends DacFxConfigPage {
return {
component: this.fileTextBox,
title: localize('dacFxImport.fileTextboxTitle', "File Location"),
title: loc.fileLocation,
actions: [this.fileButton]
};
}

View File

@@ -4,13 +4,11 @@
*--------------------------------------------------------------------------------------------*/
import * as azdata from 'azdata';
import * as nls from 'vscode-nls';
import * as loc from '../../localizedConstants';
import { DacFxDataModel } from '../api/models';
import { DataTierApplicationWizard, Operation, DeployOperationPath, ExtractOperationPath, ImportOperationPath, ExportOperationPath, PageName } from '../dataTierApplicationWizard';
import { BasePage } from '../api/basePage';
const localize = nls.loadMessageBundle();
export class SelectOperationPage extends BasePage {
protected readonly wizardPage: azdata.window.WizardPage;
@@ -63,7 +61,7 @@ export class SelectOperationPage extends BasePage {
this.deployRadioButton = this.view.modelBuilder.radioButton()
.withProperties({
name: 'selectedOperation',
label: localize('dacFx.deployRadioButtonLabel', "Deploy a data-tier application .dacpac file to an instance of SQL Server [Deploy Dacpac]"),
label: loc.deployDescription,
checked: true // Default to first radio button being selected
}).component();
@@ -91,7 +89,7 @@ export class SelectOperationPage extends BasePage {
this.extractRadioButton = this.view.modelBuilder.radioButton()
.withProperties({
name: 'selectedOperation',
label: localize('dacFx.extractRadioButtonLabel', "Extract a data-tier application from an instance of SQL Server to a .dacpac file [Extract Dacpac]"),
label: loc.extractDescription,
}).component();
this.extractRadioButton.onDidClick(() => {
@@ -116,7 +114,7 @@ export class SelectOperationPage extends BasePage {
this.importRadioButton = this.view.modelBuilder.radioButton()
.withProperties({
name: 'selectedOperation',
label: localize('dacFx.importRadioButtonLabel', "Create a database from a .bacpac file [Import Bacpac]"),
label: loc.importDescription,
}).component();
this.importRadioButton.onDidClick(() => {
@@ -141,7 +139,7 @@ export class SelectOperationPage extends BasePage {
this.exportRadioButton = this.view.modelBuilder.radioButton()
.withProperties({
name: 'selectedOperation',
label: localize('dacFx.exportRadioButtonLabel', "Export the schema and data from a database to the logical .bacpac file format [Export Bacpac]"),
label: loc.exportDescription,
}).component();
this.exportRadioButton.onDidClick(() => {