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:

docs

Broncode voor deze documentatie, die kan worden gebouwd met Sphinx.

dev-docker

Code voor Docker om de ontwikkelingsserver uit te voeren, bekijk Weblate lokaal in Docker uitvoeren.

weblate

Broncode van Weblate as een toepassing van Django, bekijk Internen van Weblate.

weblate/static

Clië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:

celery

The default queue where background tasks are processed.

notify

Delivers 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.

memory

Updates 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.

backup

The backup tasks cannot be executed in parallel, and a single dedicated worker makes this easier.

translate

Automatic translation tasks are known to take long because they hit external services.