Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/daniel-sc/xliff-simple-merge

Merges XLIFF 1.2/2.0 files. Usable for Angular i18n automation.
https://github.com/daniel-sc/xliff-simple-merge

i18n xliff xliff2

Last synced: 12 days ago
JSON representation

Merges XLIFF 1.2/2.0 files. Usable for Angular i18n automation.

Awesome Lists containing this project

README

        

[![npm](https://img.shields.io/npm/v/xliff-simple-merge)](https://www.npmjs.com/package/xliff-simple-merge)
[![Coverage Status](https://coveralls.io/repos/github/daniel-sc/xliff-simple-merge/badge.svg?branch=main)](https://coveralls.io/github/daniel-sc/xliff-simple-merge?branch=main)

# XLIFF Simple Merge

This program automates the merging of XLIFF files (version 1.2 and 2.0).
New translations from the input file (e.g. "messages.xlf") are merged into the destination file (e.g "messages.fr-FR.xlf"), while keeping exising translations intact.
Removed translations will be removed in the input file.

This can be used as post-processing to angular i18n extraction, to update translations files.

**Angular users**: It is recommended to _not_ use this program directly but the custom angular tooling: [ng-extract-i18n-merge](https://github.com/daniel-sc/ng-extract-i18n-merge)

## Usage

Either install via `npm i -g xliff-simple-merge` or run directly with `npx xliff-simple-merge`.

```text
Options:
-i, --input-file input file(s)/merge origin(s)
-d, --destination-file merge destination
-o, --output-file output file, if not provided "merge destination" is overwritten
-e, -exclude-file exclude all unit IDs of the provided file(s)
-w, --overwrite-with-translated overwrite target of destination with target of source, if it's translated and destination target not
--no-match-fuzzy prevent fuzzy matching of similar units with changed id
--no-collapse-whitespace prevent collapsing of multiple whitespaces when comparing translations sources
--no-reset-translation-state prevent (re-)setting the translation state to new/initial for new/changed units
--no-replace-apostrophe prevent replacing of apostrophes (') with "'"
--debug enable debug output
-h, --help display help for command
```

### Notes
* If different input files contains the same unit IDs, only the latter ones will be used.
* The input units may contain target nodes. They will be used in the destination units only if they don't contain any net.