Referenz und Kochbuch zur Automatisierung

Die Automatisierung-Erweiterung führt deklarative Abläufe unter Verwendung bestehender Weblate-Operationen aus. Auf dieser Seite werden die Ablauf-Struktur, -Trigger, -Bedingungen und -Aktionen beschrieben. Vollständige Beispiele finden Sie unter Kochbuch, einschließlich Übersetzungsspeicher vor der maschinellen Übersetzung anwenden.

Arbeitsablauf-Definition

Added in version 2026.10.

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

version

Ja

1

triggers

Ja

Liste von (Objekt); maximal 100 Einträge; eindeutige Einträge

conditions

Nein

Liste von (Bedingung); maximal 100 Einträge

actions

Ja

Liste von (Aktion); maximal 100 Einträge

The add-on configuration offers two ways to edit a workflow, and the Editor and YAML buttons switch between them without losing unsaved changes.

Editor builds the workflow from the triggers, conditions, and actions described on this page, offering the parameters of each one as a form. It opens by default. Nested conditions (und, oder, nicht) and branching actions (Sequenz, Auswahl) are not editable there yet; a workflow using them opens in YAML instead. The editor requires JavaScript.

YAML ist das Arbeitsablauf-Feld selbst. JSON-Eingaben werden ebenfalls akzeptiert. Gespeicherte Arbeitsabläufe werden als YAML mit version, triggers, optional conditions und actions in dieser Reihenfolge wieder geöffnet. Kommentare und die ursprüngliche Formatierung bleiben nicht erhalten. Die API akzeptiert dieselbe Struktur wie das Element workflow von configuration. Das JSON-Schema beschreibt diese Darstellung unabhängig vom Editor. Unbekannte Schlüssel werden abgelehnt.

version gibt die Version des Arbeitsablauf-Schemas an, nicht die Weblate-Version. Listen Sie die Ereignisse, die abonniert werden sollen, unter triggers auf, die zu erfüllenden Bedingungen, bevor eine Aktion ausgeführt wird, unter conditions, und die angeordneten Vorgänge unter actions. Das Weglassen von conditions entspricht einer leeren Liste. Ein leeres triggers erlaubt nur die manuelle Ausführung; ein leeres actions führt keine Vorgänge aus.

Literal-Einstellungen und -Ausdrücke

Aktionseinstellungen sind wörtliche YAML-/JSON-Werte. Nur das value einer expression-Bedingung wird als CEL ausgewertet. Abfragen, Engine-IDs, Labels und andere Einstellungen unterstützen keine CEL-Ausdrücke, Variablensubstitution oder Vorlagensyntax wie {{ unit.id }}. Eine Abfrage, die diese Syntax enthält, wird nicht erweitert. Verwenden Sie Auswahl, um Aktionen mit unterschiedlichen festen Einstellungen auszuwählen. Aktionen wählen Zeichenketten anhand ihres scope und einer optionalen Abfrage aus.

Zeichenkettenbereich

Set scope on an action to choose its starting selection. component is the default and retains the existing component-wide behavior. trigger uses the unit affected by a change event; a source-unit change selects its corresponding target-language units. result:ID uses units actually changed or given new suggestions by an earlier action with that id. For an AI quality action, it uses units successfully evaluated by that action. For a select action, it uses the units selected by that action. Set settings.q to filter the selected units further. For trigger and result:ID, omitting q selects the whole scope.

For example, a translation action with id: machine and scope: trigger can be followed by a bulk edit with scope: result:machine. The second action sees only units affected by the first. Source-level edits can select the corresponding target units in a later action.

Workflows using scope: trigger can declare only change triggers. A change without a unit fails if execution reaches that action. Manual execution and preview require a change containing a unit before starting such workflows. A result:ID action fails if its referenced action did not run, for example because a branch was skipped. Preview can follow result scopes created by select actions when their selections are known. Other result scopes are conditional because earlier actions have not run.

Selections are kept only while the run is active. The activity log records affected counts and scoped unit counts (before the q filter), but does not store the full unit ID lists.

Ausführungskontext

CEL conditions can access the following fields. Context is captured when the run is scheduled, and only results changes between actions. In particular, unit.state is a snapshot; use matching_strings for current database state. Timestamps are strings, not CEL timestamp objects.

Kontextfelder

Feld

Typ

Bedeutung

component.id

Ganzzahl

Zielkomponentenkennung; immer vorhanden.

component.slug

Zeichenfolge

Zielkomponenten-Slug.

component.project

Zeichenfolge

Projekt-Slug, kein Projektobjekt.

component.category

Zeichenfolge oder Null

Kategorie-Slug; Null für eine unkategorisierte Komponente.

language.id

Ganzzahl

Ereignis-Sprachkennung, sofern eine Sprache verfügbar ist.

language.code

Zeichenfolge

