Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/freaktechnik/transifex-loader
A loader, that fetches the content of string files from transifex.
https://github.com/freaktechnik/transifex-loader
i18n internationalization l10n loader localization transifex webpack-loader
Last synced: 11 days ago
JSON representation
A loader, that fetches the content of string files from transifex.
- Host: GitHub
- URL: https://github.com/freaktechnik/transifex-loader
- Owner: freaktechnik
- License: mit
- Created: 2016-08-11T12:47:32.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2024-10-21T14:00:10.000Z (25 days ago)
- Last Synced: 2024-10-21T22:55:10.630Z (25 days ago)
- Topics: i18n, internationalization, l10n, loader, localization, transifex, webpack-loader
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/transifex-loader
- Size: 3.73 MB
- Stars: 4
- Watchers: 3
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# transifex-loader
[![codecov](https://codecov.io/gh/freaktechnik/transifex-loader/graph/badge.svg?token=DBYp5Rht9J)](https://codecov.io/gh/freaktechnik/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.## Installation
```bash
npm install --save-dev transifex-loader
```## Usage
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`
for credentials and `.tx/config` for resource informations.## Options
### `store`
You can disable writing the result from Transifex to the original file by setting
this to `false`.### `disableCache`
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.
- Ignores `minimum_perc`.