Add-on

Add-ons provide ways to customize and automate the translation workflow. Admins can add and manage add-ons from the OperationsAdd-ons menu of each respective translation project or component. Add-ons can be also installed site-wide in Management interface.

Suggerimento

You can also configure add-ons using API, DEFAULT_ADDONS, or install_addon.

Add-ons that opt in to manual triggering can be run from add-on management or using the API. Results are recorded in the add-on activity log.

../_images/addons.webp

Eventi che attivano componenti aggiuntivi

Installazione di componenti aggiuntivi

Attivato quando il componente aggiuntivo è in fase di installazione.

Aggiornamento dei componenti

Si attiva ogni volta che si verifica una modifica in un componente, ad esempio:

  • Stringhe cambiate nel repository.

  • Aggiunta una stringa.

  • Viene aggiunta una nuova traduzione.

Giornalmente

Triggered daily, but add-ons usually split the daily load between components depending on BACKGROUND_TASKS.

Cambiamento di eventi

Attivato dopo la creazione di un evento Change.

Manual trigger

Triggered when an add-on is run manually from add-on management or the API.

Repository post-aggiunta

Attivato subito dopo l’aggiunta e il commit della nuova traduzione.

Repository post-commit

Triggered just after the changes are committed.

Repository post-push

Attivato subito dopo che il repository è stato inviato a monte.

Repository post-remove

Triggered just after a translation is removed.

Repository post-aggiornamento

Attivato ogni volta che vengono estratte nuove modifiche dal repository upstream.

Repository pre-commit

Triggered just before the changes are committed.

Repository pre-push

Attivato appena prima che il repository venga inviato a monte.

Repository pre-aggiornamento

Triggered just before the repository update is attempted.

Unit post-save

Triggered just after the string is saved.

Unit post-sync

Attivato dopo che la stringa è stata sincronizzata con il VCS.

Unit pre-create

Triggered just after the newly created string is saved.

Componenti aggiuntivi integrati

Traduzione automatica

ID componente aggiuntivo:

weblate.autotranslate.autotranslate

Configurazione:

mode

Modo traduzione automatica

Scelte disponibili:

suggest

Aggiungi come suggerimento

translate

Aggiungi come traduzione

fuzzy

Aggiungi come «Richiede modifica»

approved

Aggiungi come traduzione approvata

q

Ricerca

Tieni presente che la traduzione di tutte le stringhe eliminerà tutte le traduzioni esistenti.

auto_source

Sorgente di traduzioni automatizzate

Scelte disponibili:

others

Altri componenti di traduzione

mt

Traduzione automatica

component

Componente

Enter a source component ID. With 30 or more eligible source components, a project/component path is also accepted. In that case, component and project operations also accept a component slug from the target project. Leave blank to use eligible components from each target component’s project.

engines

Motori di traduzione automatica

Motori di traduzione automatica

threshold

Soglia punteggio

Triggers:

Installazione di componenti aggiuntivi, Aggiornamento dei componenti, Giornalmente, Cambiamento di eventi

Traduce automaticamente le stringhe usando la traduzione automatica o altri componenti.

CDN localizzazione JavaScript

Added in version 4.2.

ID componente aggiuntivo:

weblate.cdn.cdnjs

Configurazione:

threshold

Soglia traduzione

La percentuale di stringhe tradotte che devono essere presenti affinché la traduzione venga inclusa.

css_selector

Selettore CSS

Selettore CSS per rilevare elementi localizzabili.

cookie_name

Nome cookie lingua

Nome del cookie che memorizza la impostazioni della lingua.

files

Estrai stringhe da file HTML

Elenco di nomi di file nel repository attuale o URL remoti da analizzare per le stringhe traducibili.

Triggers:

Installazione di componenti aggiuntivi, Giornalmente, Repository post-commit, Repository post-remove, Repository post-aggiornamento

Pubblica traduzioni nella rete di distribuzione dei contenuti per l’uso nella localizzazione JavaScript o HTML.

Can be used to localize static HTML pages, or to load localization in the JavaScript code.

Generates a unique URL for your component you can include in HTML pages to localize them. See Translating HTML and JavaScript using Weblate CDN for more details.

Nota

This add-on requires additional configuration on the Weblate server. LOCALIZE_CDN_PATH configures where generated files will be written (on a filesystem), and LOCALIZE_CDN_URL defines where they will be served (URL). Serving of the files is not done by Weblate and has to be set up externally (typically using a CDN service).

This add-on is configured on Hosted Weblate and serves the files via https://weblate-cdn.com/.

File di traduzione CDN

Added in version 2026.5.

ID componente aggiuntivo:

weblate.cdn.files

Configurazione:

Questo componente aggiuntivo non ha configurazione.

Triggers:

Installazione di componenti aggiuntivi, Aggiornamento dei componenti, Repository post-commit, Repository post-remove, Repository post-aggiornamento

Publishes translation files into a content delivery network.

Publishes translation files without converting them to another format. Files are written below the add-on specific CDN directory and served from LOCALIZE_CDN_URL/<add-on UUID>/. Single-file translations use the language code and original file extension, for example cs.json or de.po. Multi-file translations are served below the language code using paths relative to the translation directory. Monolingual components include the source language file, while bilingual components publish only target-language files. See Localizzazione CDN for secure serving guidance.

Rimuovi stringhe vuote

Added in version 4.4.

ID componente aggiuntivo:

weblate.cleanup.blank

Configurazione:

Questo componente aggiuntivo non ha configurazione.

Triggers:

Installazione di componenti aggiuntivi, Repository post-commit, Repository post-aggiornamento

Rimuovi dai file traduzioni le stringhe senza una traduzione.

Use this to not have any empty strings in translation files (for example if your localization library displays them as missing instead of falling back to the source string).

Pulisci i file di traduzione

ID componente aggiuntivo:

weblate.cleanup.generic

Configurazione:

Questo componente aggiuntivo non ha configurazione.

Triggers:

Installazione di componenti aggiuntivi, Repository post-aggiornamento, Repository pre-commit

Aggiorna tutti i file di traduzione per farli corrispondere ai file monolingue di base. Per molti formati significa rimuovere le traduzioni che corrispondono a vecchie voci che non sono più presenti nei file di base.

For formats containing additional content besides translation strings (such as File HTML, File RC di Windows, or Formato OpenDocument) this also brings the translation file in sync with the base file.

For a one-time cleanup of a single translation file, use Cleanup unused in Manutenzione repository on that translation instead of installing the add-on.

Aggiungi lingue mancanti

ID componente aggiuntivo:

weblate.consistency.languages

Configurazione:

Questo componente aggiuntivo non ha configurazione.

Triggers:

Installazione di componenti aggiuntivi, Giornalmente, Repository post-aggiunta

Assicura che per tutti i componenti all’interno di un progetto venga usato un insieme coerente di lingue.

Nota

In questo non vengono considerati i componenti condivisi da altri progetti.

Missing languages are checked once every 24 hours, and when new languages are added in Weblate.

Unlike most others, this add-on affects the whole project.

Suggerimento

Auto-translate the newly added strings with Traduzione automatica.

Scoperta dei componenti

ID componente aggiuntivo:

weblate.discovery.discovery

Configurazione:

match

Espressione regolare usata per corrispondenza con i file traduzione

The regular expression must define a named group for component. Also define a named group for language when matching translation files. When the file mask is set, omit language and match the monolingual base or new base file instead.

file_format

Formato file

Formato file

name_template

Personalizza il nome del componente

Use Django template syntax. This template must include {{ component }}.

base_file_template

Definisci il file lingua a base monolingue

Lascia vuoto per i file di traduzione bilingue. Se impostato, questo modello deve includere {{ component }}.

new_base_template

Definisci il file di base per le nuove traduzioni

Il nome file usato per creare nuove traduzioni. Per gettext scegli un file .pot. Questo modello deve includere {{ component }}.

intermediate_template

File di lingua intermedio

Nome file del file di traduzione intermedio. Nella maggior parte dei casi si tratta di un file di traduzione fornito dagli sviluppatori e viene usato durante la creazione delle stringhe sorgente effettive. Questo modello deve includere {{ component }}.

filemask_template

Define the file mask

Leave empty to match translation files directly. When set, discovery matches the monolingual base or new base file and uses this template as the file mask. Include a language wildcard and {{ component }}, for example locale//{{ component }}.po or docs/{{ component }}_.md.

language_regex

Filtro lingua

Espressione regolare per filtrare i file traduzione durante la scansione con maschera dei file.

copy_addons

Clona gli add-on dal componente principale in quelli appena creati

remove

Rimuovi componenti per i file inesistenti

Triggers:

Installazione di componenti aggiuntivi, Repository post-aggiornamento

Aggiunge o rimuove componenti al progetto basandosi sulle modifiche dei file nel sistema controllo versione.

The matching is done using regular expressions enabling complex configuration, but some knowledge is required to do so. Usually the regular expression to match translation files has to contain two named groups to match component and language. When creating components from a monolingual base or new base file, omit the language group and match that source file instead. All named groups in the regular expression can be used as variables in the template fields.