Ereignis-Sprachcode, sofern eine Sprache verfügbar ist.

unit.id

Ganzzahl

Ereignis-Einheitenkennung, sofern die Einheit verfügbar ist.

unit.state

Ganzzahl

Erfasster Zeichenkettenstatus; siehe Zeichenkettenstatus.

unit.source

Zeichenfolge

Quelltext, auf 4.096 Zeichen gekürzt.

unit.target

Zeichenfolge

Zieltext, auf 4.096 Zeichen gekürzt.

change.id

Ganzzahl

Auslösende Änderungskennung, sofern eine Änderung verfügbar ist.

change.action

Ganzzahl

Numerischer ActionEvents-Wert, nicht der Ereignisname in Kleinbuchstaben.

change.timestamp

Zeichenfolge

Änderungszeitstempel im ISO-8601-Format mit Zeitzonenversatz.

actor.id

Ganzzahl

Erfasste Ausführenderkennung, sofern ein Ausführender verfügbar ist.

actor.username

Zeichenfolge

Erfasster Ausführender-Benutzername.

trigger.name

Zeichenfolge

Triggerkennung wie change, daily oder manual.

trigger.timestamp

Zeichenfolge

Änderungszeitstempel oder Ausführungszeitpunkt für andere Trigger; ISO 8601 mit Zeitzonenversatz.

trigger.revision

Zeichenfolge oder Null

Lokale Komponentenrevision, bei geplanter Ausführung erfasst; Null, falls nicht verfügbar.

trigger.unit_ids

Liste von Ganzzahlen oder Null

Derzeit eine Liste mit einem Element, wenn sich die Änderung auf eine Einheit bezieht; andernfalls Null.

trigger.source_unit_ids

Liste von Ganzzahlen oder Null

Quelle-Einheitenkennungen, die trigger.unit_ids entsprechen; andernfalls Null.

results

Objekt

Initial leer; ordnet Aktionskennungen den Ergebnissen erfolgreicher Operationen zu.

Die Verfügbarkeit hängt vom Trigger ab:

  • change liefert change. Es liefert unit und language nur dann, wenn die Änderung darauf verweist, sowie actor vom Benutzer der Änderung oder, falls dieser fehlt, von deren Autor. Jedes dieser optionalen Objekte kann Null sein.

  • manual liefert actor, wenn es von einem Benutzer über die Bedienoberfläche oder API ausgelöst wird. Andere manuelle Einstiegspunkte haben möglicherweise keinen Ausführenden. change, unit, und language sind Null.

  • daily, component_update, post_update, post_commit, und post_push haben für actor, change, unit, und language Null.

  • A preview with a change ID uses that change’s context and trigger.name of change. Without one, it uses manual context.

When an object is null, its child fields cannot be accessed directly. For example, use unit != null && unit.state == 10 or language != null && language.code == "de". Prefer the typed unit_state, language, and change_action conditions when possible; they handle missing context and event-name conversion for you. See Nach Quellenänderungen übersetzen.

Ausführungskennung und Berechtigungen

The usual add-on management permission authorizes configuration, preview, and manual execution. actor records who caused an event; it does not select the account or permissions used to perform actions. Changing a condition on actor only determines whether the workflow runs.

Operations execute with the add-on’s authority within its configured scope, not with the triggering user’s individual translation permissions. Automatic translation receives the Automation add-on bot as its execution user and does not apply per-user operation permission checks. Reused translations can retain their original author attribution. Bulk editing also records the Automation add-on bot as its execution user. The activity context retains the actor separately from translation change attribution.

Author-filtered conditions, selections, and AI-evaluation searches use the same administrative scope in previews and execution. They do not depend on Guest permissions or the configuring or triggering user’s contributor identity access.

Changes made during execution record an automation origin with the installed add-on ID and execution-log ID in Übersetzungsverlauf. This also covers background tasks and repository processing started by the automation. The identifiers remain available after an add-on or its execution log is removed; workflow settings are not copied into change history.

Project, category, and site-wide automations include compatible restricted components in their configured scope. Automatic-translation actions can use eligible restricted source components outside the configuring administrator’s direct access. Preview uses the same administrative scope and can inspect the selected component and optional change context. Grant add-on management permission only to users trusted with this complete scope. Changing or disabling the configuring user’s account does not revoke a saved workflow.

Before a queued run executes, Weblate checks that the add-on is still valid and the component still belongs to its scope. The queued definition and event context are snapshots: editing the workflow after scheduling does not change that run. Operation settings are validated again against the target component at execution.

Testen und ausführen

Save the workflow before using the separate Run add-on form. Inherited automations require a component ID; each submission targets one component. A change ID supplies event context and must belong to that component and match a configured change subscription. Workflows with only change triggers require a change ID. Workflows using scope: trigger also require the change to contain a string.

