Giter Site home page Giter Site logo

md2xliff's Introduction

md2xliff

Markdown to XLIFF and XLIFF to markdown converter.

Idea behind it is described at XML in Localisation: Use XLIFF to Translate Documents article.

Package provides extract module which parses markdown files and generates XLIFF and skeleton.

Translater fills XLIFF with translations. pretranslate module may be used for automatic translation with the help of Yandex Translator API.

Online XLIFF Editor may be used to work with XLIFF files.

Then with xliff-reconstruct module it is possible to build translated markdown with the same markup as in source document.

Installation requirements

  • Node.js 4+ is a platform built on JavaScript runtime for easily building fast, scalable network applications.
  • Git Bash if you use Windows OS.

Installation

It's as easy as...

npm install md2xliff

Note: Do not use root rights to install npm dependencies.

Usage

scheme

All modules have JS API and a CLI.

Step 1 — extract

To extract XLIFF and generate skeleton run ./bin/extract test/source.md.

Step 2 — translate

To translate XLIFF file you can use a text editor or any CAT tools (MateCat, Swordfish).

Also you can automatically pretranslate XLIFF file. For this run API_KEY=your-yandex-translator-api-key ./bin/pretranslate test/source.xlf.

It is also possible to set JUST_UPPER_CASE environment variable to use upper case of source units instead of translation which may be useful for testing: JUST_UPPER_CASE=1 ./bin/pretranslate test/source.xlf.

Step 3 — reconstruct

To reconstruct new markdown from XLIFF and skeleton built with extract command run ./bin/xliff-reconstruct test/source.xlf test/source.skl.md test/target.md.

Environment variable USE_SOURCE may also be used to reconstruct target markdown from <source> units of XLIFF. It is helpful for testing: USE_SOURCE=1 ./bin/xliff-reconstruct test/source.xlf test/source.skl.md test/target.md.

md2xliff's People

Contributors

tadatuta avatar alexandrboltris avatar marfuzzi avatar godfreyd 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.