Discovery requirements

To discover a component successfully, the configuration has to do all of the following:

  • The regular expression must define a component named group. Matching translation files also requires a language named group.

  • Template fields used to name or locate per-component files must include {{ component }}, so the rendered value actually changes for each discovered component.

  • For monolingual formats, the component must contain a file matching base_file_template and at least one translation file matching match, unless you set the file mask (see below).

Discovering components without translation files

Set Define the file mask to discover components from a monolingual base or new base file alone, even when no translation files exist yet. In that mode:

  • Configure Regular expression to match translation files against to match the monolingual base or new base file, and omit the language group. Keep full control over the component capture, for example locale/(?P<component>[^/]+)\.pot or docs/(?P<component>[^/_]+)\.md.

  • Fill Define the file mask with a path that includes both a language wildcard and {{ component }}, for example locale/*/{{ component }}.po or docs/{{ component }}_*.md.

  • Keep using the other filename templates with any named groups from the match expression.

Worked example: news_<lang>.md

This is a common filename-based language variant layout:

  • docs/news_en.md

  • docs/news_cs.md

  • docs/guide_en.md

Use the Filename-based language variants preset for a starting point, then choose the matching file format and review the populated values.

Espressione regolare:

(?:(?P<path>.*/))?(?P<component>.+?)_(?P<language>[A-Za-z]{2,3}(?:[_-][A-Za-z0-9]+)*)\.(?P<extension>[^/.]+)

Nome componente:

{{ component }}

Discovered file masks:
  • docs/news_*.md

  • docs/guide_*.md

In this example, {{ component }} resolves to the basename before the language suffix, so docs/news_en.md, docs/news_pt_BR.md, and docs/news_pt-BR.md all become the news component.

Puoi utilizzare il markup del modello Django in tutti i campi del nome file, ad esempio:

{{ component }}

Component name parsed from the component match group

{{ component|title }}

Nome file del componente con prima lettera maiuscola

{{ path }}: {{ component }}

Gruppo di corrispondenze personalizzato dall’espressione regolare

Once you hit Save, a preview of matching components will be presented, from where you can check whether the configuration actually matches your needs:

../_images/addon-discovery.webp

Esempi di rilevamento dei componenti

The worked example above covers the most common filename-based variant layout. The following examples show other repository structures you can match.

Una cartella per lingua

Una cartella per lingua contenente i file di traduzione per i componenti.

Espressione regolare:

(?P<language>[^/.]*)/(?P<component>[^/]*)\.po

File corrispondenti:
  • cs/application.po

  • cs/website.po

  • de/application.po

  • de/website.po

Gettext locales layout

Struttura abituale per la memorizzazione di file PO gettext.

Espressione regolare:

locale/(?P<language>[^/.]*)/LC_MESSAGES/(?P<component>[^/]*)\.po

File corrispondenti:
  • locale/cs/LC_MESSAGES/application.po

  • locale/cs/LC_MESSAGES/website.po

  • locale/de/LC_MESSAGES/application.po

  • locale/de/LC_MESSAGES/website.po

Nomi di file complessi

Uso sia del nome del componente, sia della lingua all’interno del nome file.

Espressione regolare:

src/locale/(?P<component>[^/]*)\.(?P<language>[^/.]*)\.po

File corrispondenti:
  • src/locale/application.cs.po

  • src/locale/website.cs.po

  • src/locale/application.de.po

  • src/locale/website.de.po

Codice lingua ripetuto

Uso della lingua sia nel percorso sia nel nome file.

Espressione regolare:

locale/(?P<language>[^/.]*)/(?P<component>[^/]*)/(?P=language)\.po

File corrispondenti:
  • locale/cs/application/cs.po

  • locale/cs/website/cs.po

  • locale/de/application/de.po

  • locale/de/website/de.po

Dividi stringhe Android

Stringhe risorse Android, separate in diversi file.

Espressione regolare:

res/values-(?P<language>[^/.]*)/strings-(?P<component>[^/]*)\.xml

File corrispondenti:
  • res/values-cs/strings-about.xml

  • res/values-cs/strings-help.xml

  • res/values-de/strings-about.xml

  • res/values-de/strings-help.xml

Corrispondenza di più percorsi

Progetto Maven multimodulo con traduzioni delle proprietà Java.

Espressione regolare:

(?P<originalHierarchy>.+/)(?P<component>[^/]*)/src/main/resources/ApplicationResources_(?P<language>[^/.]*)\.properties

Nome componente:

{{ originalHierarchy }}: {{ component }}

File corrispondenti:
  • parent/module1/submodule/src/main/resources/ApplicationResources_fr.properties

  • parent/module1/submodule/src/main/resources/ApplicationResource_es.properties

  • parent/module2/src/main/resources/ApplicationResource_de.properties

  • parent/module2/src/main/resources/ApplicationResource_ro.properties

Suggerimento

Component discovery add-on uses Weblate internal URLs. It’s a convenient way to share VCS setup between multiple components. Linked components use the local repository of the main component set up by filling weblate://project/main-component into the Repository codice sorgente field (in OperationsSettingsVersion control system) of each respective component. This saves time with configuration and system resources too.

Suggerimento

Ensure the new component contains the full set of translatable languages with Aggiungi lingue mancanti.

Messaggistica Fedora

Added in version 5.15.

ID componente aggiuntivo:

weblate.fedora_messaging.publish

Configurazione:

amqp_url

URL broker AMQP

L’URL del broker AMQP a cui connettersi.

topic_prefix

Topic prefix

Optional prefix to prepend to generated message topics.

publish_timeout

Publish timeout

How many seconds to wait for the broker delivery acknowledgement.

connection_attempts

Connection attempts

How many times to try connecting to the broker.

retry_delay

Ritardo per nuovo tentativo

How many seconds to wait between connection attempts.

ca_cert

Bundle certificato CA (PEM)

Paste only PEM certificate blocks, each starting with «—–BEGIN CERTIFICATE—–» and ending with «—–END CERTIFICATE—–«.

client_key

Client private key (PEM)

Paste a single unencrypted PEM private key block. Encrypted private keys are not supported.

client_cert

Certificato client (PEM)

Paste only the PEM certificate block starting with «—–BEGIN CERTIFICATE—–»; do not paste the output from «openssl x509 -text».

event_filter

Eventi di modifica che attivano

Choose which change events should trigger this add-on. Eventi di modifica che attivano

events

Eventi di modifica selezionati

Eventi di modifica selezionati

Triggers:

Cambiamento di eventi

Invia notifiche a uno scambio AMQP compatibile con Fedora Messaging.

Fedora Messaging is AMQP-based publisher for all changes happening in Weblate. You can hook additional services on changes happening in Weblate using this.

Argomento del messaggio

All messages have topic weblate.<action>.<project>.<category...>.<component>.<translation>. When configured, topic_prefix is prepended to this topic using a single dot separator, for example org.fedoraproject.weblate.project_backed_up.website. The action is lowercase textual representation of action with underscores instead of space, for example resource_updated; see Eventi di modifica selezionati for all action identifiers. The remaining parts match Weblate object path segments.

For example, a project backup event for the website project uses weblate.project_backed_up.website. A translation change in the website project, frontend component, and Czech translation uses weblate.translation_changed.website.frontend.cs. The same change in the frontend component inside the parent and child categories uses weblate.translation_changed.website.parent.child.frontend.cs.

Corpo del messaggio

The body consists of following fields (given that they are available for the event):

change_id

ID numerico della modifica

action

Nome dettagliato della modifica.

timestamp

Datazione in formato ISO

target

Nuovo valore della modifica (es. nuova traduzione della stringa)

old

Vecchio valore della modifica (es. traduzione precedente della stringa)

source

Stringa sorgente.

url

Absolute URL to view the related object.

author

Author username (this can be different from user for example when accepting suggestions)

user

Nome utente in qualità di agente

project

Project slug

component

Component slug

translation

Translation language code

Intestazioni dei messaggi

There are additional headers which you might utilize for routing as well:

action

Nome dettagliato della modifica.

project

Project slug

component

Component slug

Messaggi di esempio

Evento merge nel repository:

{
  "id": 1,
  "action": "Merged repository",
  "timestamp": "2017-06-15T11:30:47.325000+00:00",
  "url": "http://example.com/projects/test/test/",
  "component": "test"
}

Evento nuova stringa sorgente:

{
  "id": 2,
  "action": "New source string",
  "timestamp": "2017-06-15T11:30:47.372000+00:00",
  "url": "http://example.com/translate/test/test/cs/?checksum=6412684aaf018e8e",
  "component": "test",
  "translation": "cs",
  "source": ["Hello, world!\n"]
}

Evento risorsa aggiornata:

{
  "id": 6,
  "action": "Resource update",
  "timestamp": "2017-06-15T11:30:47.410000+00:00",
  "url": "http://example.com/projects/test/test/cs/",
  "project": "test",
  "component": "test",
  "translation": "cs"
}
{
  "id": 7,
  "action": "Resource update",
  "timestamp": "2017-06-15T11:30:47.510000+00:00",
  "url": "http://example.com/projects/test/test/de/",
  "project": "test",
  "component": "test",
  "translation": "de"
}
{
  "id": 8,
  "action": "Resource update",
  "timestamp": "2017-06-15T11:30:47.595000+00:00",
  "url": "http://example.com/projects/test/test/it/",
  "project": "test",
  "component": "test",
  "translation": "it"
}