Preview without changes is checked by default. Select Run now with it checked to inspect conditions and planned actions. Preview neither calls translation services nor changes strings. Conditions that depend on unexecuted action results or changed strings are marked unknown, and their branches are shown as conditional. Clear the checkbox to schedule real execution with the same context and saved workflow. Validation errors preserve the checkbox selection; reopening the page enables preview again.

Without a change ID, execution uses manual context with no language, string, or change. With a change ID, context uses that change’s event, actor, and timestamp, and the string’s current state, not a reconstruction of its historical state. The requesting administrator is recorded separately in the activity log. Component-scoped actions still operate across the component; supplying a change does not implicitly restrict their selection. Use scope: trigger to select strings affected by that change.

Die Erweiterungen bieten entsprechende Funktionen zur Vorschau und Ausführung.

Runs use ordinary Celery tasks and existing operation locks. Separate runs may overlap; there are no execution modes or parallel action blocks. The activity log records the definition, context, conditions, actions, and failures. An error stops later actions without rolling back completed work. Runs are not automatically replayed; after a worker is forcibly terminated, a pending log can remain and must be inspected before manually starting another run. Changes originating from an automation, including follow-up tasks, do not start other automation runs.

Validierung und Grenzwerte

Workflows must contain JSON-compatible values with string mapping keys. YAML aliases, explicit tags, duplicate mapping keys, non-finite numbers, and native YAML date/timestamp values are rejected. Quote a date if a string is intended. Unknown fields are rejected, and action IDs must be unique across the entire workflow, including mutually exclusive branches. Missing required fields and wrong value types are errors; for example, state must be an integer, not "10". Nested mappings and lists also have a structural depth limit of 32.

Generated parameter tables show list limits, uniqueness requirements, numeric bounds, and string patterns from the schema. Item constraints in parentheses apply to each list element. The workflow-wide node and nesting limits below still apply even when each individual list is within its limit.

Definitions are limited to 64 KiB both as submitted and as ASCII-escaped JSON after operation defaults are applied, 100 action/condition nodes, and eight nesting levels. CEL expressions are limited to 4,096 characters and evaluated in a helper process with two seconds of CPU time and five seconds of wall time per invocation. The helper also limits virtual address space to 512 MiB except on macOS, where no memory cap is enforced. The helper fails closed if a required operating-system resource limit cannot be applied. The pinned CEL runtime provides native wheels; Linux installations require a supported glibc platform. No runtime settings or separate service are required. Use Eine Erweiterung schreiben for unrestricted custom Python logic on self-hosted installations.

Trigger

Jeder Trigger ist ein Objekt in der Liste triggers des Ablaufs. Eine Instanz kann mehrere Trigger abonnieren. Eine manuelle Ausführung ist immer möglich, auch wenn manual nicht in der Liste enthalten ist.

daily

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

trigger

Ja

"daily"

Läuft unter Täglich berücksichtigt BACKGROUND_TASKS.

component_update

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

trigger

Ja

"component_update"

Läuft unter Komponentenaktualisierung, nachdem Weblate die Komponente aktualisiert hat.

post_update

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

trigger

Ja

"post_update"

Läuft unter Repository post-update.

post_commit

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

trigger

Ja

"post_commit"

Läuft unter Repository post-commit.

post_push

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

trigger

Ja

"post_push"

Läuft unter Repository post-push.

manual

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

trigger

Ja

"manual"

Läuft, wenn ein Administrator Jetzt ausführen auswählt oder über Erweiterungen die manuelle Ausführung anfordert.

change

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

trigger

Ja

"change"

events

Ja

Liste von (Ereignisname von Ausgewählte Änderungsereignisse); mindestens 1 Eintrag; eindeutige Einträge

Subscribes to the identifiers listed in Ausgewählte Änderungsereignisse, for example translation_changed, translation_added, source_string_changed, or source_string_added_in_the_repository. translation_changed covers edits to existing translations; translation_added covers previously untranslated strings translated by a user. Uploads and automatic translation have separate events. Legacy internal names such as change and source_change remain accepted and are converted to documented identifiers when edited or saved. These identifiers distinguish edits in Weblate from uploads and repository imports; a source-edit event alone does not cover all three. Only changes associated with a component can start a run.

Bedingungen

Every condition in a list must pass. A false workflow-level condition skips the run. Conditions can also select a Auswahl branch. Conditions concerning unavailable language, unit, or change context return false. An empty condition list passes.

expression

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

condition

Ja

"expression"

value

Ja

Zeichenfolge; maximale Länge 4096

Evaluates value as CEL and requires a boolean result. CEL supports arithmetic, comparisons, standard functions, and comprehensions, but cannot call Python or access the database, network, or filesystem. Expressions can use the captured execution context and outputs of earlier actions, for example results.machine.updated > 0. Missing fields or expression errors fail the run.

component_category

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

condition

Ja

"component_category"

value

Ja

