Weblate is libre software web-based continuous localization system, used by over 2500 libre projects and companies in more than 165 countries.
wlc is a Weblate command-line client using Weblate's REST API.
PIP Installation
Install using pip:
pip3 install wlcSources are available at https://github.com/WeblateOrg/wlc.
Usage
Please see Weblate documentation for more complete documentation.
Command-line usage:
wlc list-projects wlc list-components wlc list-translations wlc list-languages wlc show wlc ls wlc commit wlc push wlc pull wlc repo wlc stats wlc lock wlc unlock wlc lock-status wlc download wlc upload
Configuration is loaded from --config when provided. Otherwise wlc reads the
user configuration from XDG paths such as ~/.config/weblate and then the
nearest project configuration file (.weblate, .weblate.ini, or
weblate.ini) from the current directory or its parents. The key/values
(retries, timeout, allowed_methods, backoff_factor,
status_forcelist) are closely coupled with the
urllib3 parameters
and allows the user to configure request parameters.
[weblate] url = https://hosted.weblate.org/api/ retries = 3 allowed_methods = PUT,POST,GET backoff_factor = 0.2 status_forcelist = 429,500,502,503,504 timeout = 30 allow_insecure_http = false [keys] https://hosted.weblate.org/api/ = APIKEY
Environment variables
The API URL and key can also be configured using environment variables. This is
especially useful for CI workflows where WLC_KEY is injected as a secret:
WLC_URL— API URLWLC_KEY— API keyWLC_ALLOW_INSECURE_HTTP— set to1,true,yes, oronto allow API keys over non-local HTTP URLs
When the API URL comes from automatically discovered project configuration
(.weblate, .weblate.ini, or weblate.ini in the current directory or a
parent directory), unscoped secrets must pin the destination explicitly:
WLC_KEY requires WLC_URL, and --key requires --url. URL-scoped keys in
the [keys] section continue to work with project configuration.
The configuration precedence (highest to lowest) is:
- Command-line arguments (
--url,--key) - Environment variables (
WLC_URL,WLC_KEY) - Configuration loaded from
--config, or from XDG/user config plus the nearest project config when--configis not used
API keys are rejected over non-local http:// URLs by default. Use HTTPS, a
loopback HTTP URL for local development, or explicitly opt in with
--allow-insecure-http, WLC_ALLOW_INSECURE_HTTP, or allow_insecure_http.
Automatically discovered project configuration cannot enable
allow_insecure_http; set it in user configuration or pass an explicit
--config file instead.
Docker image
The image is published on Docker Hub.
Building locally:
docker build -t weblate/wlc .Detailed documentation is available in Weblate documentation.
Docker hub tags
You can use following tags on Docker hub:
| Tag name | Description | Use case |
|---|---|---|
latest |
wlc stable release, matches latest tagged release | Rolling updates in a production environment |
edge |
wlc development | Staging environment |
| version | wlc stable release, see weblate/wlc | Well defined deploy in a production environment |
Every image is tested by our CI before it gets published, so even the bleeding version should be quite safe to use.
Contributing
Contributions are welcome! See documentation for more information.