Evento progetto rimosso:

{
  "id": 9,
  "action": "Removed project",
  "timestamp": "2019-10-17T15:57:08.559420+00:00",
  "target": "test",
  "user": "testuser"
}

Evento nuovo collaboratore:

{
  "id": 11,
  "action": "New contributor",
  "timestamp": "2019-10-17T15:57:08.759960+00:00",
  "url": "http://example.com/translate/test/test/cs/?checksum=6412684aaf018e8e",
  "author": "testuser",
  "user": "testuser",
  "project": "test",
  "component": "test",
  "translation": "cs",
  "source": ["Hello, world!\n"]
}

Evento nuova traduzione:

{
  "id": 12,
  "action": "New translation",
  "timestamp": "2019-10-17T15:57:08.772591+00:00",
  "url": "http://example.com/translate/test/test/cs/?checksum=6412684aaf018e8e",
  "target": ["Ahoj svete!\n"],
  "author": "testuser",
  "user": "testuser",
  "project": "test",
  "component": "test",
  "translation": "cs",
  "source": ["Hello, world!\n"]
}

Modifica collettiva

ID componente aggiuntivo:

weblate.flags.bulk

Configurazione:

q

Ricerca

state

Stato da impostare

Scelte disponibili:

-1

Non modificare

10

Richiede modifica

11

Da modificare (da riscrivere)

12

Da modificare (da verificare)

20

Tradotte

30

Approvato

add_flags

Flag traduzione da aggiungere

remove_flags

Flag traduzione da rimuovere

add_labels

Etichetta da aggiungere

remove_labels

Etichetta da rimuovere

Triggers:

Installazione di componenti aggiuntivi, Aggiornamento dei componenti

Modifica in blocco dei flag, delle etichette o dello stato delle stringhe.

Esempi:

Label new strings automatically

Domanda di ricerca

NOT has:label

Etichetta da aggiungere

recente

Marking all File metadati store app changelog strings read-only

Domanda di ricerca

language:en AND key:changelogs/

Flag traduzione da aggiungere

read-only

Contrassegnare determinate stringhe come di sola lettura

Domanda di ricerca

source:r"^\`\`[.a-zA-Z0-9_-]*\`\`$" AND language:en

Flag traduzione da aggiungere

read-only

Contrassegna le traduzioni invariate come «Da riscrivere»

ID componente aggiuntivo:

weblate.flags.same_edit

Configurazione:

Questo componente aggiuntivo non ha configurazione.

Triggers:

Unit pre-create

Ogni volta che una nuova stringa traducibile viene importata da VCS e corrisponde a una stringa sorgente, viene contrassegnata come stringa da riscrivere in Weblate. Particolarmente utile per i formati di file che includono stringhe sorgente per stringhe non tradotte.

Suggerimento

You might also want to tighthen the Traduzione invariata check by adding strict-same flag to Flag traduzione.

Vedi anche

Translation states

Contrassegna le nuove stringhe sorgenti come «Da verificare»

ID componente aggiuntivo:

weblate.flags.source_edit

Configurazione:

Questo componente aggiuntivo non ha configurazione.

Triggers:

Unit pre-create

Ogni volta che una nuova stringa sorgente viene importata dal VCS in Weblate, verrà contrassegnata come da verificare. In questo modo puoi facilmente filtrare e modificare le stringhe sorgenti inserite dagli sviluppatori.

Vedi anche

Translation states

Contrassegna le nuove traduzioni come «Da riscrivere»

ID componente aggiuntivo:

weblate.flags.target_edit

Configurazione:

Questo componente aggiuntivo non ha configurazione.

Triggers:

Unit pre-create

Ogni volta che una nuova traduzione viene importata dal VCS in Weblate, verrà contrassegnata come da riscrivere. In questo modo puoi facilmente filtrare e modificare le traduzioni scritte dagli sviluppatori.

Vedi anche

Translation states

Contrassegna le traduzioni aggiornate dal repository come «Da riscrivere»

ID componente aggiuntivo:

weblate.flags.target_repo_update

Configurazione:

Questo componente aggiuntivo non ha configurazione.

Triggers:

Unit post-sync

Ogni volta che una traduzione di stringhe viene modificata dal VCS, viene contrassegnata come da riscrivere in Weblate. Particolarmente utile se i file di traduzione vengono spesso aggiornati manualmente o da un servizio esterno.

Vedi anche

Translation states

Riempi le stringhe di sola lettura con i sorgenti

Added in version 4.18.

ID componente aggiuntivo:

weblate.generate.fill_read_only

Configurazione:

Questo componente aggiuntivo non ha configurazione.

Triggers:

Installazione di componenti aggiuntivi, Aggiornamento dei componenti, Giornalmente

Riempie la traduzione di stringhe di sola lettura con le stringhe sorgenti.

Generatore statistiche

ID componente aggiuntivo:

weblate.generate.generate

Configurazione:

scope

Output scope

Scelte disponibili:

translation

One file per translation

component

One file per component

filename

Nome file generato

template

Contenuto file generato

Triggers:

Installazione di componenti aggiuntivi, Aggiornamento dei componenti, Repository post-aggiunta, Repository post-remove, Repository pre-commit

Genera un file con informazioni dettagliate sulla stato traduzione.

Puoi usare un modello Django sia nel nome del file che nel contenuto, vedi Template markup per una descrizione dettagliata del markup.

Ad esempio generando un file di riepilogo per ogni traduzione:

Nome file generato

locale/{{ language_code }}.json

Contenuto
{
   "language": "{{ language_code }}",
   "strings": "{{ stats.all }}",
   "translated": "{{ stats.translated }}",
   "last_changed": "{{ stats.last_changed }}",
   "last_author": "{{ stats.last_author }}",
}

Component-wide output

Set Output scope to One file per component to maintain one locale list or statistics file for the entire component. The default, One file per translation, preserves existing configurations.

Component output is generated on installation and configuration changes. It is updated when translations are committed, languages are added or removed, and component files are reloaded. Language metadata changes are included on the next such update or when the add-on is reconfigured. Unchanged output does not create a new commit.

Both modes support component and project variables in filenames and content. In component mode, the content additionally receives translations, ordered by repository language code. Each item provides:

  • language_code: the language code used in the repository.

  • language_name: the English language name.

  • language_native_name: the name translated into its own language using Weblate’s catalogs, with an English fallback when unavailable.

  • language_direction: ltr or rtl.

  • filename and url: the translation filename and Weblate URL.

  • is_source: whether this is the component’s source translation.

  • stats: the same statistics available in translation mode.

The source translation is included. Templates can exclude it using {% if not item.is_source %}. Statistics use Weblate’s completion semantics. Custom language names are retained; there is no external locale-data lookup.

For example, generate locales.json for a website:

[
{% for item in translations %}
  {
    "code": {{ item.language_code|json }},
    "file": {{ item.filename|json }},
    "name": {{ item.language_native_name|json }},
    "dir": {{ item.language_direction|json }}
  }{% if not forloop.last %},{% endif %}
{% endfor %}
]

Or generate languages.py for an application:

names = {
{% for item in translations %}
    {{ item.language_code|python }}: {{ item.language_native_name|python }},
{% endfor %}
}
completeness = {
{% for item in translations %}
    {{ item.language_code|python }}: {{ item.stats.translated_percent|python }},
{% endfor %}
}

The json and python filters serialize complete values, including string quotes and escaping. Do not add quotes around their output. They also support lists and dictionaries; {{ translations|json }} exports all available data. Dates and times are serialized as ISO-formatted strings.

Vedi anche

Template markup

Pre completamento traduzione con sorgente

Added in version 4.11.

ID componente aggiuntivo:

weblate.generate.prefill

Configurazione:

Questo componente aggiuntivo non ha configurazione.

Triggers:

Installazione di componenti aggiuntivi, Aggiornamento dei componenti, Giornalmente

Riempi le stringhe da tradurre con la stringa sorgente.

All untranslated strings in the component will be filled with the source string, and marked as needing edit. Use this when you can not have empty strings in the translation files. .. AUTOGENERATED START: weblate.generate.pseudolocale .. This section is automatically generated by ./manage.py list_addons. Do not edit manually.

Generazione pseudo locale

Added in version 4.5.

ID componente aggiuntivo:

weblate.generate.pseudolocale

Configurazione:

source

Stringhe sorgente

target

Traduzione destinazione

Tutte le stringhe in questa traduzione verranno sovrascritte

prefix

Testo statico anteposto

var_prefix

Testo variabile anteposto

suffix

Testo statico aggiunto

var_suffix

Testo variabile aggiunto

var_multiplier

Moltiplicatore di testo variabile

Quante volte ripetere la parte variabile a seconda della lunghezza della stringa sorgente.

include_readonly