Zeichenfolge; maximale Länge 4096

Vergleicht den Kategorie-Slug der auslösenden Komponente mit value.

language

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

condition

Ja

"language"

value

Ja

Zeichenfolge; maximale Länge 4096

Vergleicht den Sprachcode des Ereignisses mit value. Dabei wird der Triggerkontext geprüft; nachfolgende Aktionen werden nicht auf diese Sprache beschränkt. Verwenden Sie die Suchanfrage einer Aktion, um die zu verarbeitenden Zeichenketten einzuschränken.

matching_strings

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

condition

Ja

"matching_strings"

value

Ja

Zeichenfolge; maximale Länge 2048

Passes when the component currently contains at least one string matching the search query in value. The query runs when the condition is evaluated, so it can observe changes made by earlier actions.

change_action

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

condition

Ja

"change_action"

value

Ja

Ereignisname von Ausgewählte Änderungsereignisse

Vergleicht die Aktion der auslösenden Änderung mit value. Verwenden Sie den Ereignisnamen in Kleinbuchstaben, wie bei change.

unit_state

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

condition

Ja

"unit_state"

value

Ja

0, 10, 11, 12, 20, 30, 100

Vergleicht den erfassten Status der auslösenden Einheit mit dem Integer- value. Dabei wird der Ereignis-Snapshot verwendet, nicht eine neue Abfrage der Einheit nach zuvor durchgeführten Aktionen.

und

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

condition

Ja

"and"

conditions

Ja

Liste von (Bedingung); maximal 100 Einträge

Passes when every nested condition passes. Evaluation stops at the first false condition. An empty list passes.

oder

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

condition

Ja

"or"

conditions

Ja

Liste von (Bedingung); maximal 100 Einträge

Passes when any nested condition passes. Evaluation stops at the first true condition. An empty list does not pass.

nicht

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

condition

Ja

"not"

conditions

Ja

Liste von (Bedingung); maximal 100 Einträge

Negates exactly one nested condition. Empty lists and lists containing multiple conditions are invalid.

Aktionen

Actions run in list order. Each operation and its batched checks finish before the next action starts. Actions target the component; use Nach Zeichenketten suchen queries to narrow them. Queries are evaluated when each action executes.

Optional unique action IDs expose outputs as results.<id>. An ID starts with a lowercase letter and contains up to 64 lowercase letters, digits, or underscores. After a successful operation, its output is stored in the activity log and, when it has an ID, in results.<id> for later CEL conditions. For example, results.memory.updated > 0 tests whether the memory action reported updates. Outputs belong to the current run and are not shared with other runs.

Skipped and failed operations do not create result entries. Preview creates entries for select actions when it can determine their selections; other previewed operations do not. If an action might be skipped, guard access with a presence check such as has(results.memory) && results.memory.updated > 0. A failed operation records an error in the trace and stops later actions; its partial changes are not rolled back. Actions without IDs still record their outputs in the activity log.

The YAML examples below are items to place in the workflow’s actions list. The cookbook provides complete workflow definitions.

Settings and queries are validated against the target component before execution. For inherited workflows, labels must exist in each target project and selected engines must be enabled there.

Zeichenketten auswählen

Added in version 2026.11.

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

action

Ja

"weblate.select"

id

Nein

Zeichenfolge; Muster ^[a–z][a–z0–9_]{0,63}$

scope

Nein

"component", "trigger", Zeichenfolge; Muster ^result:[a–z][a–z0–9_]{0,63}$

settings

Ja

Objekt

settings.q

Nein

Zeichenfolge; maximale Länge 2048

Ergebnisfelder

Bezeichnung

Erforderlich

Typ oder zulässige Werte

component

Ja

Ganzzahl

selected

Ja

Ganzzahl; mindestens 0

Use weblate.select to name a set of strings for later result:ID actions. It only reads strings. In component scope, q is required; in trigger or result scope, omit q to keep the current selection. q uses the usual Nach Zeichenketten suchen syntax. The result contains the selected count, while the unit IDs remain available only during the run.

For example, select untranslated German strings from a change event before running automatic translation:

- action: weblate.select
  id: changed_german
  scope: trigger
  settings:
    q: "language:de AND state:<translated"
- action: weblate.automatic_translation
  scope: result:changed_german
  settings:
    auto_source: mt
    engines: [openai]
    mode: translate

Automatische Übersetzung

Added in version 2026.10.

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

action

Ja

"weblate.automatic_translation"

id

Nein

Zeichenfolge; Muster ^[a–z][a–z0–9_]{0,63}$

scope

Nein

"component", "trigger", Zeichenfolge; Muster ^result:[a–z][a–z0–9_]{0,63}$

settings

Ja

Objekt

settings.mode

Nein

"suggest", "translate", "fuzzy", "approved"

settings.q

Nein

Zeichenfolge; maximale Länge 2048

