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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user