Includi stringhe sola lettura

Triggers:

Installazione di componenti aggiuntivi, Aggiornamento dei componenti, Giornalmente

Genera automaticamente una traduzione aggiungendo prefisso e suffisso alle stringhe sorgenti.

Pseudolocales are useful to find strings that are not prepared for localization. This is done by altering all translatable source strings to make it easy to spot unaltered strings when running the application in the pseudolocale language.

Finding strings whose localized counterparts might not fit the layout is also possible.

Using the variable parts makes it possible to look for strings which might not fit into the user interface after the localization - it extends the text based on the source string length. The variable texts are repeated by length of the text multiplied by the multiplier. For example Hello world with variable text _ and variable multiplier of 1 becomes Hello world___________ - the text is repeated once for each character in the source string.

Le stringhe verranno generate usando il seguente modello:

Prepended static text Prepended variable text Source string Appended variable text Appended static text

Suggerimento

You can use real languages for testing, but there are dedicated pseudolocales available in Weblate - en_XA and ar_XB.

Suggerimento

You can use this add-on to start translation to a new locale of an existing language or similar language. Once you add the translation to the component, follow to the add-on. Example: If you have fr and want to start fr_CA translation, simply set fr as the source, fr_CA as the target, and leave the prefix and suffix blank.

Uninstall the add-on once you have the new translation filled to prevent Weblate from changing the translations made after the copying.

Collaboratori nel commento

ID componente aggiuntivo:

weblate.gettext.authors

Configurazione:

Questo componente aggiuntivo non ha configurazione.

Triggers:

Repository pre-commit

Aggiorna la parte di commento dell’intestazione del file PO per includere i nomi dei collaboratori e gli anni che hanno contribuito.

The PO file header will look like this:

# Michal Čihař <michal@weblate.org>, 2012, 2018, 2019, 2020.
# Pavel Borecki <pavel@example.com>, 2018, 2019.
# Filip Hron <filip@example.com>, 2018, 2019.
# anonymous <noreply@weblate.org>, 2019.

Aggiorna la variabile ALL_LINGUAS nel file «configure»

ID componente aggiuntivo:

weblate.gettext.configure

Configurazione:

Questo componente aggiuntivo non ha configurazione.

Triggers:

Installazione di componenti aggiuntivi, Giornalmente, Repository post-aggiunta, Repository post-remove

Updates the ALL_LINGUAS variable in «configure», «configure.in» or «configure.ac» files, when a translation is added or removed.

Updates the ALL_LINGUAS variable in configure, configure.in or any configure.ac files, when a translation is added or removed.

Personalizza l’uscita gettext

Removed in version 5.13: Sostituito da Parametri del formato file.

Aggiorna il template gettext (Django)

Added in version 5.17.

ID componente aggiuntivo:

weblate.gettext.django

Configurazione:

interval

Frequenza di aggiornamento

Con quale frequenza il componente aggiuntivo deve aggiornare il file POT quando il componente viene aggiornato.

Scelte disponibili:

daily

Giornalmente

weekly

Settimanale

monthly

Mensile

normalize_header

Normalizza l’intestazione POT

Aggiorna le intestazioni gettext e sostituisce i commenti placeholder del POT.

location_mode

Fonte di posizioni

Scegli come l’estrazione scrive le posizioni di origine nel file POT. Usa questa opzione per mantenere le posizioni nel modello, omettendole però dai file PO tradotti.

Scelte disponibili:

file

Utilizzare le impostazioni del formato file

keep

Estrai posizioni al POT file

omit

Non estrarre le posizioni

Triggers:

Installazione di componenti aggiuntivi, Manual trigger, Repository post-aggiornamento

Aggiorna il template gettext utilizzando il comando makemessages integrato di Django.

This add-on updates the template configured in Modello per le nuove traduzioni. It is available for gettext PO components, and the component must define a template for new translations.

The selected update frequency applies to automatic runs after repository refreshes. Installing or reconfiguring the add-on runs it immediately, and manual runs from add-on management or the API also bypass the frequency schedule. After a successful update, Weblate commits the changed template and reloads source strings.

The template update does not update translation PO files by itself. Keep Aggiorna i file PO per adeguarli al file POT (msgmerge) installed when translation files should follow template changes automatically. The install form for this add-on can install that add-on, but existing add-on settings do not show that installation option again.

Django requirements

This add-on requires xgettext and msguniq. It runs Weblate’s internal extraction wrapper for Django messages instead of invoking a project’s manage.py makemessages, so it does not load project Django settings or applications.

The template for new translations must use the django or djangojs domain. Supported template names are django.pot, djangojs.pot, django.po, and djangojs.po. Weblate infers the source directory from the template path and skips repository locale directories while extracting.

Aggiorna file LINGUAS

ID componente aggiuntivo:

weblate.gettext.linguas

Configurazione:

Questo componente aggiuntivo non ha configurazione.

Triggers:

Installazione di componenti aggiuntivi, Giornalmente, Repository post-aggiunta, Repository post-remove

Updates the LINGUAS file when a translation is added or removed.

Aggiorna il file POT (Meson)

Added in version 5.17.

ID componente aggiuntivo:

weblate.gettext.meson

Configurazione:

interval

Frequenza di aggiornamento

Con quale frequenza il componente aggiuntivo deve aggiornare il file POT quando il componente viene aggiornato.

Scelte disponibili:

daily

Giornalmente

weekly

Settimanale

monthly

Mensile

normalize_header

Normalizza l’intestazione POT

Aggiorna le intestazioni gettext e sostituisce i commenti placeholder del POT.

location_mode

Fonte di posizioni

Scegli come l’estrazione scrive le posizioni di origine nel file POT. Usa questa opzione per mantenere le posizioni nel modello, omettendole però dai file PO tradotti.

Scelte disponibili:

file

Utilizzare le impostazioni del formato file

keep

Estrai posizioni al POT file

omit

Non estrarre le posizioni

data_dirs

ITS data directories

Newline-separated repository-relative directories containing an its subdirectory, for example po for po/its. Earlier directories override later directories and bundled rules.

comment_mode

Commenti sul codice

Scegli se xgettext debba estrarre nessun commento, tutti i commenti, o solamente commenti con una specifica etichetta.

Scelte disponibili:

off

Non estrarre i commenti

all

Estrai tutti i commenti

tagged

Estrai commenti con etichetta

comment_tag

Tag di commento

Il Tag passato a xgettext per il commento di estrazione quando si utilizza la modalità commenti con tag.

checks

controlli xgettext

Ulteriori controlli di validazione xgettext da abilitare per i messaggi estratti.

Scelte disponibili:

ellipsis-unicode

ellipsis-unicode

space-ellipsis

space-ellipsis

quote-unicode

quote-unicode

bullet-unicode

bullet-unicode

keyword

Parole chiave aggiuntive

Parole chiave aggiuntive separate da una nuova riga, passate a xgettext tramite –keyword.

keyword_exclusive

Utilizza esclusivamente le parole chiave

When enabled, passes --keyword without a value to xgettext before the additional keyword, disabling all default keywords so that only the keyword specified above is recognized.

preset

Preimpostazione Meson

Built-in xgettext argument preset matching Meson gettext integration. The GLib preset adds the keyword and format-flag options used by Meson’s gettext helper.

Scelte disponibili:

glib

GLib

Triggers:

Installazione di componenti aggiuntivi, Manual trigger, Repository post-aggiornamento

Aggiorna il modello gettext usando le convenzioni gettext di Meson.

This add-on updates the template configured in Modello per le nuove traduzioni. It is available for gettext PO components, and the component must define a template for new translations.

The selected update frequency applies to automatic runs after repository refreshes. Installing or reconfiguring the add-on runs it immediately, and manual runs from add-on management or the API also bypass the frequency schedule. After a successful update, Weblate commits the changed template and reloads source strings.

The template update does not update translation PO files by itself. Keep Aggiorna i file PO per adeguarli al file POT (msgmerge) installed when translation files should follow template changes automatically. The install form for this add-on can install that add-on, but existing add-on settings do not show that installation option again.

Meson requirements

This add-on requires xgettext; it does not invoke Meson. It follows Meson gettext conventions by reading POTFILES or POTFILES.in from the gettext directory and passing the GLib keyword and format-flag preset to xgettext.

The gettext directory is the directory containing the template configured in Modello per le nuove traduzioni. It must contain meson.build and POTFILES or POTFILES.in. A Meson project meson.build must be present in that directory or one of its parent directories. If both POTFILES and POTFILES.in exist, POTFILES is used. An adjacent POTFILES.skip excludes listed source files from extraction.

Configure this add-on from the existing Meson gettext setup. In most Meson projects, the gettext directory is po/, the template is named after the gettext domain, and po/meson.build calls Meson’s gettext helper. Use the same template path in Modello per le nuove traduzioni, for example po/example.pot, and keep POTFILES or POTFILES.in next to that meson.build file.

Weblate does not read the source file list from meson.build. It uses POTFILES or POTFILES.in, matching Meson’s gettext convention. When the Meson project uses a non-default gettext directory or domain, mirror that layout in the component template path.