settings.auto_source

Nein

"others", "mt"

settings.component

Nein

Ganzzahl oder Null; mindestens 1

settings.engines

Nein

Liste von (Zeichenfolge; maximale Länge 4096); maximal 100 Einträge

settings.threshold

Nein

Ganzzahl; mindestens 1; höchstens 100

Ergebnisfelder

Bezeichnung

Erforderlich

Typ oder zulässige Werte

component

Ja

Ganzzahl

updated

Ja

Ganzzahl

message

Ja

Zeichenfolge

warnings

Ja

Liste von (Zeichenfolge; maximale Länge 1024); maximal 20 Einträge

warnings_omitted

Ja

Ganzzahl; mindestens 0

Runs Automatische Übersetzung synchronously. auto_source: others reuses translations from other components, optionally restricted by the source component ID. auto_source: mt uses the service IDs in engines; translation memory and AI services use the same mechanism as other providers.

Defaults are auto_source: others, mode: suggest, q: state:<translated, threshold: 80, no source component restriction, and an empty engine list. For a scoped action, omitted q selects its whole scope instead. Provide configured engine IDs when selecting mt.

mode selects suggestions (suggest), translations (translate), strings needing editing (fuzzy), or approved translations (approved). Approval follows each language’s effective review settings. threshold is a minimum score from 1 to 100 for services; each service has its own maximum score.

Beispiel

Apply local translation memory matches scoring at least 95 to strings still needing translation. Enable Weblate-Übersetzungsspeicher in the target project before running this action.

- action: weblate.automatic_translation
  id: memory
  settings:
    auto_source: mt
    engines: [weblate-translation-memory]
    threshold: 95
    mode: translate
    q: "state:<translated"

Siehe Übersetzungsspeicher vor der maschinellen Übersetzung anwenden, um diesen Durchlauf mit einem externen Übersetzungsdienst fortzusetzen.

Ausgaben

component (Ganzzahl)

ID der verarbeiteten Komponente, nicht der optionalen Ausgangskomponente.

updated (Ganzzahl)

Number of translation updates or new suggestions reported across the component’s languages. In suggestion mode, this counts newly created suggestions, not strings whose translation state changed. A translation that exceeds the string’s maximum length can also become a suggestion, even in translation mode. Zero means the operation reported no updates; it is not an error by itself.

message (Zeichenfolge)

Human-readable completion summary in English. Use updated for conditions instead of parsing this message.

warnings (Liste von Zeichenfolgen)

Warnings reported by automatic translation, or an empty list when none were reported. At most 20 messages are retained, each truncated to 1,024 characters. A successful action can still have warnings; inspect them when fewer strings were translated than expected.

warnings_omitted (Ganzzahl)

Number of warning messages omitted beyond the first 20. This does not count characters removed from retained messages.

For example, a successful run might record:

{
  "component": 42,
  "updated": 3,
  "message": "Automatic translation completed, 3 strings were updated.",
  "warnings": [],
  "warnings_omitted": 0
}

A later condition can access these fields through results.memory, for example results.memory.updated > 0 && size(results.memory.warnings) == 0.

KI-Qualitätsevaluierung

Added in version 2026.10.

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

action

Ja

"weblate.ai_quality"

id

Nein

Zeichenfolge; Muster ^[a–z][a–z0–9_]{0,63}$

scope

Nein

"component", "trigger", Zeichenfolge; Muster ^result:[a–z][a–z0–9_]{0,63}$

settings

Ja

Objekt

settings.service

Nein

Zeichenfolge; maximale Länge 4096

settings.q

Nein

Zeichenfolge; maximale Länge 2048

Ergebnisfelder

Bezeichnung

Erforderlich

Typ oder zulässige Werte

component

Ja

Ganzzahl

evaluated

Ja

Ganzzahl; mindestens 0

Evaluates existing target translations synchronously using the effective AI quality evaluation add-on. Its configured service is used automatically. An optional service asserts that the effective add-on uses that service; a mismatch stops the workflow. The optional q filters the action’s scope further; the add-on’s own query and eligibility rules still apply. Empty scoped selections make no provider requests.

Each evaluated string is available to a later result:ID action when this action has an id. evaluated counts those strings; unit IDs are kept only during the run. The action stops later steps if a request fails, is rate limited, or its response is discarded because the string changed during evaluation. Earlier successful batches can retain their findings, so a later run may reevaluate them. See KI-Übersetzungen vor der Genehmigung auswerten for a complete translation and review workflow.

Massenbearbeitung

Added in version 2026.10.

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

action

Ja

"weblate.bulk_edit"

id

Nein

Zeichenfolge; Muster ^[a–z][a–z0–9_]{0,63}$

scope

Nein

"component", "trigger", Zeichenfolge; Muster ^result:[a–z][a–z0–9_]{0,63}$

settings

Ja

Objekt

