Webpack loader to fetch imported translation files from transifex.
npm install transifex-loader
A loader, that fetches the content of string files from Transifex. Requires
configuration via .transifexrc and .tx/config in the same format as the
official tx tool. The configuration files are searched from the directory
the loaded file is in up to the system root.
``bash`
npm install --save-dev transifex-loader
Add the loader before any other action in your webpack configuration for all your
resources that are translated on Transifex. You can of course also use it in a
require statement directly. The loader works as a kind of pre-processor for
translations.
If the translation can be found on Transifex, it is downloaded and
returned. If an error occurs (i.e. no internet connection) the local file is
returned. When the remote translations are successfully loaded the loader by
default writes the updated version to disk, replacing your local file. This can
be disabled with the store option.
To match your local resources with the Transifex translations the loader uses
the same configuration as the tx command line tool, specifically .transifexrc.tx/config
for credentials and for resource informations.
You can disable writing the result from Transifex to the original file by setting
this to false.
Disables reading the resource that is in the source language from the local file
system and fetches it from Transifex, too.
- Requires the project to be on transifex.com but does not complain about it.
- Ignores minimum_perc`.