A loader, that fetches the content of string files from Transifex. Requires
.tx/config in the same format as the
tx tool. The configuration files are searched from the directory
the loaded file is in up to the system root.
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
To match your local resources with the Transifex translations the loader uses
the same configuration as the
tx command line tool, specifically
for credentials and
.tx/config for resource informations.
You can disable writing the result from Transifex to the original file by setting
Disables reading the resource that is in the source language from the local file system and fetches it from Transifex, too.
Known incompatibilities (to tx)
- Requires the project to be on transifex.com but does not complain about it.