settings.q

Nein

Zeichenfolge; maximale Länge 2048

settings.state

Nein

Ganzzahl

settings.search

Nein

Zeichenfolge; maximale Länge 4096

settings.replacement

Nein

Zeichenfolge; maximale Länge 4096

settings.search_type

Nein

"text", "regex"

settings.add_flags

Nein

Zeichenfolge; maximale Länge 4096

settings.remove_flags

Nein

Zeichenfolge; maximale Länge 4096

settings.add_translation_flags

Nein

Zeichenfolge; maximale Länge 4096

settings.remove_translation_flags

Nein

Zeichenfolge; maximale Länge 4096

settings.add_labels

Nein

Liste von (Zeichenfolge; maximale Länge 4096); maximal 100 Einträge

settings.remove_labels

Nein

Liste von (Zeichenfolge; maximale Länge 4096); maximal 100 Einträge

Ergebnisfelder

Bezeichnung

Erforderlich

Typ oder zulässige Werte

component

Ja

Ganzzahl

updated

Ja

Ganzzahl

Uses the same operation as Massenbearbeitung. For component scope, q is required and selects strings using Nach Zeichenketten suchen. For trigger and result scopes, q is optional and filters the selected strings. state sets an integer string state, or leaves it unchanged with -1 (the default).

Textersetzung

search and replacement have the same meaning as in Massenbearbeitung. search_type is text (the default) or regex. Empty search disables replacement; empty replacement removes matching text. Regex replacements use Python capture references such as \g<1> or \g<name>. Each plural form is processed separately, and whitespace is preserved.

For example, this action swaps two captured words:

- action: weblate.bulk_edit
  settings:
    q: "language:cs"
    search_type: regex
    search: '(Hello), (world)'
    replacement: '\g<2>, \g<1>'

The query or action scope selects strings for all operations. Adding replacement does not narrow accompanying state, flag, or label changes. Set state: 0 to clear translations, including every plural form; source strings are excluded. Clearing cannot be combined with replacement.

The visual editor offers the same search-type choices, replacement fields, and Empty state as the add-on. Automated runs process the full eligible scope without interactive preview. Invalid patterns or replacement references are rejected; a regex timeout fails the operation and rolls back changes to the current component. Earlier component changes in a project-wide add-on run remain applied.

Regex replacement uses the fixed Massenbearbeitung resource limits. Workflow validation shares one helper across action settings; execution shares the regex budget across bulk-edit actions. Synchronously processed components share the budget, while separately queued tasks have independent budgets. Pattern compilation and template validation also run in the helper. A resource failure fails the operation rather than skipping the affected string or retrying with a fresh budget. On macOS, native regex allocations are not protected by a hard address-space limit.

Zeichenkettenstatus

Statuswerte

Wert

Bedeutung

Als Ziel für eine Massenbearbeitung akzeptiert

-1

Unverändert lassen

Ja; Standard, kein tatsächlicher Status der Einheit

0

Leer

Ja; löscht Übersetzungstext, überspringt Ausgangszeichenketten

10

Bearbeitungsbedürftig

Ja

11

Bearbeitungsbedürftig (muss umgeschrieben werden)

Ja

12

Bearbeitungsbedürftig (muss überprüft werden)

Ja

20

Übersetzt

Ja

30

Genehmigt

Ja

100

Schreibgeschützt

Nein

The unit_state condition accepts actual unit states, including 0 and 100, but not -1. Bulk editing only changes eligible editable strings; selecting a read-only string does not make it editable.

Markierungen und Labels

Flag settings are strings containing flags to add or remove. Label settings are lists of label names. Flag defaults are empty strings and label defaults are empty lists. Source flags and labels affect all languages, just as with the bulk-edit add-on; translation flags affect the matching translations, excluding source strings. Removing a translation flag removes its local setting; inherited flags remain in effect.

Use comma-separated flags, with colon-separated parameters, for example add_translation_flags: "max-length:100, check-glossary". To remove a parameterized flag, specify its name, for example remove_translation_flags: "max-length". See Verhalten mit Markierungen anpassen for quoting rules and Qualitätsprüfungen for available checks. Labels use YAML/JSON lists of existing project label names, for example add_labels: [needs-attention]; this does not create a label.

Beispiel

Mark currently translated German strings as needing editing, leaving other languages and approved strings outside the query unchanged:

- action: weblate.bulk_edit
  id: marked_for_edit
  settings:
    q: "language:de AND state:translated"
    state: 10

See Eine Aktion nur dann ausführen, wenn bei einem Übersetzungsdurchlauf Zeichenketten aktualisiert werden for a conditional bulk-edit example.

Ausgaben

component (Ganzzahl)

ID der bearbeiteten Komponente.

updated (Ganzzahl)

