Git Product home page Git Product logo

xliff-merger's Introduction

xliff-merger

xliff-merger is a tool that takes a generated xliff file (base.xlf) and merges it with an existing and already translated xliff file (other.xlf).

It reads every <trans-unit> tag found in the base.xlf file and looks for new translations in the other.xlf file. A translation is found as a <target> tag, this tag is then copied as a child node of the <trans-unit> tag. In the end, the result will be saved in a file called merged.xlf, all tags will be indented and sorted by the id attribute.

xliff-merger uses xslt4node, a XSLT package wrapping the XSLT interface of the Java API for XML Processing (JAXP).

Pre-requisites:

  • node-gyp
  • Java 6+
    • JNI capabilities must be enabled when running java on a Mac OSX:
      • /Library/Java/JavaVirtualMachines/<version>.jdk/Contents/Info.plist
        <key>JVMCapabilities</key>
        <array>
            ...
            <string>JNI</string>
            ...
        </array>
        

Setup:

Run npm install

Usage:

xliff-merger will merge the following files:

  • base.xlf is the translation file generated by angular, usually by doing: ng xi18n --i18n-format xlf
  • other.xlfis the file with the translations, this is the one that your translation team will send you back.

Merge the files by running node xliff-merger.js, the merge will be saved in a file called merged.xlf.

Future:

  • Compile and share this tool to be added to angular projects as a node script.
  • Test it using yarn instead of npm
  • Find a way to publish this tool to avoid the pre-requisites, see here.

xliff-merger's People

Contributors

emactaggart avatar ortizr-fcc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.