Developing add-ons#

Complementos are way to customize localization workflow in Weblate.

class weblate.addons.base.BaseAddon(storage=None)#

Base class for Weblate add-ons.

classmethod can_install(component, user)#

Check whether add-on is compatible with given component.


Hook for component update.


Guardar configuración.


Actuador desencadenado diariamente.

classmethod get_add_form(user, component, **kwargs)#

Return configuration form for adding new add-on.

get_settings_form(user, **kwargs)#

Return configuration form for this add-on.


Actuador desencadenado tras añadirse una traducción nueva.


Actuador desencadenado tras consignarse cambios en el repositorio.


Actuador desencadenado tras enviar el repositorio a la ubicación del proyecto originario.

post_update(component, previous_head: str, skip_push: bool, child: bool)#

Actuador desencadenado tras actualizarse el repositorio desde el origen.

  • previous_head (str) – «HEAD» del repositorio antes de la actualización; puede estar vacía durante la clonación inicial.

  • skip_push (bool) – Whether the add-on operation should skip pushing changes upstream. Usually you can pass this to underlying methods as commit_and_push or commit_pending.

pre_commit(translation, author)#

El enlace se activa antes de que los cambios se confirmen en el repositorio.


Hook triggered before repository is pushed upstream.


Hook triggered before repository is updated from upstream.


Guarde la información del estado del complemento.

store_post_load(translation, store)#

Actuador desencadenado tras procesar un archivo.

It receives an instance of a file format class as a argument.

This is useful to modify file format class parameters, for example adjust how the file will be saved.


Actuador desencadenado antes de crearse una unidad nueva.


Weblate user used to track changes by this add-on.

Here is an example add-on:

# Copyright © Michal Čihař <>
# SPDX-License-Identifier: GPL-3.0-or-later

from django.utils.translation import gettext_lazy

from weblate.addons.base import BaseAddon
from import AddonEvent

class ExampleAddon(BaseAddon):
    # Filter for compatible components, every key is
    # matched against property of component
    compat = {"file_format": {"po", "po-mono"}}
    # List of events add-on should receive
    events = (AddonEvent.EVENT_PRE_COMMIT,)
    # Add-on unique identifier
    name = "weblate.example.example"
    # Verbose name shown in the user interface
    verbose = gettext_lazy("Example add-on")
    # Detailed add-on description
    description = gettext_lazy("This add-on does nothing it is just an example.")

    # Callback to implement custom behavior
    def pre_commit(self, translation, author):