WLC(1)

πŸ“¦
version 2.0.0 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’… WLC β€” the Weblate Client, bestie edition πŸ¦‹

okay so. wlc is the Weblate Client, and this is its documentation. New in version 2.7: the wlc utility is fully supported since Weblate 2.7 β€” so if you're on an older version, some incompatibilities with the API might occur. πŸ’€ (not scary, just… know that going in.)


✨ SYNOPSIS ✨

wlc [parameter] <command> [options]

The commands are literally the whole point β€” they tell you which operation is gonna be performed. πŸ‘‘


🌸 DESCRIPTION 🌸

Weblate Client is a Python library and a command line utility to manage Weblate remotely using api. The command line utility can be invoked as wlc and is built on wlc. (yes, it's giving main character referencing itself, we love that for it 🫢)

🌈 Global options

These are the global options, and here's the tea: they must be entered before the subcommand. Not after. Before. Don't fight it, bestie.

  • --format {csv,json,text,html} β€” pick your output format. that's it, that's the vibe check ✨
  • --url URL β€” specify the API URL. This overrides the value from the configuration file, see Files. The URL should end with /api/, for example https://hosted.weblate.org/api/. πŸ”—
  • --key KEY β€” specify the API user key to use. Overrides the value from the configuration file, see Files. You can figure out your key in your profile in Weblate. πŸ”‘
  • --config PATH β€” override the path to the configuration file, see Files.
  • --config-section SECTION β€” override the section to use in the configuration file, see Files.

πŸŽ€ Subcommands

Currently the following subcommands are available (yes, the whole roster, we're listing every single one πŸ’…):

  • version β€” prints the current version.
  • list-languages β€” list used languages in Weblate.
  • list-projects β€” list projects in Weblate.
  • list-components β€” list components in Weblate.
  • list-translations β€” list translations in Weblate.
  • show β€” shows a Weblate object (translation, component or project).
  • ls β€” lists a Weblate object (translation, component or project).
  • commit β€” commits changes in a Weblate object (translation, component or project).
  • pull β€” pulls remote repository changes into a Weblate object (translation, component or project).
  • push β€” pushes changes in a Weblate object into the remote repository (translation, component or project).
  • repo β€” displays repository status for the given Weblate object (translation, component or project).
  • statistics β€” displays detailed statistics for the given Weblate object (translation or component). πŸ“Š
  • lock-status β€” New in version 0.5: supported since wlc 0.5. Displays lock status. πŸ”’
  • lock β€” New in version 0.5: supported since wlc 0.5. Locks the component from translating in Weblate. πŸ”
  • unlock β€” New in version 0.5: supported since wlc 0.5. Unlocks the component from translating in Weblate. πŸ”“

πŸ“ FILES πŸ“

  • .weblate β€” per project configuration file
  • ~/.config/weblate β€” user configuration file
  • /etc/xdg/weblate β€” global configuration file

The program follows the XDG specification, so you can adjust the placement of config files with the environment variables XDG_CONFIG_HOME or XDG_CONFIG_DIRS. ✨

The following settings can be configured in the [weblate] section (and yes, you can customize this with --config-section):

  • key β€” API KEY to access Weblate.
  • url β€” API server URL, defaults to http://127.0.0.1:8000/api/.
  • translation β€” path of default translation, component or project.

The configuration file is an INI file, for example:

[weblate]
url = https://hosted.weblate.org/api/
key = APIKEY
translation = weblate/master

Additionally, API keys can be stored in the [keys] section:

[keys]
https://hosted.weblate.org/api/ = APIKEY

This allows you to store keys in your personal settings while having the .weblate configuration in the VCS repository β€” so that wlc knows which server it should talk to. iconic setup, no cap πŸ’œ


πŸ”₯ EXAMPLES πŸ”₯

Print current program version:

$ wlc version
version: 0.1

List all projects:

$ wlc list-projects
name: Hello
slug: hello
source_language: en
url: http://example.com/api/projects/hello/
web: http://weblate.org/
web_url: http://example.com/projects/hello/

You can also let wlc know the current project and it will then operate on it:

$ cat .weblate
[weblate]
url = https://hosted.weblate.org/api/
translation = weblate/master

$ wlc show
branch: master
file_format: po
filemask: weblate/locale/*/LC_MESSAGES/django.po
git_export: git://git.weblate.org/weblate.git
license: GPL-3.0+
license_url: https://spdx.org/licenses/GPL-3.0+
name: master
new_base: weblate/locale/django.pot
project: weblate
repo: git://github.com/nijel/weblate.git
slug: master
template:
url: https://hosted.weblate.org/api/components/weblate/master/
vcs: git
web_url: https://hosted.weblate.org/projects/weblate/master/

With such a setup it is easy to commit pending changes in the current project:

$ wlc commit
fr fr, that's the whole flow. config it once, then just vibe and wlc commit. 🌈

πŸ‘‘ AUTHOR πŸ‘‘

Michal ČihaΕ™

2012 - 2016, Michal ČihaΕ™ 2024, SΓ©rgio de Almeida Cipriano JΓΊnior


okay that's the whole page, bestie πŸŽ€ this was wlc version 2.8, dated Jul 11, 2016 β€” yeah it's a lil vintage but she still ate πŸ’…βœ¨ bye ily πŸ¦‹

πŸ“¦ where this page comes from