Count reported by the bulk-edit operation. State changes, changes to source flags or labels, and changes to translation flags contribute separately. When an action combines these operations, the same string can contribute more than once; this is not a count of distinct affected strings. Source flag and label changes are counted per source string, rather than once per language. Zero means the operation made no changes.

For example, an action that only changes the states of three strings returns:

{"component": 42, "updated": 3}

A later condition can test results.marked_for_edit.updated > 0. This output does not contain unit IDs or a list of the changed strings. A later action must select its strings with its own query.

Sequenz

Added in version 2026.10.

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

sequence

Ja

Liste von (Aktion); maximal 100 Einträge

Groups an ordered list of actions. A sequence finishes before the next sibling action starts. It can contain operations, further sequences, and Auswahl blocks. It does not introduce parallel execution.

Beispiel

Group two translation passes: reuse other components first, then apply local translation memory to strings still needing translation.

- sequence:
    - action: weblate.automatic_translation
      id: reused
      settings:
        auto_source: others
        mode: translate
        q: "state:<translated"
    - action: weblate.automatic_translation
      id: memory
      settings:
        auto_source: mt
        engines: [weblate-translation-memory]
        threshold: 95
        mode: translate
        q: "state:<translated"

Ausgaben

A sequence has no output object and does not accept an id. Its successful child actions expose their individual outputs in the shared results object, including to subsequent children and actions outside the sequence. In this example, those entries are results.reused and results.memory; there is no combined update count. A failing child stops the remaining actions.

Auswahl

Added in version 2026.10.

Parameter

Bezeichnung

Erforderlich

Typ oder zulässige Werte

choose

Ja

Liste von (Objekt); maximal 100 Einträge

choose[].conditions

Ja

Liste von (Bedingung); maximal 100 Einträge

choose[].sequence

Ja

Liste von (Aktion); maximal 100 Einträge

default

Nein

Liste von (Aktion); maximal 100 Einträge

Wertet die Branches der Reihe nach aus und führt den ersten Branch aus, bei dem alle conditions erfüllt sind. Jeder Branch erfordert sowohl conditions als auch sequence. Spätere Branches werden nach einem Treffer übersprungen, auch wenn die übereinstimmende Sequenz leer ist.

Wenn kein Branch übereinstimmt, wird default ausgeführt. Das Weglassen von default entspricht einer leeren Aktionsliste.

Beispiel

For components in the frontend category, mark translated German strings as needing editing. Other components take the empty default branch.

- choose:
    - conditions:
        - condition: component_category
          value: frontend
      sequence:
        - action: weblate.bulk_edit
          id: frontend_edit
          settings:
            q: "language:de AND state:translated"
            state: 10
  default: []

See Eine Aktion nur dann ausführen, wenn bei einem Übersetzungsdurchlauf Zeichenketten aktualisiert werden for a branch that uses an earlier action’s output instead of the component category.

Ausgaben

A choose block has no output object and does not accept an id. Only successful operations in the selected branch or default branch create result entries. Branch conditions and skipped actions are recorded in the activity trace. In this example, results.frontend_edit exists only if the category matches and the bulk edit succeeds. A later condition can safely check has(results.frontend_edit) && results.frontend_edit.updated > 0. Preview records planned or conditional actions, without creating their outputs.

Kochbuch

Übersetzungsspeicher vor der maschinellen Übersetzung anwenden

Use separate automatic translation actions to give one source priority over another. This example first applies local translation memory matches scoring at least 95, then asks DeepL to translate only strings still needing translation.

Enable Weblate-Übersetzungsspeicher and configure DeepL in the target project’s Übersetzungsdienste. Install the Automation add-on and enter this workflow:

version: 1
triggers:
  - trigger: component_update
  - trigger: daily
actions:
  - action: weblate.automatic_translation
    id: memory
    settings:
      auto_source: mt
      engines: [weblate-translation-memory]
      threshold: 95
      mode: translate
      q: "state:<translated"
  - action: weblate.automatic_translation
    id: machine
    settings:
      auto_source: mt
      engines: [deepl]
      threshold: 80
      mode: translate
      q: "state:<translated"

The first action finishes before the second action selects its strings. Both use mode: translate, so a successful first-pass translation no longer matches state:<translated and is not sent to DeepL by the second action. Existing translated or approved strings are excluded from both passes. Untranslated strings and strings needing editing are eligible; use state:empty in both actions if only untranslated strings should be processed.

Each threshold applies only to its action. Set the memory threshold to 100 to accept only exact matches, or lower it to accept less similar matches before trying the remote service. Machine translation scores are service-specific: choose a threshold no higher than the service’s documented maximum score. Replace deepl with another configured service ID to use a different provider, including an AI service.

Keep one engine per action when the order matters. Putting both IDs in one engines list uses the existing Vorrang der Dienste für maschinelle Übersetzungen und Übersetzungsspeicher, not the list order. To try additional providers, append another action with its own engine, threshold, and the same query. To reuse translations from other Weblate components first, prepend an action using auto_source: others instead of auto_source: mt and omit engines.

