1.0.1 • Published 5 years ago

xliff-loader v1.0.1

Weekly downloads
24
License
MIT
Repository
-
Last release
5 years ago

Xliff Loader

Loads an Xliff file in Webpack and turns it into an object where resnames are keys and targets are values.

Example

./i18n.xlf

<xliff>
    <file>
        <body>
            <trans-unit id="appFooter" resname="appFooter">
                <source>This is the app footer text</source>
                <target>C'est le texte du bas de page de l'application</target>
            </trans-unit>
        </body>
    </file>
</xliff>

./a.js

const i18n = require('xliff-loader!./i18n.xlf');

Result

The following object is output

{
    "appFooter": "C'est le texte du bas de page de l'application"
}