mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
added import-extensions-xlf gulp task (#15966)
* added import-extensions-xlf gulp task * combined export and import * changed vscode-translations-export * added rename vscode langpacks task * added node command to import language xlfs * fixed import language xlfs command * added comments * removed import script as we need to investigate localization
This commit is contained in:
@@ -484,7 +484,7 @@ function processNlsFiles(opts) {
|
||||
exports.processNlsFiles = processNlsFiles;
|
||||
const editorProject = 'vscode-editor', workbenchProject = 'vscode-workbench', extensionsProject = 'vscode-extensions', setupProject = 'vscode-setup';
|
||||
// {{SQL CARBON EDIT}}
|
||||
const sqlopsProject = 'sqlops-core';
|
||||
const adsProject = 'ads-core';
|
||||
function getResource(sourceFile) {
|
||||
let resource;
|
||||
if (/^vs\/platform/.test(sourceFile)) {
|
||||
@@ -515,7 +515,7 @@ function getResource(sourceFile) {
|
||||
}
|
||||
// {{SQL CARBON EDIT}}
|
||||
else if (/^sql/.test(sourceFile)) {
|
||||
return { name: 'sql', project: sqlopsProject };
|
||||
return { name: 'sql', project: adsProject };
|
||||
}
|
||||
throw new Error(`Could not identify the XLF bundle for ${sourceFile}`);
|
||||
}
|
||||
|
||||
@@ -611,7 +611,7 @@ const editorProject: string = 'vscode-editor',
|
||||
setupProject: string = 'vscode-setup';
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
const sqlopsProject: string = 'sqlops-core';
|
||||
const adsProject: string = 'ads-core';
|
||||
|
||||
export function getResource(sourceFile: string): Resource {
|
||||
let resource: string;
|
||||
@@ -638,7 +638,7 @@ export function getResource(sourceFile: string): Resource {
|
||||
|
||||
// {{SQL CARBON EDIT}}
|
||||
else if (/^sql/.test(sourceFile)) {
|
||||
return { name: 'sql', project: sqlopsProject };
|
||||
return { name: 'sql', project: adsProject };
|
||||
}
|
||||
|
||||
throw new Error(`Could not identify the XLF bundle for ${sourceFile}`);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.refreshLangpacks = exports.modifyI18nPackFiles = exports.packageSingleExtensionStream = exports.packageLangpacksStream = void 0;
|
||||
exports.renameVscodeLangpacks = exports.refreshLangpacks = exports.modifyI18nPackFiles = exports.packageSingleExtensionStream = exports.packageLangpacksStream = void 0;
|
||||
const es = require("event-stream");
|
||||
const path = require("path");
|
||||
const glob = require("glob");
|
||||
@@ -340,3 +340,37 @@ function refreshLangpacks() {
|
||||
return Promise.resolve();
|
||||
}
|
||||
exports.refreshLangpacks = refreshLangpacks;
|
||||
/**
|
||||
* Function for adding replacing ads language packs with vscode ones.
|
||||
* For new languages, remember to add to i18n.extraLanguages so that it will be recognized by ADS.
|
||||
*/
|
||||
function renameVscodeLangpacks() {
|
||||
let supportedLocations = [...i18n.defaultLanguages, ...i18n.extraLanguages];
|
||||
for (let i = 0; i < supportedLocations.length; i++) {
|
||||
let langId = supportedLocations[i].id;
|
||||
if (langId === "zh-cn") {
|
||||
langId = "zh-hans";
|
||||
}
|
||||
if (langId === "zh-tw") {
|
||||
langId = "zh-hant";
|
||||
}
|
||||
let locADSFolder = path.join('.', 'i18n', `ads-language-pack-${langId}`);
|
||||
let locVSCODEFolder = path.join('.', 'i18n', `vscode-language-pack-${langId}`);
|
||||
try {
|
||||
fs.statSync(locVSCODEFolder);
|
||||
}
|
||||
catch (_a) {
|
||||
console.log('vscode pack is not in ADS yet: ' + langId);
|
||||
continue;
|
||||
}
|
||||
gulp.src(`i18n/ads-language-pack-${langId}/*.md`)
|
||||
.pipe(vfs.dest(locVSCODEFolder, { overwrite: true }))
|
||||
.end(function () {
|
||||
rimraf.sync(locADSFolder);
|
||||
fs.renameSync(locVSCODEFolder, locADSFolder);
|
||||
});
|
||||
}
|
||||
console.log("Langpack Rename Completed.");
|
||||
return Promise.resolve();
|
||||
}
|
||||
exports.renameVscodeLangpacks = renameVscodeLangpacks;
|
||||
|
||||
@@ -362,3 +362,40 @@ export function refreshLangpacks(): Promise<void> {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for adding replacing ads language packs with vscode ones.
|
||||
* For new languages, remember to add to i18n.extraLanguages so that it will be recognized by ADS.
|
||||
*/
|
||||
export function renameVscodeLangpacks(): Promise<void> {
|
||||
let supportedLocations = [...i18n.defaultLanguages, ...i18n.extraLanguages];
|
||||
|
||||
|
||||
for (let i = 0; i < supportedLocations.length; i++) {
|
||||
let langId = supportedLocations[i].id;
|
||||
if (langId === "zh-cn") {
|
||||
langId = "zh-hans";
|
||||
}
|
||||
if (langId === "zh-tw") {
|
||||
langId = "zh-hant";
|
||||
}
|
||||
let locADSFolder = path.join('.', 'i18n', `ads-language-pack-${langId}`);
|
||||
let locVSCODEFolder = path.join('.', 'i18n', `vscode-language-pack-${langId}`);
|
||||
try {
|
||||
fs.statSync(locVSCODEFolder);
|
||||
}
|
||||
catch {
|
||||
console.log('vscode pack is not in ADS yet: ' + langId);
|
||||
continue;
|
||||
}
|
||||
gulp.src(`i18n/ads-language-pack-${langId}/*.md`)
|
||||
.pipe(vfs.dest(locVSCODEFolder, {overwrite: true}))
|
||||
.end(function () {
|
||||
rimraf.sync(locADSFolder);
|
||||
fs.renameSync(locVSCODEFolder, locADSFolder);
|
||||
});
|
||||
}
|
||||
|
||||
console.log("Langpack Rename Completed.");
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ exports.rollupAngular = void 0;
|
||||
const fs = require("fs");
|
||||
const rollup = require("rollup");
|
||||
const path = require("path");
|
||||
// getting around stupid import rules
|
||||
// getting around import rules
|
||||
const nodeResolve = require('rollup-plugin-node-resolve');
|
||||
const commonjs = require('rollup-plugin-commonjs');
|
||||
async function rollupModule(options) {
|
||||
|
||||
Reference in New Issue
Block a user