Internen van Weblate¶
Notitie
Dit hoofdstuk geeft u een basisoverzicht van de internen van Weblate.
Weblate leidt de meeste structuur voor zijn code af van, en is gebaseerd op Django.
Mappenstructuur¶
Snel overzicht van de mappenstructuur van de hoofdopslagruimte van Weblate:
docsBroncode voor deze documentatie, die kan worden gebouwd met Sphinx.
dev-dockerCode voor Docker om de ontwikkelingsserver uit te voeren, bekijk Weblate lokaal in Docker uitvoeren.
weblateBroncode van Weblate as een toepassing van Django, bekijk Internen van Weblate.
weblate/staticCliëntbestanden (CSS, Javascript en afbeeldingen), bekijk Voorzijde van Weblate.
Modules¶
Weblate bestaat uit verschillende toepassingen voor Django (sommige optioneel, bekijk Optionele modules voor Weblate):
accounts
Gebruikeraccount, profielen en notificaties.
addons
Add-ons om het gedrag van Weblate aan te passen, bekijk Add-ons.
api
API, gebaseerd op Django REST framework.
auth
Authenticatie en rechten.
billing
De optionele module Facturatie.
checks
Module Vertaling tekenreeks Kwaliteitscontroles.
fonts
Module voor controles van renderen van lettertypen.
formats
Abstracte laag bestandsindeling, gebaseerd op Translate-Toolkit.
gitexport
De optionele module Git exporter.
lang
Module die taal en modellen voor meervouden definieert.
legal
De optionele module Wettelijke module.
machinery
Integratie van services voor machinevertaling.
memory
Ingebouwd vertaalgeheugen, bekijk Vertaalgeheugen.
screenshots
Beheren van schermafdrukken en module voor OCR.
trans
Hoofdmodule voor afhandelen van vertalingen.
utils
Verscheidene hulpprogramma’s.
vcs
Abstracte versiebeheersysteem.
wladmin
Django aanpassen beheerinterface.
Background tasks internals¶
Hint
This section describes Celery task internals. Achtergrondtaken met Celery describes how to configure Celery to run the tasks.
Weblate uses Celery to execute tasks in the background. Some tasks are event-triggered, and some tasks are schedule-triggered.
The Celery Beat is used for scheduling tasks, and django-celery-beat is used
to store the periodic task schedule in the database. The tasks schedule is
configured in tasks.py in each of the Django apps.
The tasks are consumed using several queues; the routing is configured in
settings.py. The queues were designed to separate different types of
workload:
celeryThe default queue where background tasks are processed.
notifyDelivers notification e-mails, both for events within Weblate and for authentication or registration. This is a separate queue to make e-mail delivery smooth even if there is a backlog of other tasks.
memoryUpdates translation memory entries. The updating queue can be long when importing new strings, and long processing does not matter much here, so having a separate queue avoids blocking other tasks.
backupThe backup tasks cannot be executed in parallel, and a single dedicated worker makes this easier.
translateAutomatic translation tasks are known to take long because they hit external services.