Genera file MO

ID componente aggiuntivo:

weblate.gettext.mo

Configurazione:

path

Percorso del file MO generato

Se non specificato, verrà usato il percorso del file PO.

fuzzy

Includi stringhe che necessitano di modifica

Le stringhe che necessitano di modifica (fuzzy) in genere non sono pronte per essere usate come traduzioni.

Triggers:

Repository pre-commit

Genera automaticamente un file MO per ogni file PO modificato.

The location of the generated MO file can be customized and the field for it uses Template markup.

Nota

If a translation is removed, its PO file will be deleted from the repository, but the MO file generated by this add-on will not. The MO file must be removed from the upstream manually.

Aggiorna i file PO per adeguarli al file POT (msgmerge)

Cambiato nella versione 5.13: Settings configuration has been moved to Parametri del formato file.

ID componente aggiuntivo:

weblate.gettext.msgmerge

Configurazione:

Questo componente aggiuntivo non ha configurazione.

Triggers:

Installazione di componenti aggiuntivi, Repository post-aggiornamento

Aggiorna tutti i file PO (come configurato da «Maschera file») in modo che corrispondano al file POT (come configurato da «Modello per nuove traduzioni») utilizzando msgmerge.

This add-on is essential when working with gettext PO files where the POT (template) file is updated with new strings or changes to existing strings. When the POT file is updated in the repository, this add-on automatically merges those changes into all language PO files, ensuring that:

  • Nuove stringhe traducibili vengono visualizzate in tutte le lingue

  • Le stringhe rimosse sono contrassegnate come obsolete

  • Modified strings are marked as needing review (fuzzy)

Most msgmerge command-line options can be set up through file format parameters configuration. Enable the po_remove_obsolete parameter to remove obsolete #~ entries when PO files are saved.

Aggiorna il file POT (Sphinx)

Added in version 5.17.

ID componente aggiuntivo:

weblate.gettext.sphinx

Configurazione:

interval

Frequenza di aggiornamento

Con quale frequenza il componente aggiuntivo deve aggiornare il file POT quando il componente viene aggiornato.

Scelte disponibili:

daily

Giornalmente

weekly

Settimanale

monthly

Mensile

normalize_header

Normalizza l’intestazione POT

Aggiorna le intestazioni gettext e sostituisce i commenti placeholder del POT.

location_mode

Fonte di posizioni

Scegli come l’estrazione scrive le posizioni di origine nel file POT. Usa questa opzione per mantenere le posizioni nel modello, omettendole però dai file PO tradotti.

Scelte disponibili:

file

Utilizzare le impostazioni del formato file

keep

Estrai posizioni al POT file

omit

Non estrarre le posizioni

filter_mode

Filtraggio

Facoltativamente, è possibile rimuovere le stringhe non utili alla traduzione dopo l’estrazione con Sphinx.

Scelte disponibili:

none

Nessuno

weblate_docs

Documentazione Weblate

Triggers:

Installazione di componenti aggiuntivi, Manual trigger, Repository post-aggiornamento

Aggiorna il template gettext utilizzando il generatore gettext di Sphinx senza caricare la configurazione del progetto.

This add-on updates the template configured in Modello per le nuove traduzioni. It is available for gettext PO components, and the component must define a template for new translations.

The selected update frequency applies to automatic runs after repository refreshes. Installing or reconfiguring the add-on runs it immediately, and manual runs from add-on management or the API also bypass the frequency schedule. After a successful update, Weblate commits the changed template and reloads source strings.

The template update does not update translation PO files by itself. Keep Aggiorna i file PO per adeguarli al file POT (msgmerge) installed when translation files should follow template changes automatically. The install form for this add-on can install that add-on, but existing add-on settings do not show that installation option again.

Sphinx requirements

This add-on requires sphinx-build, provided by the sphinx installation extra. The template for new translations must be a .pot file below a locales directory. The directory before locales is used as the Sphinx source directory and must contain conf.py.

Extraction uses Weblate’s bundled Sphinx configuration and does not load the project configuration. Weblate runs the Sphinx gettext builder, normalizes source references to paths relative to the source directory, and copies the generated template back to the configured template path.

Aggiorna il file POT (xgettext)

Added in version 5.17.

ID componente aggiuntivo:

weblate.gettext.xgettext

Configurazione:

interval

Frequenza di aggiornamento

Con quale frequenza il componente aggiuntivo deve aggiornare il file POT quando il componente viene aggiornato.

Scelte disponibili:

daily

Giornalmente

weekly

Settimanale

monthly

Mensile

normalize_header

Normalizza l’intestazione POT

Aggiorna le intestazioni gettext e sostituisce i commenti placeholder del POT.

location_mode

Fonte di posizioni

Scegli come l’estrazione scrive le posizioni di origine nel file POT. Usa questa opzione per mantenere le posizioni nel modello, omettendole però dai file PO tradotti.

Scelte disponibili:

file

Utilizzare le impostazioni del formato file

keep

Estrai posizioni al POT file

omit

Non estrarre le posizioni

data_dirs

ITS data directories

Newline-separated repository-relative directories containing an its subdirectory, for example po for po/its. Earlier directories override later directories and bundled rules.

comment_mode

Commenti sul codice

Scegli se xgettext debba estrarre nessun commento, tutti i commenti, o solamente commenti con una specifica etichetta.

Scelte disponibili:

off

Non estrarre i commenti

all

Estrai tutti i commenti

tagged

Estrai commenti con etichetta

comment_tag

Tag di commento

Il Tag passato a xgettext per il commento di estrazione quando si utilizza la modalità commenti con tag.

checks

controlli xgettext

Ulteriori controlli di validazione xgettext da abilitare per i messaggi estratti.

Scelte disponibili:

ellipsis-unicode

ellipsis-unicode

space-ellipsis

space-ellipsis

quote-unicode

quote-unicode

bullet-unicode

bullet-unicode

keyword

Parole chiave aggiuntive

Parole chiave aggiuntive separate da una nuova riga, passate a xgettext tramite –keyword.

keyword_exclusive

Utilizza esclusivamente le parole chiave

When enabled, passes --keyword without a value to xgettext before the additional keyword, disabling all default keywords so that only the keyword specified above is recognized.

input_mode

Sorgente di ingresso

Scegli se xgettext deve leggere i file sorgente dai pattern glob o da un manifesto POTFILES/POTFILES.in.

Scelte disponibili:

patterns

Modelli file di origine

potfiles

Manifesti di POTFILES

language

linguaggio xgettext

Linguaggio di programmazione passato a xgettext, ad esempio Python o C. Lascia vuoto per lasciare che xgettext indovini il linguaggio dalle estensioni dei file.

source_patterns

Modelli file di origine

Pattern glob relativi al repository, separati da interruzioni di riga, per i file da estrarre con xgettext.

potfiles_path

Percorso POTFILES

Percorso relativo al repository per POTFILES o POTFILES.in. Le voci vengono risolte rispetto alla radice del repository. Se presente accanto al manifesto, POTFILES.skip esclude i file elencati dall’estrazione.

Triggers:

Installazione di componenti aggiuntivi, Manual trigger, Repository post-aggiornamento

Aggiorna il modello gettext utilizzando xgettext sui file sorgente selezionati.

This add-on updates the template configured in Modello per le nuove traduzioni. It is available for gettext PO components, and the component must define a template for new translations.

The selected update frequency applies to automatic runs after repository refreshes. Installing or reconfiguring the add-on runs it immediately, and manual runs from add-on management or the API also bypass the frequency schedule. After a successful update, Weblate commits the changed template and reloads source strings.

The template update does not update translation PO files by itself. Keep Aggiorna i file PO per adeguarli al file POT (msgmerge) installed when translation files should follow template changes automatically. The install form for this add-on can install that add-on, but existing add-on settings do not show that installation option again.

xgettext requirements

This add-on requires xgettext. Configure either source file patterns or a POTFILES / POTFILES.in manifest. Source file patterns are repository-relative glob patterns and only matching repository files are passed to xgettext.

Entries in POTFILES or POTFILES.in are resolved relative to the repository root. They must be relative paths, stay inside the repository, and point to existing files. Blank lines and lines starting with # are ignored. If a POTFILES.skip file exists next to the manifest, its entries are excluded from extraction.

Automatic repository refresh runs are skipped unless the changed files match the configured source patterns, match files listed in the manifest, change a watched manifest, or change the add-on configuration.

Start from the build-system extraction setup when configuring this add-on. Autotools projects usually keep gettext inputs in po/POTFILES.in and options such as the gettext domain and xgettext flags in po/Makevars or related Makefile.am files. Use manifest mode with the same POTFILES.in when its entries are plain repository-relative source paths, and copy relevant extraction behavior into the add-on settings, for example the language, comment extraction, checks, and additional keyword.

For other build systems, use the source list or extraction command they already run as the source of truth. CMake, custom Makefiles, npm scripts, or project specific extraction scripts often call xgettext directly or generate an intermediate file list. Configure source patterns for simple layouts, or use manifest mode when the project maintains a plain file list. If a build-system manifest contains transformations or prefixes that are not file paths, convert it to plain repository-relative paths before using it as POTFILES.

