There are dozens of ways to contribute in Weblate. Any help is welcomed, be it coding, graphics design, documentation or sponsorship.
Code and development¶
Weblate is developed on GitHub. You are welcome to fork the code and open pull requests. Patches in any other form are welcome too.
Check out Internals to see how Weblate looks from inside.
The code should follow PEP-8 coding guidelines and should be formatted using black code formatter.
To check the code quality, you can use flake8, the recommended
plugins are listed in
.pre-commit-config.yaml and it’s configuration is
The easiest approach to enforce all this is to install pre-commit. Weblate
repository contains configuration for it to verify the commited files are sane.
After installing it (it is already included in the
requirements-lint.txt) eneble it by running
pre-commit install in
Weblate checkout. This way all your changes will be automatically checked.
You can also trigger check manually, to check all files run:
pre-commit run --all
Coding Weblate with PyCharm¶
PyCharm is a known IDE for Python, here’s some guidelines to help you setup Weblate project in it.
Considering you have just cloned the Github repository, just open the folder in which you cloned it in PyCharm. Once the IDE is open, the first step is to specify the interpreter you want:
You can either chose to let PyCharm create the virtualenv for you, or select an already existing one:
Don’t forget to install the dependencies once the interpreter is set: you can do it, either through the console (the console from the IDE will directly use your virtualenv by default), or through the interface when you get a warning about missing dependencies.
The second step is to set the right information to use natively Django inside PyCharm: the idea is to be able to immediately trigger the unit tests in the IDE. For that you need to specify the root path of Django and the path of one setting:
Be careful, the Django project root is the root of the repository, not the weblate sub-directory. About the settings, I personally use the settings_test from the repository, but you could create your own setting and set it there.
Last step is to be able to run the server and to put breakpoints on the code to be able to debug it. This is done by creating a new Django Server configuration:
Be careful to properly checked “No reload”: you won’t get anymore the server live reload if you modify some files, but the debugger will be stopped on the breakpoint you set.
Security by Design Principles¶
Any code for Weblate should be writted with Security by Design Principles in mind.
Testsuite and CI¶
Testsuites exist for most of the current code, increase coverage by adding testcases for any new functionality, and verify that it works.
There are several jobs to verify different aspects:
- Unit tests
- Documentation build and external links
- Migration testing from all supported releases
- Code linting
- Setup verification (ensures that generated dist files do not miss anything and can be tested)
The configuration for the CI is in
.github/workflows directory. It
heavily uses helper scripts stored in
ci directory. The scripts can be
also executed manually, but they require several environment variables, mostly
defining Django settings file to use and database connection. The example
definition of that is in
# Simple way to configure test database from environment # Database backend to use postgresql / mysql / mariadb export CI_DATABASE=postgresql # Database server configuration export CI_DB_USER=weblate export CI_DB_PASSWORD=weblate export CI_DB_HOST=127.0.0.1 # Django settings module to use export DJANGO_SETTINGS_MODULE=weblate.settings_test
The simple execution can look like:
. scripts/test-database ./ci/run-migrate ./ci/run-test ./ci/run-docs ./ci/run-setup
To run a testsuite locally, use:
DJANGO_SETTINGS_MODULE=weblate.settings_test ./manage.py test
You can also specify individual tests to run:
DJANGO_SETTINGS_MODULE=weblate.settings_test ./manage.py test weblate.gitexport
The tests can also be executed inside developer docker container, see Running Weblate locally in Docker.
See Testing in Django for more info on running and writing tests for Django.
Our issue tracker is hosted at GitHub:
Feel welcome to report any issues with, or suggest improvement of Weblate there. If what you have found is a security issue in Weblate, please consult the “Security issues” section below.
In order to give the community time to respond and upgrade your are strongly urged to report all security issues privately. HackerOne is used to handle security issues, and can be reported directly at HackerOne.
Alternatively, report to email@example.com, which ends up on HackerOne as well.
If you don’t want to use HackerOne, for whatever reason, you can send the report by e-mail to firstname.lastname@example.org. You can choose to encrypt it using this PGP key 3CB 1DF1 EF12 CF2A C0EE 5A32 9C27 B313 42B7 511D.
Starting with our codebase¶
If looking for some bugs to familiarize yourself with the Weblate codebase, look for ones labelled good first issue.
Quick overview of directory structure of Weblate main repository:
Running Weblate locally in Docker¶
If you have Docker and docker-compose installed, you can spin up the development environment simply by running:
It will create development Docker image and start it. Weblate is running on
<http://127.0.0.1:8080/> and you can login with
admin user and
password. The new installation is empty, so you might want to continue with
Adding translation projects and components.
docker-compose.yml for this are located in
The script also accepts some parameters, to execute tests run it with
parameter and then specify any
test parameters, for example:
./rundev.sh test --failfast weblate.trans
Be careful that your Docker containers are up and running before running the tests.
You can check that by running the
docker ps command.
To stop the background containers run:
Running the script without args will recreate Docker container and restart it.
This is not suitable setup for production, it includes several hacks which are insecure, but make development easier.
Weblate is being translated using Weblate itself, feel free to take part in the effort of making Weblate available in as many human languages as possible.
Funding Weblate development¶
You can fund further Weblate development on the donate page. Funds collected there are used to fund gratis hosting for libre software projects, and further development of Weblate. Please check the the donate page for details, such as funding goals and rewards you can get by being a funder.
- Check newly translated languages by
- Set final version by
- Make sure screenshots are up to date
make -C docs update-screenshots
- Create a release
- Enable building version docs on Read the Docs and make it default.
- Update Docker image.
- Close GitHub milestone.
- Once the Docker image is tested, add a tag and push it.
- Include new version in
./ci/run-migrateto cover it in migration testing.