Skip to content

Commit

Permalink
Merge branch 'release/1.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob van Bekkum committed Dec 30, 2022
2 parents b1ae856 + 4f4f5ea commit 038b505
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 18 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## [1.4.0] 30-12-2022

* New setting `xliffSync.useSelfClosingTags` that can be used to specify whether to use self-closing tags in the XLIFF target translation files. (GitHub issue [#97](https://github.com/rvanbekkum/vsc-xliff-sync/issues/97))
* Added `LICENSE` file.
* Updated `README` with additional references and Contributors section.

### Thank You

* **[warlof](https://github.com/warlof)** for your pull request (Pull Request [#110](https://github.com/rvanbekkum/vsc-xliff-sync/pull/110)) which adds the `xliffSync.useSelfClosingTags` setting.
* **[eclipses](https://github.com/eclipses)** for reporting GitHub issue [#97](https://github.com/rvanbekkum/vsc-xliff-sync/issues/97).

## [1.3.0] 19-05-2022

* New setting `xliffSync.parseFromDeveloperNoteTrimCharacters` that can be used to specify the characters to trim from the translations parsed from the developer notes. (GitHub issue [#100](https://github.com/rvanbekkum/vsc-xliff-sync/issues/100))
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Rob van Bekkum

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
43 changes: 35 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
# XLIFF Sync

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Version](https://vsmarketplacebadge.apphb.com/version-short/rvanbekkum.xliff-sync.svg?color=blue)](https://marketplace.visualstudio.com/items?itemName=rvanbekkum.xliff-sync)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![Version](https://vsmarketplacebadges.dev/version-short/rvanbekkum.xliff-sync.svg?color=blue)](https://marketplace.visualstudio.com/items?itemName=rvanbekkum.xliff-sync) [![Installs](https://vsmarketplacebadges.dev/installs/rvanbekkum.xliff-sync.svg?color=blue)](https://marketplace.visualstudio.com/items?itemName=rvanbekkum.xliff-sync)

A VSCode extension to keep XLIFF translation files in sync with a specified, automatically generated base-XLIFF file.
<a href="https://www.buymeacoffee.com/robvanbekkum" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>

**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 `<ApplicationName>.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.
A VSCode extension to keep XLIFF translation files in sync with an automatically generated base-XLIFF file.

Note that there is also an ["XLIFF Sync" PowerShell module](https://github.com/rvanbekkum/ps-xliff-sync)!

## Summary

The ["XLIFF Sync"](https://marketplace.visualstudio.com/items?itemName=rvanbekkum.xliff-sync) extension for Visual Studio Code can help you work more efficiently with XLIFF translation files in various ways.
It is specifically targeted at easing translation of extensions for [Microsoft Dynamics 365 Business Central](https://dynamics.microsoft.com/en-us/business-central/overview/), by allowing you to more easily keep `.xlf` translation files of your extensions in sync with the `.g.xlf` files that are automatically generated by the [AL Language](https://marketplace.visualstudio.com/items?itemName=ms-dynamics-smb.al) extension.
However, it can also be used in combination with other software projects that use [XLIFF](https://en.wikipedia.org/wiki/XLIFF) translation files for translation, supporting both XLIFF 1.2 and XLIFF 2.0.
Apart from synchronizing trans-units from a base-XLIFF file, this extension contributes various other features, including commands to check for missing translations, detect problems in translations and import translations from external XLIFF files.

View the demo in the [Areopa](https://areopa.academy/) webinar recording: [VS Code AL Extensions - XLIFF Sync](https://youtu.be/28JghaJHNJ4?t=376) (starts at 6:16)

More information: [XLIFF Sync: Time for a complete overview](https://robvanbekkum.nl/xliff-sync-overview/)

* [Features](#features)
Expand Down Expand Up @@ -85,7 +92,7 @@ More information: [XLIFF Sync: Time for a complete overview](https://robvanbekku
| xliffSync.ignoreLineEndingTypeChanges | `false` | Specifies whether changes in line ending type (CRLF vs. LF) should not be considered as changes to the source text of a trans-unit. |
| xliffSync.clearTranslationAfterSourceTextChange | `false` | Specifies whether translations should be cleared when the source text of a trans-unit changed. |
| xliffSync.addNeedsWorkTranslationNote | `true` | Specifies whether an XLIFF Sync note should be added to explain why a trans-unit was marked as needs-work. |
| xliffSync.useSelfClosingTags | `true` | Determine how empty XML tags must be handled while generating new XLIFF files (`<note></note>` or `<note/>`). |
| xliffSync.useSelfClosingTags | `true` | Specifies whether the XML tags in the XLIFF target files should be self-closing tags. (i.e., `<note></note>` vs. `<note/>`). |
| xliffSync.keepEditorOpenAfterSync | `true` | Specifies whether XLIFF files should be opened in the editor after syncing. |
| xliffSync.openExternallyAfterEvent | `[]` | Specifies after which event translation files should be opened automatically with the default XLIFF editor. Options: "Check", "ProblemDetected", "Sync" |
| xliffSync.developerNoteDesignation | `Developer` | Specifies the name that is used to designate a developer note. |
Expand Down Expand Up @@ -135,6 +142,8 @@ The new file is automatically synced with the base file; if it is not known you

![XLIFF Sync Create New Target Files Options](resources/xliffSync_createNewTargetFilesOptions.png)

More detailed instruction: [Create New Target Files](https://robvanbekkum.nl/xliff-sync-overview/#create-new-target-files)

### Synchronize to Single File

#### Using the Command Palette
Expand All @@ -145,7 +154,7 @@ The new file is automatically synced with the base file; if it is not known you

> 1. Alt + X, S (default shortcut)
By default, the extension expects the base-XLIFF file to be named `application.g.xlf`.
By default, the extension expects the base-XLIFF file to end with `.g.xlf`.
If no matching file is found, you are prompted to identify the base file.
This setting will be saved for future use.
If the extension is invoked from a localization file, that file will be updated, otherwise the extension will prompt you for the file to update.
Expand Down Expand Up @@ -180,6 +189,8 @@ Here's a small demo:

![XLIFF Sync from Explorer](resources/xliffSync_explorer.gif)

More detailed instruction: [Synchronize Translation Files](https://robvanbekkum.nl/xliff-sync-overview/#synchronize-translation-files)

### Check for Missing Translations

#### Using the Command Palette
Expand All @@ -192,6 +203,8 @@ You also have the option to open files with missing translations with your defau

![XLIFF Sync Check Missing Translations Messages](resources/xliffSync_checkMissingTranslations.png)

More detailed instruction: [Check Translation Files](https://robvanbekkum.nl/xliff-sync-overview/#check-translation-files)

### Check for Need Work Translations

#### Using the Command Palette
Expand Down Expand Up @@ -223,6 +236,8 @@ The currently implemented checks are the following:

**Note**: You may want to use rule `SourceEqualsTarget` in combination with setting `xliffSync.copyFromSourceForSameLanguage` set to `true`.

More detailed instruction: [Check Translation Files](https://robvanbekkum.nl/xliff-sync-overview/#check-translation-files)

### Find Next Missing Translation in XLIFF File

#### Using the Command Palette
Expand Down Expand Up @@ -265,8 +280,20 @@ The command will copy translations from the selected files to trans-units in the
It will try first to merge translations for trans-units with a matching combination of source-text and Developer note, and only after that try to merge translations to trans-units with matching source-text.
That way you could utilize the Developer note to have the import perform a more precise merge of the translations (e.g., based on tags in the Developer notes).

More detailed instruction: [Import Translations from Files](https://robvanbekkum.nl/xliff-sync-overview/#import-translations-from-files)

## Known Issues

* Automatically inserting _new_ groups into target files is not implemented.
* The NAV2018 XLIFF generator creates Xliff Generator Notes without any identifiers, therefore it is recommended to change the `xliffSync.findBy...` settings to not synchronize trans-units based on Xliff Generator notes.
* Files larger than 50 MB cannot be processed at the moment. For now, please use the ["XLIFF Sync" PowerShell module](https://github.com/rvanbekkum/ps-xliff-sync) instead.

## Contributors

* [dannoe](https://github.com/dannoe)
* [manux54](https://github.com/manux54)
* [rvanbekkum](https://github.com/rvanbekkum)
* [warlof](https://github.com/warlof)

You can find the contributions in the [Changelog](https://marketplace.visualstudio.com/items/rvanbekkum.xliff-sync/changelog).
Thank you all! 🤍
16 changes: 8 additions & 8 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "xliff-sync",
"displayName": "XLIFF Sync",
"description": "A tool to keep XLIFF translation files in sync.",
"version": "1.3.0",
"version": "1.4.0",
"publisher": "rvanbekkum",
"repository": {
"type": "git",
Expand Down Expand Up @@ -215,7 +215,7 @@
"xliffSync.useSelfClosingTags": {
"type": "boolean",
"default": true,
"description": "Determine how empty XML tags must be handled while generating new XLIFF files (<note></note> or <note/>).",
"description": "Specifies whether the XML tags in the XLIFF target files should be self-closing tags. (i.e., `<note></note>` vs. `<note/>`)",
"scope": "resource"
},
"xliffSync.keepEditorOpenAfterSync": {
Expand Down

0 comments on commit 038b505

Please sign in to comment.