Weblate Client
2.7 sürümünde geldi: There has been full wlc utility support ever since Weblate 2.7. If you are using an older version some incompatibilities with the API might occur.
Installation
The Weblate Client is shipped separately and includes the Python module.
To use the commands below, you need to install wlc
:
pip3 install wlc
Docker kullanımı
The Weblate Client is also available as a Docker image.
The image is published on Docker Hub: https://hub.docker.com/r/weblate/wlc
Kurulum:
docker pull weblate/wlc
The Docker container uses Weblate’s default settings and connects to the API deployed in localhost. The API URL and API_KEY can be configured through the arguments accepted by Weblate.
The command to launch the container uses the following syntax:
docker run --rm weblate/wlc [WLC_ARGS]
Example:
docker run --rm weblate/wlc --url https://hosted.weblate.org/api/ list-projects
You might want to pass your Yapılandırma dosyaları to the Docker container, the
easiest approach is to add your current directory as /home/weblate
volume:
docker run --volume $PWD:/home/weblate --rm weblate/wlc show
Getting started
The wlc configuration is stored in ~/.config/weblate
(see Yapılandırma dosyaları
for other locations), please create it to match your environment:
[weblate]
url = https://hosted.weblate.org/api/
[keys]
https://hosted.weblate.org/api/ = APIKEY
You can then invoke commands on the default server:
wlc ls
wlc commit sandbox/hello-world
Ayrıca bakınız
Synopsis
wlc [arguments] <command> [options]
Commands actually indicate which operation should be performed.
Açıklama
Weblate Client is a Python library and command-line utility to manage Weblate remotely
using Weblate’s REST API. The command-line utility can be invoked as wlc and is
built-in on wlc
.
Argümanlar
The program accepts the following arguments which define output format or which Weblate instance to use. These must be entered before any command.
- --format {csv,json,text,html}
Specify the output format.
- --url URL
Specify the API URL. Overrides any value found in the configuration file, see Yapılandırma dosyaları. The URL should end with
/api/
, for examplehttps://hosted.weblate.org/api/
.
- --key KEY
Specify the API user key to use. Overrides any value found in the configuration file, see Yapılandırma dosyaları. You can find your key in your profile on Weblate.
- --config PATH
Overrides the configuration file path, see Yapılandırma dosyaları.
- --config-section SECTION
Overrides configuration file section in use, see Yapılandırma dosyaları.
Komutlar
Aşağıdaki komutlar kullanılabilir:
- version
Geçerli sürümü yazdırır.
- list-languages
Weblate’de kullanılan dilleri listeler.
- list-projects
Weblate’deki projeleri listeler.
- list-components
Weblate’deki bileşenleri listeler.
- list-translations
Weblate’deki çevirileri listeler.
- show
Weblate nesnesini (çeviri, bileşen veya proje) gösterir.
- ls
Weblate nesnesini (çeviri, bileşen veya proje) listeler.
- commit
Bir Weblate nesnesinde (çeviri, bileşen veya proje) yapılan değişiklikleri işler.
- pull
Uzak depo değişikliklerini Weblate nesnesine (çeviri, bileşen veya proje) çeker.
- push
Weblate nesnesindeki (çeviri, bileşen veya proje) değişiklikleri uzak depoya gönderir.
- reset
0.7 sürümünde geldi: wlc 0.7’den beri desteklenmektedir.
Uzak depoyla eşleşmesi için Weblate nesnesindeki (çeviri, bileşen veya proje) değişiklikleri sıfırlar.
- cleanup
0.9 sürümünde geldi: wlc 0.9’dan beri desteklenmektedir.
Uzak depoyla eşleşmesi için bir Weblate nesnesindeki (çeviri, bileşen veya proje) izlenmeyen değişiklikleri kaldırır.
- repo
Belirli bir Weblate nesnesi (çeviri, bileşen veya proje) için depo durumunu görüntüler.
- statistics
Belirli bir Weblate nesnesi (çeviri, bileşen veya proje) için ayrıntılı istatistikleri görüntüler.
- lock-status
0.5 sürümünde geldi: wlc 0.5’ten beri desteklenmektedir.
Kilit durumunu görüntüler.
- lock
0.5 sürümünde geldi: wlc 0.5’ten beri desteklenmektedir.
Bileşeni Weblate’de daha fazla çevrilmemesi için kilitler.
- unlock
0.5 sürümünde geldi: wlc 0.5’ten beri desteklenmektedir.
Weblate bileşeninin çevirisinin kilidini açar.
- changes
0.7 sürümünde geldi: wlc 0.7 ve Weblate 2.10’dan beri desteklenmektedir.
Belirli bir nesne için değişiklikleri görüntüler.
- download
0.7 sürümünde geldi: wlc 0.7’den beri desteklenmektedir.
Bir çeviri dosyası indirir.
- --convert
Dosya biçimini dönüştürür, belirtilmemişse sunucuda hiçbir dönüştürme olmaz ve dosya depoda olduğu gibi indirilir.
- --output
Çıktının kaydedileceği dosyayı belirtir, belirtilmezse standart çıkışa yazdırılır.
- upload
0.9 sürümünde geldi: wlc 0.9’dan beri desteklenmektedir.
Bir çeviri dosyasını karşıya yükler.
- --overwrite
Yükleme sırasında mevcut çevirilerin üzerine yaz.
- --input
İçeriğin okunduğu dosya, belirtilmemişse standart girişten okunur.
- --method
Upload method to use, see Import methods.
- --fuzzy
Fuzzy (marked for edit) strings processing (empty,
process
,approve
)
- --author-name
Author name, to override currently authenticated user
- --author-email
Author e-mail, to override currently authenticated user
İpucu
Her bir komutu çağırmak hakkında daha ayrıntılı bilgiyi --help
seçeneğini kullanarak alabilirsiniz, örneğin: wlc ls --help
.
Yapılandırma dosyaları
.weblate
,.weblate.ini
,weblate.ini
1.6 sürümünde değişti: .ini uzantılı dosyalar da kabul edilir.
Proje başına yapılandırma dosyası
C:\Users\KULLANICIADI\AppData\weblate.ini
1.6 sürümünde geldi.
Windows’ta kullanıcı yapılandırma dosyası.
~/.config/weblate
Kullanıcı yapılandırma dosyası
/etc/xdg/weblate
Sistem genelinde yapılandırma dosyası
Program XDG tanımlamasını takip eder, böylece XDG_CONFIG_HOME
veya XDG_CONFIG_DIRS
ortam değişkenlerine göre yapılandırma dosyalarının yerleşimini ayarlayabilirsiniz. Windows’ta APPDATA
dizini, yapılandırma dosyası için tercih edilen konumdur.
[weblate]
bölümünde aşağıdaki ayarlar yapılandırılabilir (bunu --config-section
ile özelleştirebilirsiniz):
- key
Weblate’e erişmek için API ANAHTARI.
- url
API sunucusu URL’si, öntanımlı olarak
http://127.0.0.1:8000/api/
şeklindedir.
- translation
Öntanımlı çevirinin yolu - bileşen veya proje.
Yapılandırma dosyası bir INI dosyasıdır, örneğin:
[weblate]
url = https://hosted.weblate.org/api/
key = APIKEY
translation = weblate/application
Ek olarak API anahtarları [keys]
bölümünde depolanabilir:
[keys]
https://hosted.weblate.org/api/ = APIKEY
This allows you to store keys in your personal settings, while using the
.weblate
configuration in the VCS repository so that wlc knows which
server it should talk to.
Örnekler
Geçerli program sürümünü yazdır:
$ wlc version
version: 0.1
Tüm projeleri listele:
$ wlc list-projects
name: Hello
slug: hello
url: http://example.com/api/projects/hello/
web: https://weblate.org/
web_url: http://example.com/projects/hello/
Çeviri dosyasını karşıya yükle:
$ wlc upload project/component/language --input /tmp/hello.po
Ayrıca wlc’nin hangi proje üzerinde çalışması gerektiğini de belirleyebilirsiniz:
$ cat .weblate
[weblate]
url = https://hosted.weblate.org/api/
translation = weblate/application
$ wlc show
branch: main
file_format: po
source_language: en
filemask: weblate/locale/*/LC_MESSAGES/django.po
git_export: https://hosted.weblate.org/git/weblate/application/
license: GPL-3.0+
license_url: https://spdx.org/licenses/GPL-3.0+
name: Application
new_base: weblate/locale/django.pot
project: weblate
repo: git://github.com/WeblateOrg/weblate.git
slug: application
template:
url: https://hosted.weblate.org/api/components/weblate/application/
vcs: git
web_url: https://hosted.weblate.org/projects/weblate/application/
Bu kurulumla, geçerli projede bekleyen değişiklikleri işlemek kolaydır:
$ wlc commit