Mixed source formats and ITS rules

Leave xgettext language blank to extract messages from different formats into the same POT. Include all inputs in the source patterns or POTFILES, for example:

common/messages.py
qt/application.desktop
qt/application.policy
data/application.metainfo.xml

Desktop entries use the native xgettext parser. Weblate bundles ITS rules for Polkit policies, AppStream/MetaInfo, GSettings, GTK Builder, and Shared MIME Info. These rules are included in the Weblate package, including Docker installations; no additional system packages are required for these formats. The Aggiorna il file POT (Meson) add-on uses the same rules.

Extraction follows upstream gettext and ITS behavior. In particular, desktop extraction includes keys such as Name, GenericName, and Comment; Polkit rules select description and message elements without filtering by gettext-domain. Use untranslated policy sources: upstream Polkit rules also select elements carrying xml:lang.

For custom XML formats or overrides, configure ITS data directories. Enter one repository-relative directory per line, in priority order. Each must contain an its/ subdirectory with .loc locating rules and .its extraction rules. For example, enter po for po/its/example.loc and po/its/example.its, or . for its/ at the repository root. In API add-on configuration, use a list: "data_dirs": ["po", "data"].

Earlier directories take precedence over later ones, followed by Weblate’s bundled rules and gettext’s system rules. The directories are passed through GETTEXTDATADIRS. Configure them explicitly even when using Meson; Weblate does not read data_dirs from meson.build or inherit an administrator’s GETTEXTDATADIRS environment variable.

Rule directories and files must stay inside the repository and must not be symbolic links. A locating rule’s target must name an existing .its file in the same directory. DTDs, entity declarations, and external rule references are not supported. Weblate validates project-local rules before extraction and reports invalid rules as add-on errors. Changes, additions, or deletions in the configured its/ directories trigger extraction even when source files have not changed.

Unisci commit Git

ID componente aggiuntivo:

weblate.git.squash

Configurazione:

squash

Compressione commit

Scelte disponibili:

all

Tutte i commit in uno

language

Per lingua

file

Per file

author

Per autore

append_trailers

Aggiungi trailer al messaggio commit compresso

Le linee trailer sono linee simili alle intestazioni e-mail di RFC 822, alla fine della parte altrimenti libera di un messaggio di commit, ad esempio “Co-autore: …”.

commit_message

Messaggio commit

Questo messaggio di commit verrà usato al posto dei messaggi di commit combinati dai commit compressi.

Triggers:

Installazione di componenti aggiuntivi, Repository post-commit

Unisci i commit Git prima del push delle modifiche.

Suggerimento

To avoid unnecessary conflicts, it is recommended to configure automatic receiving of upstream changes by webhooks or API, see Updating repositories.

Git commits can be squashed prior to pushing changes in one of the following modes:

  • Tutte i commit in uno

  • Per lingua

  • Per file

  • Per autore

I messaggi di modifica originali saranno mantenuti ma l’informazione sull’autore non verrà conservata a meno che non sia selezionato Per autore o si personalizzi il messaggio di modifica per includerlo.

The original commit messages can optionally be overridden with a custom commit message.

Trailers (commit lines like Co-authored-by: ) can optionally be removed from the original commit messages and appended to the end of the squashed commit message. This also generates proper Co-authored-by: credit for every translator.

Personalizza l’uscita JSON

Cambiato nella versione 5.12: Avoid spaces after separators option added.

Removed in version 5.13: Sostituito da Parametri del formato file.

Ripristina archivio in upstream

Added in version 5.17.

ID componente aggiuntivo:

weblate.hosted.reset

Configurazione:

Questo componente aggiuntivo non ha configurazione.

Triggers:

Installazione di componenti aggiuntivi, Giornalmente

Elimina tutte le modifiche nel repository Weblate ogni notte.

Formatta il file delle proprietà Java

ID componente aggiuntivo:

weblate.properties.sort

Configurazione:

case_sensitive

Abilita l’ordinamento delle chiavi con distinzione tra maiuscole e minuscole

Triggers:

Repository pre-commit

Formatta ed ordina il file delle proprietà Java.

  • Consolidates newlines to Unix ones.

  • Uppercase formatting of Unicode escape sequences (in case they are present).

  • Elimina le righe vuote e i commenti.

  • Ordina le stringhe in base ai tasti.

  • Elimina le stringhe duplicate.

Rimozione commenti obsoleti

ID componente aggiuntivo:

weblate.removal.comments

Configurazione:

age

Giorni di archiviazione

Triggers:

Installazione di componenti aggiuntivi, Giornalmente

Imposta un termine per la rimozione dei commenti.

This can be useful to remove old comments which might have become outdated. Use with care as comments getting old does not mean they have lost their importance.

Rimozione suggerimenti obsoleti

ID componente aggiuntivo:

weblate.removal.suggestions

Configurazione:

age

Giorni di archiviazione

votes

Soglia votazione

Soglia per la rimozione. Lascia vuoto per rimuovere i suggerimenti indipendentemente dai voti. Questo campo non ha effetto con la votazione disabilitata.

Triggers:

Installazione di componenti aggiuntivi, Giornalmente

Imposta un termine per la rimozione dei suggerimenti.

Can be very useful in connection with suggestion voting (see Peer review) to remove suggestions which don’t receive enough positive votes in a given timeframe.

Aggiorna file RESX

ID componente aggiuntivo:

weblate.resx.update

Configurazione:

Questo componente aggiuntivo non ha configurazione.

Triggers:

Installazione di componenti aggiuntivi, Repository post-aggiornamento

Aggiorna tutti i file traduzione per farli corrispondere ai file singola lingua di base. Le stringhe non usate saranno rimosse e aggiungerà quelle nuove come copia delle stringhe sorgenti.

Suggerimento

Use Pulisci i file di traduzione if you only want to remove stale translation keys.

Webhook di Slack

Added in version 5.12.

ID componente aggiuntivo:

weblate.webhook.slack

Configurazione:

webhook_url

URL webhook

event_filter

Eventi di modifica che attivano

Choose which change events should trigger this add-on. Eventi di modifica che attivano

events

Eventi di modifica selezionati

Eventi di modifica selezionati

Triggers:

Cambiamento di eventi

Invia notifiche a un canale Slack in base agli eventi selezionati.

Avvertimento

The notification content might show HTML tags. This is a known issue that will be soon addressed; see https://github.com/WeblateOrg/weblate/issues/15056.

Suggerimento

To obtain a webhook URL, follow the steps outlined in the Slack Incoming Webhooks documentation

Webhook

Added in version 5.11.

Cambiato nella versione 5.15: Compliance of the secret length with the specification is now validated.

ID componente aggiuntivo:

weblate.webhook.webhook

Configurazione:

webhook_url

URL webhook

secret

Segreto Webhook

Il segreto per i Webhook Standard è una stringa codificata in base64.

event_filter

Eventi di modifica che attivano

Choose which change events should trigger this add-on. Eventi di modifica che attivano

events

Eventi di modifica selezionati

Eventi di modifica selezionati

Triggers:

Cambiamento di eventi

Invia notifiche a servizi esterni in base a eventi selezionati, seguendo le specifiche dei webhook standard.

The request payload complies with the Weblate Messaging schema. The action field uses the action name listed in Eventi di modifica selezionati. The OpenAPI description can also be found at /api/docs/. Sample request body:

{
   "change_id": 99,
   "action": "Translation changed",
   "timestamp": "2019-08-24T14:15:22Z",
   "target": "Nazdar svete!",
   "old": "Nazdar!",
   "source": "Hello, world",
   "url": "/translate/project-slug/component-slug/cs/?checksum=46add148a53cab6f",
   "author": "author-username",
   "user": "user-username",
   "project": "project-slug",
   "component": "component-slug",
   "translation": "cs"
}

Sample request body with categories:

{
   "change_id": 8910,
   "action": "Component renamed",
   "timestamp": "2025-06-11T07:15:09Z",
   "target": ["new-name"],
   "old": ["component-slug"],
   "url": "/projects/project-slug/parent-category/child-category/sub-category/component-slug/",
   "user": "testuser",
   "project": "project-slug",
   "component": "component-slug",
   "category": [
      "sub-category",
      "child-category",
      "parent-category"
   ]
}

Sample request headers:

{
   "webhook-id": "7f1c5477f6275a69af7b83236c20cb1a",
   "webhook-timestamp": "1748505623.044281",
   "webhook-signature": "v1,Ceo5qEr07ixe2NLpvHk3FH9bwy/WavXrAFQ/9tdO6mc="
}

The webhook-signature is a space separated list of HMAC signatures generated using the secret string, the request payload, the webhook-timestamp, and the webhook-id. This ensures the authenticity and integrity of the webhook request.

The provided secret is a base64 encoded string between 24 bytes (192 bits) and 64 bytes (512 bits). It can be prefixed with whsec_ for easy identification.

To verify a request, you can use the Webhook.verify method from the standardwebhooks library or an implementation of the «Standard Webhooks Specification».