Changing a pass to mode: suggest leaves the string state unchanged; mode: fuzzy leaves it needing editing. Neither excludes its results from a later state:<translated pass. Keep mode: translate when the intention is to retain each successful pass’s translations.

Use Preview without changes to validate the workflow before using Run now. Preview does not call translation services or predict their results. After a real run, inspect the activity log for each action’s updated count and warnings. A service failure that stops the workflow is recorded as an error; later actions do not run.

Remove or disable overlapping Automatic translation add-ons when replacing them with this workflow. Ordering applies within a single automation run; separate add-ons and concurrent runs can still overlap. The daily trigger respects BACKGROUND_TASKS. Use triggers: [] for manual execution only.

KI-Übersetzungen vor der Genehmigung auswerten

This workflow runs after repository component updates or source edits in Weblate. It applies translation memory first, translates remaining strings with OpenAI, and evaluates only strings changed by the OpenAI action. Clean strings are approved; strings with AI quality findings are marked as needing checking. Configure the translation memory and OpenAI services in the target project. Install the KI-Qualitätsevaluierung add-on with OpenAI as its evaluation service and its query including translated strings.

version: 1
triggers:
  - trigger: component_update
  - trigger: change
    events: [source_string_changed]
actions:
  - action: weblate.automatic_translation
    id: memory
    settings:
      auto_source: mt
      engines: [weblate-translation-memory]
      threshold: 95
      mode: translate
      q: "state:<translated"
  - action: weblate.automatic_translation
    id: machine
    settings:
      auto_source: mt
      engines: [openai]
      mode: translate
      q: "state:<translated"
  - action: weblate.ai_quality
    id: quality
    scope: result:machine
    settings: {}
  - action: weblate.bulk_edit
    scope: result:quality
    settings:
      q: "NOT (check:ai_accuracy OR check:ai_fluency OR check:ai_terminology OR check:ai_style OR check:ai_formatting)"
      state: 30
  - action: weblate.bulk_edit
    scope: result:quality
    settings:
      q: "check:ai_accuracy OR check:ai_fluency OR check:ai_terminology OR check:ai_style OR check:ai_formatting"
      state: 12

The quality action uses the intersection of its scope, the add-on query, and its optional settings.q. It stops the workflow if evaluation fails or skips any batch, so incomplete results never reach the approval action. Its result scope contains only units successfully evaluated in this run. State 12 is Needs editing (Needs checking); reviewers can inspect the findings and revise those translations. The five check:ai_* filters select non-dismissed findings. Disable the add-on’s evaluation frequency and its change and update triggers if only this workflow should initiate evaluation.

Eine Aktion nur dann ausführen, wenn bei einem Übersetzungsdurchlauf Zeichenketten aktualisiert werden

Action IDs make outputs available to later conditions. For example, append the following item to the previous workflow’s actions list to mark translations from the component as needing editing when the machine translation pass updated at least one string:

- choose:
    - conditions:
        - condition: expression
          value: results.machine.updated > 0
      sequence:
        - action: weblate.bulk_edit
          settings:
            q: "state:translated"
            state: 10
  default: []

The bulk-edit query selects all currently translated strings in the component, including translations that existed before the run and memory matches. It does not select only the strings updated by machine. Narrow the query to the intended strings before using this example. String state 10 means needing editing; it does not approve or request review of translations.

choose executes only the first branch whose conditions pass. Here, the empty default performs no action when the translation pass updated no strings. During preview, the condition is unknown because machine has not executed.

Nach Quellenänderungen übersetzen

This complete workflow listens for source edits in Weblate and new source strings from the repository. It runs only for categorized components matching either frontend or backend, and only when the change includes a nonempty unit. The action reuses other components‘ translations for German strings needing translation.

version: 1
triggers:
  - trigger: change
    events: [source_string_changed, source_string_added_in_the_repository]
conditions:
  - condition: and
    conditions:
      - condition: or
        conditions:
          - condition: component_category
            value: frontend
          - condition: component_category
            value: backend
      - condition: expression
        value: unit != null && unit.source != ""
actions:
  - action: weblate.automatic_translation
    id: reused
    settings:
      auto_source: others
      mode: translate
      q: "language:de AND state:<translated"

The null guard makes automatic changes without a unit safely skip the workflow. To run or preview this change-only workflow, supply a matching change ID belonging to the target component. Leave Preview without changes checked to inspect the event-driven path without changing strings.

The action’s query targets all matching German strings in the component, not only the unit from the triggering change. trigger.unit_ids provides context for conditions; it is not automatically applied to operations and cannot be interpolated into q. The listed events do not cover every kind of source update; select additional Ausgewählte Änderungsereignisse if the workflow should also respond to uploads or other changes.