Added small fix for locFunc (#18364)

This commit is contained in:
Alex Ma
2022-02-14 17:21:46 -08:00
committed by GitHub
parent 45763e12b4
commit 9a28d47c5b
2 changed files with 33 additions and 11 deletions

View File

@@ -18,6 +18,13 @@ const File = require("vinyl");
const rimraf = require("rimraf"); const rimraf = require("rimraf");
const gulp = require("gulp"); const gulp = require("gulp");
const vfs = require("vinyl-fs"); const vfs = require("vinyl-fs");
/**
* If you need to compile this file for any changes, please run: yarn tsc -p ./build/tsconfig.json
*/
//List of extensions that we changed from vscode, so we can exclude them from having "Microsoft." appended in front.
const alteredVSCodeExtensions = [
'git'
];
const root = path.dirname(path.dirname(__dirname)); const root = path.dirname(path.dirname(__dirname));
// Modified packageLocalExtensionsStream from extensions.ts, but for langpacks. // Modified packageLocalExtensionsStream from extensions.ts, but for langpacks.
function packageLangpacksStream() { function packageLangpacksStream() {
@@ -134,11 +141,14 @@ function modifyI18nPackFiles(existingTranslationFolder, resultingTranslationPath
for (let extension in extensionsPacks) { for (let extension in extensionsPacks) {
const translatedExtFile = i18n.createI18nFile(`extensions/${extension}`, extensionsPacks[extension]); const translatedExtFile = i18n.createI18nFile(`extensions/${extension}`, extensionsPacks[extension]);
this.queue(translatedExtFile); this.queue(translatedExtFile);
// exclude altered vscode extensions from having a new path even if we provide a new I18n file.
if (alteredVSCodeExtensions.indexOf(extension) === -1) {
//handle edge case for 'Microsoft.sqlservernotebook' where extension name is the same as extension ID. //handle edge case for 'Microsoft.sqlservernotebook' where extension name is the same as extension ID.
//(Other extensions need to have publisher appended in front as their ID.) //(Other extensions need to have publisher appended in front as their ID.)
const adsExtensionId = (extension === 'Microsoft.sqlservernotebook') ? extension : 'Microsoft.' + extension; let adsExtensionId = (extension === 'Microsoft.sqlservernotebook') ? extension : 'Microsoft.' + extension;
resultingTranslationPaths.push({ id: adsExtensionId, resourceName: `extensions/${extension}.i18n.json` }); resultingTranslationPaths.push({ id: adsExtensionId, resourceName: `extensions/${extension}.i18n.json` });
} }
}
this.queue(null); this.queue(null);
}) })
.catch((reason) => { .catch((reason) => {
@@ -162,7 +172,6 @@ const VSCODEExtensions = [
"bat", "bat",
"configuration-editing", "configuration-editing",
"docker", "docker",
"extension-editing",
"git-ui", "git-ui",
"git", "git",
"github-authentication", "github-authentication",

View File

@@ -17,6 +17,15 @@ import * as rimraf from 'rimraf';
import * as gulp from 'gulp'; import * as gulp from 'gulp';
import * as vfs from 'vinyl-fs'; import * as vfs from 'vinyl-fs';
/**
* If you need to compile this file for any changes, please run: yarn tsc -p ./build/tsconfig.json
*/
//List of extensions that we changed from vscode, so we can exclude them from having "Microsoft." appended in front.
const alteredVSCodeExtensions = [
'git'
]
const root = path.dirname(path.dirname(__dirname)); const root = path.dirname(path.dirname(__dirname));
// Modified packageLocalExtensionsStream from extensions.ts, but for langpacks. // Modified packageLocalExtensionsStream from extensions.ts, but for langpacks.
@@ -148,11 +157,15 @@ export function modifyI18nPackFiles(existingTranslationFolder: string, resulting
const translatedExtFile = i18n.createI18nFile(`extensions/${extension}`, extensionsPacks[extension]); const translatedExtFile = i18n.createI18nFile(`extensions/${extension}`, extensionsPacks[extension]);
this.queue(translatedExtFile); this.queue(translatedExtFile);
// exclude altered vscode extensions from having a new path even if we provide a new I18n file.
if (alteredVSCodeExtensions.indexOf(extension) === -1) {
//handle edge case for 'Microsoft.sqlservernotebook' where extension name is the same as extension ID. //handle edge case for 'Microsoft.sqlservernotebook' where extension name is the same as extension ID.
//(Other extensions need to have publisher appended in front as their ID.) //(Other extensions need to have publisher appended in front as their ID.)
const adsExtensionId = (extension === 'Microsoft.sqlservernotebook') ? extension : 'Microsoft.' + extension; let adsExtensionId = (extension === 'Microsoft.sqlservernotebook') ? extension : 'Microsoft.' + extension;
resultingTranslationPaths.push({ id: adsExtensionId, resourceName: `extensions/${extension}.i18n.json` }); resultingTranslationPaths.push({ id: adsExtensionId, resourceName: `extensions/${extension}.i18n.json` });
} }
}
this.queue(null); this.queue(null);
}) })
.catch((reason) => { .catch((reason) => {