The Traduzione automatica mode Add as approved translation creates approved strings when reviews are enabled for the target language. If the project settings or a language workflow override disable reviews, it creates translated strings instead. The configured mode is preserved, including for project-wide and site-wide add-ons whose targets have different review settings. Configuring this mode requires the usual add-on management permission; it does not require the configuring user to be a reviewer.

The Scoperta dei componenti add-on stops with an error if the repository scan exceeds 100,000 paths or matching translation files would require more than 1,000,000 path-to-mask comparisons. The comparison limit is checked using the number of repository paths multiplied by the number of file masks. These fixed limits bound resource consumption when repository content determines the masks. When either limit is exceeded, discovery does not create or remove components.

Componenti aggiuntivi obsoleti

Personalizza output XML

Added in version 4.15.

Removed in version 5.13: Sostituito da Parametri del formato file.

Personalizza output YAML

Removed in version 5.13: Sostituito da Parametri del formato file.

Parametri comuni dei componenti aggiuntivi

Motori di traduzione automatica

Scelte disponibili:

alibaba

Alibaba

aws

Amazon Translate

anthropic

Anthropic

apertium-apy

Apertium APy

microsoft-translator

Azure AI Translator

azure-openai

Azure OpenAI

baidu

Baidu

cyrtranslit

CyrTranslit

deepl

DeepL

glosbe

Glosbe

google-translate-api-v3

Google Cloud Translation Advanced

google-translate

Google Cloud Translation Basic

ltengine

LTEngine

libretranslate

LibreTranslate

mistral

Mistral

modernmt

ModernMT

mymemory

MyMemory

netease-sight

Netease Sight

ollama

Ollama

openai

OpenAI

sap-translation-hub

SAP Translation Hub

systran

Systran

weblate

Weblate

weblate-translation-memory

Weblate Translation Memory

yandex

Yandex

yandex-v2

Yandex v2

youdao-zhiyun

Youdao Zhiyun

tmserver

tmserver

Formato file

Scelte disponibili:

apple-xliff

XLIFF 1.2 con estensioni Apple

appstore

File metadati store app

arb

File ARB

aresource

Stringhe risorse Android

asciidoc

File AsciiDoc

ass

File sottotitoli Advanced SubStation Alpha

catkeys

Haiku catkeys

cmp-resource

Componi risorsa multipiattaforma

csv

File CSV

csv-multi

File CSV multivalore

csv-simple

File CSV semplice

dokuwiki

File testo DokuWiki

dtd

File DTD

flatxml

File YAML semplice

fluent

File Fluent

formatjs

File Format.JS JSON

go-i18n-json

File JSON go-i18n v1

go-i18n-json-v2

File JSON go-i18n v2

go-i18n-toml

File TOML go-i18n

gotext

File JSON gotext

gwt

Proprietà GWT

html

File HTML

i18next

File JSON i18next v3

i18nextv4

File JSON i18next v4

idml

File IDML

ini

File INI

islu

File INI Inno Setup

joomla

File lingua Joomla

json

File JSON

json-nested

File struttura annidata JSON

laravel

Stringhe PHP Laravel

markdown

File Markdown

mdx

File MDX

mediawiki

File testo MediaWiki

mi18n-lang

File di lingua @draggable/i18n

moko-resource

Risorsa Kotlin mobile

nextcloud-json

File JSON di Nextcloud

odf

File OpenDocument

php

Stringhe PHP

plainxliff

File traduzione XLIFF 1.2

po

File PO gettext

po-mono

File PO gettetx (monolingue)

poxliff

XLIFF 1.2 con estensioni gettext

properties

Proprietà Java

rc

File RC

resjson

File RESJSON

resourcedictionary

File dizionario risorse

resx

File risorse .NET

ruby-yaml

File YAML Ruby

srt

File sottotitoli SubRip

ssa

File sottotitoli SubStation Alpha

strings

Stringhe iOS

stringsdict

File Stringsdict

sub

File sottotitoli MicroDVD

tbx

File TermBase eXchange

toml

File TOML

ts

File di traduzione Qt Linguist (versione 2)

ts1

File di traduzione Qt Linguist (versione 1)

txt

File di testo normale

webextension

File JSON WebExtension

wxl

File WixLocalization

xliff

XLIFF 1.2 con supporto posizionabili

xliff2

File traduzione XLIFF 2.0

xliff2-placeables

File traduzione XLIFF 2.0 con supporto per elementi posizionabili

xlsx

Open XML di Excel

xwiki-fullpage

XWiki Full Page

xwiki-java-properties

Proprietà Java di XWiki

xwiki-page-properties

Proprietà della pagina XWiki

yaml

File YAML

Eventi di modifica che attivano

Scelte disponibili:

content

Eventi sul contenuto della traduzione

all

Tutti gli eventi di modifica

custom

Eventi di modifica selezionati

Eventi di modifica selezionati

The following change actions can appear in notification payloads. Fedora Messaging uses the identifier column in message topics, while webhook payloads use the name column in the action field.

Scelte disponibili:

ID

Identifier

Nome

Descrizione

0

resource_updated

Risorsa aggiornata

Un file di traduzione è stato sincronizzato con il suo repository.

1

translation_completed

Traduzione completata

A language translation became fully translated after an individual edit. Automatic translation, uploads, and bulk edits do not emit this event.

2

translation_changed

Traduzione modificata

An existing translation was edited by a user.

3

comment_added

Commento aggiunto

È stato aggiunto un commento a una stringa.

4

suggestion_added

Aggiunto suggerimento

A translation suggestion was added.

5

translation_added

Traduzione aggiunta

Una stringa precedentemente non tradotta è stata tradotta da un utente.

6

automatically_translated

Tradotto automaticamente

A translation was added or changed by automatic translation. This is emitted instead of Translation added or Translation changed.

7

suggestion_accepted

Suggerimento accettato

Un suggerimento di traduzione è stato accettato come traduzione.

8

translation_reverted

Traduzione ripristinata

Una traduzione è stata ripristinata a un valore precedente.

9

translation_uploaded

Traduzione caricata

A translation was added or changed by a translation file upload. This is emitted instead of Translation added or Translation changed.

13

source_string_added

Stringa sorgente aggiunta

È stata aggiunta una stringa sorgente al di fuori del repository o degli aggiornamenti di caricamento.

14

component_locked

Componente bloccato

Un componente è stato bloccato per la traduzione.

15

component_unlocked

Componente sbloccato

Un componente è stato sbloccato per la traduzione.

17

changes_committed

Modifiche apportate

Pending component changes were committed.

18

changes_pushed

Modifiche inviate

Le modifiche del repository sono state inviate (push) a monte.

19

repository_reset

Reimpostazione repository

Un repository è stato ripristinato al suo stato originale.

20

repository_merged

Repository unito

Upstream repository changes were merged.

21

repository_rebased

Rebase del repository completato

Le modifiche del repository sono state ribasate sull’upstream.

22

repository_merge_failed

Unione del repository non riuscita

L’unione delle modifiche del repository upstream non è riuscita.

23

repository_rebase_failed

Rebase del repository non riuscito

Il rebase delle modifiche del repository non è riuscito.

24

parsing_failed

Analisi non riuscita

Weblate could not parse a translation file.

25

translation_removed

Traduzione rimossa

A language translation was removed.

26

suggestion_removed

Rimosso suggerimento

A translation suggestion was removed.

27

translation_replaced

Traduzione sostituita

A translation was changed by a search-and-replace operation. This is emitted instead of Translation changed.

28

repository_push_failed

Push del repository non riuscito

L’invio (push) delle modifiche del repository a monte non è riuscito.

29

suggestion_removed_during_cleanup

Suggerimento rimosso durante pulizia

Durante la fase di pulizia è stato rimosso un suggerimento di traduzione obsoleto.

30

source_string_changed

Stringa sorgente modificata

Una stringa sorgente è stata modificata in Weblate.

31

string_added

Stringa aggiunta

A new string was added in Weblate.

32

bulk_status_changed

Stato modificato in massa

The translation state of one or more strings was changed in bulk.

33

visibility_changed

Visibilità modificata

Project or component visibility was changed.

34

user_added

Utente aggiunto

A user was granted access.

35

user_removed

Utente rimosso

L’accesso di un utente è stato rimosso.

36

translation_approved

Traduzione approvata

Una traduzione è stata approvata durante la revisione.

37

marked_for_edit

Contrassegnate per la modifica

Una traduzione è stata contrassegnata come bisognosa di modifica.

38

component_removed

Componente rimosso

Un componente di traduzione è stato rimosso.

39

project_removed

Progetto rimosso

A translation project was removed.

41

project_renamed

Progetto rinominato

Un progetto di traduzione è stato rinominato.

42

component_renamed

Componente rinominato

Un componente di traduzione è stato rinominato.

43

moved_component

Componente spostato

Un componente è stato spostato all’interno di un progetto.

45

contributor_joined

Collaboratore aggiunto

Un utente ha dato il suo primo contributo a una traduzione.

46

announcement_posted

Annuncio pubblicato

È stato affisso un annuncio.

