Weblate 來源碼#

Weblate 在 GitHub 上開發。歡迎您將代碼分叉並打開拉去請求。同樣歡迎任何形式的補丁。


查詢 Weblate 內部 看看 Weblate 從內部看是什麼樣子的。

Coding guidelines#

編寫 Weblate 的任何代碼應該時刻記得 `Security by Design Principles`_(由設計原理來提供安全性)。

Any code should come with documentation explaining the behavior. Don’t forget documenting methods, complex code blocks, or user visible features.

Any new code should utilize PEP 484 type hints. We’re not checking this in our CI yet as existing code does not yet include them.

Coding standard and linting the code#

The code should follow PEP-8 coding guidelines and should be formatted using ruff code formatter.

To check the code quality, you can use ruff, its configuration is stored in pyproject.toml.

The easiest approach to enforce all this is to install pre-commit. The repository contains configuration for it to verify the committed files are sane. After installing it (it is already included in the requirements-lint.txt) turn it on by running pre-commit install in Weblate checkout. This way all your changes will be automatically checked.


pre-commit run --all