Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug with incorrect parsing of command line arguments #222971

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/lib/i18n.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/lib/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ export function prepareI18nPackFiles(resultingTranslationPaths: TranslationPath[
let project = path.basename(path.dirname(path.dirname(xlf.relative)));
// strip `-new` since vscode-extensions-loc uses the `-new` suffix to indicate that it's from the new loc pipeline
const resource = path.basename(path.basename(xlf.relative, '.xlf'), '-new');
if (EXTERNAL_EXTENSIONS.find(e => e === resource)) {
if (path.dirname(xlf.relative) === 'vscode-extensions') {
project = extensionsProject;
}
const contents = xlf.contents.toString();
Expand Down
8 changes: 5 additions & 3 deletions build/npm/update-localization-extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ let rimraf = require('rimraf');
let minimist = require('minimist');

function update(options) {
let idOrPath = options._;
let idOrPath = options._[0];
if (!idOrPath) {
throw new Error('Argument must be the location of the localization extension.');
}
let location = options.location;
if (location !== undefined && !fs.existsSync(location)) {
throw new Error(`${location} doesn't exist.`);
}
let externalExtensionsLocation = options.externalExtensionsLocation;

console.log(options);
let externalExtensionsLocation = options.location;
if (externalExtensionsLocation !== undefined && !fs.existsSync(externalExtensionsLocation)) {
throw new Error(`${externalExtensionsLocation} doesn't exist.`);
}
Expand Down Expand Up @@ -72,7 +74,7 @@ function update(options) {
console.log(`Importing translations for ${languageId} form '${location}' to '${translationDataFolder}' ...`);
let translationPaths = [];
gulp.src([
path.join(location, '**', languageId, '*.xlf'),
path.join(location, languageId, '**', '*.xlf'),
...i18n.EXTERNAL_EXTENSIONS.map(extensionId => path.join(externalExtensionsLocation, extensionId, languageId, '*-new.xlf'))
], { silent: false })
.pipe(i18n.prepareI18nPackFiles(translationPaths))
Expand Down