diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c2c35a..be37581 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [0.5.1] 03-09-2020 + +* Fix: Do not add `xliffSync.baseFile` setting if there is only a single matching file. +* Account for whitespace in missing translation decoration + ## [0.5.0] 08-08-2020 * Better XLIFF 2.0 support: diff --git a/README.md b/README.md index ccf4a7e..51d968d 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ A VSCode extension to keep XLIFF translation files in sync with a specified, automatically generated base-XLIFF file. +**Update**: There is now also an ["XLIFF Sync" PowerShell module](https://github.com/rvanbekkum/ps-xliff-sync)! + This project originated from the need for a tool to automatically merge/synchronize XLIFF translation files that are in the OASIS specification. This extension is based on the [Angular Localization Helper](https://github.com/manux54/vsc-angular-localization-helper) developed by [manux54](https://github.com/manux54), which has been extended so that it can also be used to synchronize files from other XLIFF generators. It is specifically targeted at synchronizing trans-units from an `.g.xlf` file automatically generated by the [AL Language](https://marketplace.visualstudio.com/items?itemName=ms-dynamics-smb.al) extension that can be used to develop extensions for Microsoft Dynamics 365 Business Central. diff --git a/package.json b/package.json index 8243c71..b172f25 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "xliff-sync", "displayName": "XLIFF Sync", "description": "A tool to keep XLIFF translation files in sync.", - "version": "0.5.0", + "version": "0.5.1", "publisher": "rvanbekkum", "repository": { "type": "git", diff --git a/src/features/tools/files-helper.ts b/src/features/tools/files-helper.ts index 5501e5a..00bd61f 100644 --- a/src/features/tools/files-helper.ts +++ b/src/features/tools/files-helper.ts @@ -89,7 +89,12 @@ export class FilesHelper { const sourceUris: Uri[] | undefined = baseFile ? xliffUris.filter((uri) => uri.fsPath.indexOf(baseFile) >= 0) : undefined; if (sourceUris) { - sourceUri = await this.selectBaseFile(sourceUris, resourceUri); + if (sourceUris.length === 1) { + sourceUri = sourceUris[0]; + } + else { + sourceUri = await this.selectBaseFile(sourceUris, resourceUri); + } } if (!sourceUri) { diff --git a/src/features/trans-check.ts b/src/features/trans-check.ts index ba4935d..61133b0 100644 --- a/src/features/trans-check.ts +++ b/src/features/trans-check.ts @@ -242,13 +242,13 @@ export class XliffTranslationChecker { 'missingTranslation' ]; if (missingTranslationKeyword === '%EMPTY%') { - missingTranslationKeyword = '|'; + missingTranslationKeyword = '|'; } else if (decorationTargetTextOnly) { - missingTranslationKeyword = `(?<=)${missingTranslationKeyword}(?=)`; + missingTranslationKeyword = `(?<=)${missingTranslationKeyword}(?=)`; } else { - missingTranslationKeyword = `${missingTranslationKeyword}`; + missingTranslationKeyword = `${missingTranslationKeyword}`; } return missingTranslationKeyword; }