47

alert_triggered

Avviso attivato

È stato attivato un avviso relativo a un componente.

48

language_added

Lingua aggiunta

È stata aggiunta una traduzione linguistica.

49

language_requested

Lingua richiesta

Un utente ha richiesto una nuova lingua.

50

project_created

Progetto creato

È stato creato un progetto di traduzione.

51

component_created

Componente creato

È stato creato un componente di traduzione.

52

user_invited

Utente invitato

A user was invited to a project.

53

repository_notification_received

Notifica del repository ricevuta

Weblate ha ricevuto una notifica dal repository di una piattaforma di hosting del codice.

54

translation_replaced_file_by_upload

File sostituito dalla traduzione con upload

Il file di traduzione è stato sostituito da un file caricato.

55

license_changed

Licenza modificata

Project or component license information changed.

56

contributor_license_agreement_changed

Contratto di licenza per collaboratori modificato

The contributor license agreement was changed.

57

screenshot_added

Screenshot aggiunto

Uno screenshot è stato associato a una stringa.

58

screenshot_uploaded

Screenshot caricato

A screenshot image was uploaded.

59

string_updated_in_the_repository

Stringa aggiornata nel repository

A string was changed while synchronizing from the repository.

60

add-on_installed

Add-on installato

An add-on was installed.

61

add-on_configuration_changed

Configurazione dell’add-on modificata

An add-on’s configuration was changed.

62

add-on_uninstalled

Add-on disinstallato

An add-on was uninstalled.

63

string_removed

Stringa rimossa

Una stringa è stata rimossa da una traduzione.

64

comment_removed

Commento rimosso

A string comment was removed.

65

comment_resolved

Commento risolto

A string comment was marked as resolved.

66

explanation_updated

Spiegazione aggiornata

La spiegazione di una stringa sorgente è stata aggiornata.

67

category_removed

Categoria rimossa

Una categoria di componenti è stata rimossa.

68

category_renamed

Categoria rinominata

Una categoria di componenti è stata rinominata.

69

category_moved

Categoria spostata

Una categoria di componenti è stata spostata.

70

saving_string_failed

Salvataggio stringa non riuscito

Weblate non è riuscito a salvare una stringa modificata.

71

string_added_in_the_repository

Stringa aggiunta nel repository

A new string was found while synchronizing from the repository.

72

string_updated_in_the_upload

Stringa aggiornata nel caricamento

Una stringa è stata modificata durante l’elaborazione di un file caricato.

73

string_added_in_the_upload

Stringa aggiunta nel caricamento

È stata trovata una nuova stringa durante l’elaborazione di un file caricato.

74

translation_updated_by_source_upload

Traduzione aggiornata dal caricamento della sorgente

A translation was synchronized after uploading a source file.

75

component_translation_completed

Traduzione del componente completata

All language translations in a component became fully translated after an individual edit. Automatic translation, uploads, and bulk edits do not emit this event.

76

applied_enforced_check

Controllo forzato applicato

A translation was marked as needing editing by an enforced check.

77

propagated_change

Cambiamento propagato

A translation edit was propagated to another matching string.

78

file_uploaded

File caricato

Un file è stato caricato in una traduzione.

79

extra_flags_updated

Flag extra aggiornati

I flag aggiuntivi della stringa sorgente sono stati aggiornati.

80

font_uploaded

Font caricato

A font was uploaded.

81

font_changed

Font modificato

Un font caricato è stato modificato.

82

font_removed

Font rimosso

Un font caricato è stato rimosso.

83

forced_synchronization_of_translations

Sincronizzazione forzata delle traduzioni

Translation files were forcibly synchronized with the repository.

84

forced_rescan_of_translations

Nuova scansione forzata delle traduzioni

I file di traduzione sono stati riscansionati forzatamente per le modifiche.

85

screenshot_removed

Screenshot rimosso

A screenshot was removed.

86

label_added

Etichetta aggiunta

A label was added to a string.

87

label_removed

Etichetta rimossa

A label was removed from a string.

88

repository_cleanup

Pulizia repository

The repository working tree was cleaned up.

89

source_string_added_in_the_upload

Stringa di origine aggiunta nel caricamento

A source string was added while processing an uploaded file.

90

source_string_added_in_the_repository

Stringa di origine aggiunta nel repository

A source string was added while synchronizing from the repository.

91

project_backed_up

Backup del progetto eseguito

A project backup was created.

92

project_restored

Progetto ripristinato

A project was restored from a backup.

93

component_restored

Componente ripristinato

A component was restored from a backup.

94

user_edit_reverted

Modifica utente ripristinata

All selected edits by a user were reverted.

95

project_setting_changed

Project setting changed

A project setting was changed.

96

component_setting_changed

Impostazione del componente modificata

Un’impostazione del componente è stata modificata.

97

user_access_changed

User access changed

A user’s access permissions were changed.

98

workspace_created

Spazio di lavoro creato

È stato creato uno spazio di lavoro.

99

workspace_setting_changed

Workspace setting changed

A workspace setting was changed.

100

project_moved

Project moved

A project was moved into or out of a workspace.

101

remote_repository_updated

Repository remoto aggiornato

Un aggiornamento del repository remoto è stato completato.

102

remote_repository_update_failed

Remote repository update failed

Updating a remote repository failed.

103

alert_dismissed

Avviso ignorato

Un avviso del componente è stato ignorato.

104

alert_reopened

Avviso riaperto

Un avviso del componente è stato riaperto dopo che il suo contesto è cambiato.

Personalizzazione dell’elenco dei componenti aggiuntivi

The list of add-ons is configured by WEBLATE_ADDONS. To add another add-on, simply include the absolute class name in this setting.

Componente aggiuntivo di scrittura

You can write your own add-ons too, create a subclass of weblate.addons.base.BaseAddon to define the add-on metadata, and then implement a callback to do the processing.

Esecuzione di script dal componente aggiuntivo

Add-ons can also be used to execute external scripts. This used to be integrated in Weblate, but now you have to write some code to wrap your script with an add-on.

# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later

"""Example pre commit script."""

from __future__ import annotations

from typing import ClassVar

from django.utils.translation import gettext_lazy

from weblate.addons.events import AddonEvent
from weblate.addons.scripts import BaseScriptAddon


class ExamplePreAddon(BaseScriptAddon):
    # Event used to trigger the script
    events: ClassVar[set[AddonEvent]] = {
        AddonEvent.EVENT_PRE_COMMIT,
    }
    # Name of the addon, has to be unique
    name = "weblate.example.pre"
    # Verbose name and long description
    verbose = gettext_lazy("Execute script before commit")
    description = gettext_lazy("This add-on executes a script.")

    # Script to execute
    script = "/bin/true"
    # File to add in commit (for pre commit event)
    # does not have to be set
    add_file = "po/{{ language_code }}.po"

For installation instructions see Controlli di qualità personalizzati, componenti aggiuntivi, suggerimenti automatici e auto correzioni.

The script is executed with the current directory set to the root of the VCS repository for any given component.

Additionally, the following environment variables are available:

WL_VCS

Version control system used.

WL_REPO

Upstream repository URL.

WL_PATH

Absolute path to VCS repository.

WL_BRANCH

Repository branch configured in the current component.

WL_FILEMASK

File mask for current component.

WL_TEMPLATE

Filename of template for monolingual translations (can be empty).

WL_NEW_BASE

Filename of the file used for creating new translations (can be empty).

WL_FILE_FORMAT

Formato file usato nel componente attuale.

WL_LANGUAGE

Language of currently processed translation (not available for component-level hooks).

WL_PREVIOUS_HEAD

Previous HEAD after update (only available after running the post-update hook).

WL_COMPONENT_SLUG

Component slug used to construct URL.

WL_PROJECT_SLUG

Project slug used to construct URL.

WL_COMPONENT_NAME

Component name.

WL_PROJECT_NAME

Project name.

WL_COMPONENT_URL

Component URL.

WL_ENGAGE_URL

Project engage URL.

Elaborazione del repository post-aggiornamento

Can be used to update translation files when the VCS upstream source changes. To achieve this, please remember Weblate only sees files committed to the VCS, so you need to commit changes as a part of the script.

For example with Gulp you can do it using following code:

#! /bin/sh
gulp --gulpfile gulp-i18n-extract.js
git commit -m 'Update source strings' src/languages/en.lang.json

Elaborazione preliminare delle traduzioni

Use the commit script to automatically change a translation before it is committed to the repository.

It is passed as a single parameter consisting of the filename of a current translation.

Registrazione dei componenti aggiuntivi

Add-on activity log keeps track of the add-on execution and can be used to keep track of add-on activity.

Each entry records whether processing is pending, successful, failed, or skipped. Skipped entries include the reason the add-on did not run, such as an incompatible component, no relevant changes, or a configured schedule that is not due yet. A successful entry can still mean that the add-on checked its inputs but found nothing to change.

For scope-wide add-ons that process components independently, the activity log contains a separate entry for each component.

The logs can be pruned after a certain time interval by configuring the ADDON_ACTIVITY_LOG_EXPIRY.