Tillegg

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 Håndteringsgrensesnitt.

Hint

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

Events that trigger add-ons

Add-on installation

Triggered when add-on is being installed.

Component update

Triggered whenever a change happens in a component such as:

  • Strings are changed in the repository.

  • A string is added.

  • A new translation is added.

Daily

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

Event change

Triggered after a Change event is created.

Manual trigger

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

Repository post-add

Triggered just after the new translation is added and committed.

Repository post-commit

Triggered just after the changes are committed.

Repository post-push

Triggered just after the repository is pushed upstream.

Repository post-remove

Triggered just after a translation is removed.

Repository post-update

Triggered whenever new changes are pulled from the upstream repository.

Repository pre-commit

Triggered just before the changes are committed.

Repository pre-push

Triggered just before the repository is pushed upstream.

Repository pre-update

Triggered just before the repository update is attempted.

Unit post-save

Triggered just after the string is saved.

Unit post-sync

Triggered after the string is synchronized with the VCS.

Unit pre-create

Triggered just after the newly created string is saved.

Built-in add-ons

Automatisk oversettelse

Add-on ID:

weblate.autotranslate.autotranslate

Oppsett:

mode

Automatisk oversettelsesmodus

Available choices:

suggest

Legg til som forslag

translate

Legg til som oversettelse

fuzzy

Legg til som «Trenger redigering»

q

Søk etter

Please note that translating all strings will discard all existing translations.

auto_source

Source of automated translations

Available choices:

others

Andre oversettelseskommentarer

mt

Maskinoversettelse

component

Komponent

Enter slug of a component to use as source, keep blank to use all components in the current project.

engines

Maskinoversettelsesmotorer

Maskinoversettelsesmotorer

threshold

Poengsumsterskel

Triggers:

Add-on installation, Component update, Daily, Event change

Oversetter strenger automatisk ved hjelp av maskinoversettelse eller andre komponenter.

JavaScript-lokaliseringsinnholdsleveransenettverk

Added in version 4.2.

Add-on ID:

weblate.cdn.cdnjs

Oppsett:

threshold

Oversettelsesterskel

The percentage of translated strings that must be present for translation to be included.

css_selector

CSS-velger

CSS-velger for å oppdage lokaliserbare elementer.

cookie_name

Navn på språkinformasjonskapsel

Navn på informasjonskapselen som lagrer språkinnstillinger.

files

Hent ut strenger fra HTML-filer

Liste over filnavn i gjeldende kodelager eller eksterne nettadresser å analysere for oversettbare strenger.

Triggers:

Add-on installation, Daily, Repository post-commit, Repository post-remove, Repository post-update

Legger oversettelser i innholdsleveringsnettverk for bruk i JavaScript- eller HTML-lokalisering.

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.

Merknad

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

Translation files CDN

Added in version 2026.5.

Add-on ID:

weblate.cdn.files

Oppsett:

This add-on has no configuration.

Triggers:

Add-on installation, Component update, Repository post-commit, Repository post-remove, Repository post-update

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 Localization CDN for secure serving guidance.

Fjern tomme strenger

Added in version 4.4.

Add-on ID:

weblate.cleanup.blank

Oppsett:

This add-on has no configuration.

Triggers:

Add-on installation, Repository post-commit, Repository post-update

Fjerner strenger uten oversettelse fra oversettelsesfiler.

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

Rydd opp i oversettelsesfiler

Add-on ID:

weblate.cleanup.generic

Oppsett:

This add-on has no configuration.

Triggers:

Add-on installation, Repository post-update, Repository pre-commit

Oppdater alle oversettelsesfiler for å stemme overens med den enkeltspråkelige basisfila. For de fleste filformater, betyr dette fjerning av ubrukte oversettelsesnøkler, som ikke lenger finnes i basisfila.

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

Legg til manglende språk

Add-on ID:

weblate.consistency.languages

Oppsett:

This add-on has no configuration.

Triggers:

Add-on installation, Daily, Repository post-add

Sikrer at samme liste med språk anvendes for alle komponenter i et prosjekt.

Merknad

The components shared from other projects are not considered in this.

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.

Hint

Auto-oversett nylig tillagt streng med Automatisk oversettelse.

Komponentoppdagelse

Add-on ID:

weblate.discovery.discovery

Oppsett:

match

Regulært uttrykk å jamføre oversettelsesfiler mot

The regular expression must define named groups for component and language.

file_format

Filformat

Filformat

name_template

Tilpass komponentnavnet

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

base_file_template

Definer ettspråklig basisfilnavn

Leave empty for bilingual translation files. When set, this template must include {{ component }}.

new_base_template

Definer basisfil for nye oversettelser

Filename of file used for creating new translations. For gettext choose .pot file. This template must include {{ component }}.

intermediate_template

Mellomliggende språkfil

Filename of intermediate translation file. In most cases this is a translation file provided by developers and is used when creating actual source strings. This template must include {{ component }}.

language_regex

Språkfilter

Regulært uttrykk å filtrere oversettelsesfiler mot ved skanning for filmaske.

copy_addons

Klon tillegg fra hovedkomponenten til de nylig opprettede

remove

Fjerner komponenter for ikke-eksisterende filer

Triggers:

Add-on installation, Repository post-update

Legger automatisk til eller fjerner prosjektkomponenter basert på filendringer i versjonskontrollsystemet.

The matching is done using regular expressions enabling complex configuration, but some knowledge is required to do so. The regular expression to match translation files has to contain two named groups to match component and language. 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 component and language named groups.

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

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.

Regular expression:

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

Component name:

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

You can use Django template markup in all filename fields, for example:

{{ component }}

Component name parsed from the component match group

{{ component|title }}

Komponentfilnavn med stor forbokstav

{{ path }}: {{ component }}

Custom match group from the regular expression

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

Component discovery examples

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

One folder per language

Én mappe per språk, inneholdende oversettelsesfiler for komponenter.

Regular expression:

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

Matching files:
  • cs/application.po

  • cs/website.po

  • de/application.po

  • de/website.po

Gettext locales layout

Vanlig struktur for lagring av gettext-PO-filer.

Regular expression:

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

Matching files:
  • locale/cs/LC_MESSAGES/application.po

  • locale/cs/LC_MESSAGES/website.po

  • locale/de/LC_MESSAGES/application.po

  • locale/de/LC_MESSAGES/website.po

Complex filenames

Bruker både komponent- og språk-navn i filnavn.

Regular expression:

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

Matching files:
  • src/locale/application.cs.po

  • src/locale/website.cs.po

  • src/locale/application.de.po

  • src/locale/website.de.po

Repeated language code

Bruker språk i både sti og filnavn.

Regular expression:

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

Matching files:
  • locale/cs/application/cs.po

  • locale/cs/website/cs.po

  • locale/de/application/de.po

  • locale/de/website/de.po

Split Android strings

Android-ressursstrenger, inndelt i flere filer.

Regular expression:

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

Matching files:
  • res/values-cs/strings-about.xml

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

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

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

Matching multiple paths

Multi-module Maven project with Java properties translations.

Regular expression:

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

Component name:

{{ originalHierarchy }}: {{ component }}

Matching files:
  • 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

Hint

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 Kodelager for kildekode field (in OperationsSettingsVersion control system) of each respective component. This saves time with configuration and system resources too.

Hint

Ensure the new component contains the full set of translatable languages with Legg til manglende språk.

Fedora Messaging

Added in version 5.15.

Add-on ID:

weblate.fedora_messaging.publish

Oppsett:

events

Endre hendelser

Endre hendelser

amqp_host

AMQP broker host

The AMQP broker to connect to.

amqp_ssl

Use SSL for AMQP connection

ca_cert

CA certificates

Bundle of PEM encoded CA certificates used to validate the certificate presented by the server.

client_key

Client SSL key

PEM encoded client private SSL key.

client_cert

Client SSL certificates

PEM encoded client SSL certificate.

Triggers:

Event change

Sends notifications to a Fedora Messaging compatible AMQP exchange.

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

Message topic

All messages have topic weblate.<action>.<project>.<component>.<translation>. The action is lowercase textual representation of action with underscores instead of space, for example resource_update, all other parts are optional and represent slug of the object or a language code.

Message body

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

change_id

Numerical ID of change

action

Verbose name of the change.

timestamp

ISO formatted timestamp

target

New value of the change (eg. new translation of the string)

old

Old value of the change (eg. previous translation of the string)

source

Source string.

url

Absolute URL to view the related object.

author

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

user

Acting username

project

Project slug

component

Component slug

translation

Translation language code

Message headers

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

action

Verbose name of the change.

project

Project slug

component

Component slug

Example messages

Repository merge event:

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

New source string event:

{
  "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"]
}

Resource update event:

{
  "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"
}

Project removal event:

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

New contributor event:

{
  "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"]
}

New translation event:

{
  "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"]
}

Masseredigering

Add-on ID:

weblate.flags.bulk

Oppsett:

q

Søk etter

state

Tilstand å sette

Available choices:

-1

Ikke endre

10

Trenger redigering

11

Trenger redigering (Trenger å skrives om)

12

Trenger redigering (Trenger å kontrolleres)

20

Oversatt

30

Godkjent

add_flags

Oversettelsesflagg å legge til

remove_flags

Oversettelsesflagg å fjerne

add_labels

Etiketter å legge til

remove_labels

Etiketter å fjerne

Triggers:

Add-on installation, Component update

Masseredigering av flagg, etiketter, eller tilstand for strenger.

Examples:

Etikettmerk nye strenger automatisk

Search query

NOT has:label

Etiketter å legge til

recent

Marking all Metadatafiler for programbutikk changelog strings read-only

Search query

language:en AND key:changelogs/

Oversettelsesflagg å legge til

read-only

Marking certain strings read-only

Search query

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

Oversettelsesflagg å legge til

read-only

Merk uendrede oversettelser som «Trenger å skrives om»

Add-on ID:

weblate.flags.same_edit

Oppsett:

This add-on has no configuration.

Triggers:

Unit pre-create

Whenever a new translatable string is imported from the VCS and it matches a source string, it is flagged as needing rewriting in Weblate. Especially useful for file formats that include source strings for untranslated strings.

Hint

You might also want to tighthen the Uendret oversettelse check by adding strict-same flag to Oversettelsflagg.

Merk nye kildestrenger som «Trenger å kontrolleres»

Add-on ID:

weblate.flags.source_edit

Oppsett:

This add-on has no configuration.

Triggers:

Unit pre-create

Whenever a new source string is imported from the VCS, it is flagged as needing checking in Weblate. This way you can easily filter and edit source strings written by the developers.

Merk nye oversettelser som «Trenger å skrives om»

Add-on ID:

weblate.flags.target_edit

Oppsett:

This add-on has no configuration.

Triggers:

Unit pre-create

Whenever a new translatable string is imported from the VCS, it is flagged as needing rewriting in Weblate. This way you can easily filter and edit translations created by the developers.

Merk oppdaterte oversettelser fra kodelager som «Trenger å skrives om»

Add-on ID:

weblate.flags.target_repo_update

Oppsett:

This add-on has no configuration.

Triggers:

Unit post-sync

Whenever a string translation is changed from the VCS, it is flagged as needing rewriting in Weblate. Especially useful if translation files are often updated manually or by an external service.

Fill read-only strings with source

Added in version 4.18.

Add-on ID:

weblate.generate.fill_read_only

Oppsett:

This add-on has no configuration.

Triggers:

Add-on installation, Component update, Daily

Fills in translation of read-only strings with source string.

Statistikkgenerator

Add-on ID:

weblate.generate.generate

Oppsett:

filename

Navn på generert fil

template

Innhold i den genererte fila

Triggers:

Add-on installation, Repository pre-commit

Genererer en fil med detaljert info om oversettelsen.

You can use a Django template in both filename and content, see Template markup for a detailed markup description.

For example generating a summary file for each translation:

Navn på generert fil

locale/{{ language_code }}.json

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

Se også

Template markup

Prefill translation with source

Added in version 4.11.

Add-on ID:

weblate.generate.prefill

Oppsett:

This add-on has no configuration.

Triggers:

Add-on installation, Component update, Daily

Fyller inn oversettelsesstrenger med kildestreng.

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.

Generering av pseudolokalitet

Added in version 4.5.

Add-on ID:

weblate.generate.pseudolocale

Oppsett:

source

Kildestrenger

target

Måloversettelse

Alle strenger i denne oversettelsen vil bli overskrevet

prefix

Prepended static text

var_prefix

Prepended variable text

suffix

Appended static text

var_suffix

Appended variable text

var_multiplier

Variable text multiplier

How many times to repeat the variable text depending on the length of the source string.

include_readonly

Inkluder skrivebeskyttede strenger

Triggers:

Add-on installation, Component update, Daily

Genererer en oversettelse automatisk ved å legge til innledning og endelse i kildestrenger.

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.

The strings will be generated using following pattern:

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

Hint

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

Hint

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.

Bidragsytere i kommentar

Add-on ID:

weblate.gettext.authors

Oppsett:

This add-on has no configuration.

Triggers:

Repository pre-commit

Oppdaterer kommentardelen i PO-filers topptekst med bidragsyternavn og antall år med bidrag.

PO-filhodet vil se slik ut:

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

Oppdater ALL_LINGUAS-variabel i «configure»-filen

Add-on ID:

weblate.gettext.configure

Oppsett:

This add-on has no configuration.

Triggers:

Add-on installation, Daily, Repository post-add, 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.

Tilpass gettext-utdata

Removed in version 5.13: Replaced by File format parameters.

Update gettext template (Django)

Added in version 5.17.

Add-on ID:

weblate.gettext.django

Oppsett:

interval

Update frequency

How often the add-on should update the POT file when the component is refreshed.

Available choices:

daily

Daily

weekly

Weekly

monthly

Månedlig

normalize_header

Normalize POT header

Updates gettext headers and replaces placeholder POT comments.

Triggers:

Add-on installation, Manual trigger, Repository post-update

Updates the gettext template using Django’s built-in makemessages command.

Oppdater LINGUAS-fil

Add-on ID:

weblate.gettext.linguas

Oppsett:

This add-on has no configuration.

Triggers:

Add-on installation, Daily, Repository post-add, Repository post-remove

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

Update POT file (Meson)

Added in version 5.17.

Add-on ID:

weblate.gettext.meson

Oppsett:

interval

Update frequency

How often the add-on should update the POT file when the component is refreshed.

Available choices:

daily

Daily

weekly

Weekly

monthly

Månedlig

normalize_header

Normalize POT header

Updates gettext headers and replaces placeholder POT comments.

comment_mode

Code comments

Choose whether xgettext should extract no comments, all comments, or only comments marked with a specific tag.

Available choices:

off

Do not extract comments

all

Extract all comments

tagged

Extract comments with tag

comment_tag

Comment tag

Tag passed to xgettext for comment extraction when using tagged comment mode.

checks

xgettext checks

Additional xgettext validation checks to enable for extracted messages.

Available choices:

ellipsis-unicode

ellipsis-unicode

space-ellipsis

space-ellipsis

quote-unicode

quote-unicode

bullet-unicode

bullet-unicode

keyword

Additional keyword

Optional extra keyword passed to xgettext using –keyword.

preset

Meson preset

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.

Available choices:

glib

GLib

Triggers:

Add-on installation, Manual trigger, Repository post-update

Updates the gettext template using Meson gettext conventions.

Generer MO-filer

Add-on ID:

weblate.gettext.mo

Oppsett:

path

Sti for generert MO-fil

Hvis ikke angitt, vil plasseringen for PO-filen brukes.

fuzzy

Include strings needing editing

Strenger som trenger redigering (fuzzy) er typisk ikke klare til bruk som oversettelser.

Triggers:

Repository pre-commit

Lager en MO-fil for hver endret PO-fil automatisk.

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

Merknad

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.

Oppdater PO-filer til å samsvare med POT (msgmerge)

Endret i version 5.13: Settings configuration has been moved to File format parameters.

Add-on ID:

weblate.gettext.msgmerge

Oppsett:

This add-on has no configuration.

Triggers:

Add-on installation, Repository post-update

Oppdaterer alle PO-filer (som definert av «Filmaske») for å samsvare med POT-fil (som definert av «Mal for nye oversettelser») ved bruk av 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:

  • New translatable strings appear in all languages

  • Removed strings are marked as obsolete

  • Modified strings are marked as needing review (fuzzy)

Most msgmerge command-line options can be set up through file format parameters configuration.

Update POT file (Sphinx)

Added in version 5.17.

Add-on ID:

weblate.gettext.sphinx

Oppsett:

interval

Update frequency

How often the add-on should update the POT file when the component is refreshed.

Available choices:

daily

Daily

weekly

Weekly

monthly

Månedlig

normalize_header

Normalize POT header

Updates gettext headers and replaces placeholder POT comments.

filter_mode

Filtering

Optionally remove strings that are not useful to translate after Sphinx extraction.

Available choices:

none

Ingen

weblate_docs

Weblate documentation

Triggers:

Add-on installation, Manual trigger, Repository post-update

Updates the gettext template using Sphinx’s gettext builder without loading project configuration.

Update POT file (xgettext)

Added in version 5.17.

Add-on ID:

weblate.gettext.xgettext

Oppsett:

interval

Update frequency

How often the add-on should update the POT file when the component is refreshed.

Available choices:

daily

Daily

weekly

Weekly

monthly

Månedlig

normalize_header

Normalize POT header

Updates gettext headers and replaces placeholder POT comments.

comment_mode

Code comments

Choose whether xgettext should extract no comments, all comments, or only comments marked with a specific tag.

Available choices:

off

Do not extract comments

all

Extract all comments

tagged

Extract comments with tag

comment_tag

Comment tag

Tag passed to xgettext for comment extraction when using tagged comment mode.

checks

xgettext checks

Additional xgettext validation checks to enable for extracted messages.

Available choices:

ellipsis-unicode

ellipsis-unicode

space-ellipsis

space-ellipsis

quote-unicode

quote-unicode

bullet-unicode

bullet-unicode

keyword

Additional keyword

Optional extra keyword passed to xgettext using –keyword.

input_mode

Input source

Choose whether xgettext should read source files from glob patterns or from a POTFILES/POTFILES.in manifest.

Available choices:

patterns

Source file patterns

potfiles

POTFILES manifest

language

xgettext language

Programming language passed to xgettext, for example Python or C.

source_patterns

Source file patterns

Newline-separated repository-relative glob patterns for files to extract with xgettext.

potfiles_path

POTFILES path

Repository-relative path to POTFILES or POTFILES.in. Entries are resolved relative to the repository root. If present next to the manifest, POTFILES.skip excludes listed files from extraction.

Triggers:

Add-on installation, Manual trigger, Repository post-update

Updates the gettext template using xgettext on selected source files.

Slå sammen Git-innsendelser

Add-on ID:

weblate.git.squash

Oppsett:

squash

Sammenslåing av innsendelser

Available choices:

all

Alle innsendelser i én

language

Per språk

file

Per fil

author

Per forfatter

append_trailers

Legg til trailere i sammenslått innsendelsesmelding

Sluttlinjer er linjer som ligner på RFC 822 e-postoverskrifter, på slutten av den ellers frie formdelen av en innsjekksmelding, for eksempel ’Co-authored-by: …’.

commit_message

Innsjekksmelding

Denne innsendelsesmeldingen vil brukes istedenfor de kombinerte innsendelsesmeldingene fra de sammenslåtte innsendelsene.

Triggers:

Add-on installation, Repository post-commit

Slå sammen Git-innsendelser før endringer overføres.

Hint

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:

  • Alle innsendelser i én

  • Per språk

  • Per fil

  • Per forfatter

Original commit messages are kept, but authorship is lost unless Per author is selected, or the commit message is customized to include it.

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.

Tilpass JSON-utdata

Endret i version 5.12: Avoid spaces after separators option added.

Removed in version 5.13: Replaced by File format parameters.

Tilbakestill kodelager til det oppstrøms

Added in version 5.17.

Add-on ID:

weblate.hosted.reset

Oppsett:

This add-on has no configuration.

Triggers:

Add-on installation, Daily

Forkaster alle forandringer i Weblate-kodelageret hver natt.

Formater Java-egenskapsfila

Add-on ID:

weblate.properties.sort

Oppsett:

case_sensitive

Enable case-sensitive key sorting

Triggers:

Repository pre-commit

Formaterer og sorterer Java-egenskapsfila.

  • Consolidates newlines to Unix ones.

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

  • Strips blank lines and comments.

  • Sorts the strings by the keys.

  • Drops duplicate strings.

Fjerning av gamle kommentarer

Add-on ID:

weblate.removal.comments

Oppsett:

age

Dager å beholde

Triggers:

Add-on installation, Daily

Sett tidsramme for fjerning av kommentarer.

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.

Fjerning av gamle forslag

Add-on ID:

weblate.removal.suggestions

Oppsett:

age

Dager å beholde

votes

Stemmeterskel

Threshold for removal. Leave empty to remove suggestions regardless of votes. This field has no effect with voting turned off.

Triggers:

Add-on installation, Daily

Sett tidsramme for fjerning av forslag.

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.

Oppdater RESX-filer

Add-on ID:

weblate.resx.update

Oppsett:

This add-on has no configuration.

Triggers:

Add-on installation, Repository post-update

Oppdater alle oversettelsesfiler for å stemme overens med den enkeltspråkelige basisfila oppstrøms. Ubrukte strenger fjernes, og nye legges til som kopier av kildestrengen.

Hint

Use Rydd opp i oversettelsesfiler if you only want to remove stale translation keys.

Slack Webhooks

Added in version 5.12.

Add-on ID:

weblate.webhook.slack

Oppsett:

webhook_url

Webhook-adresse

events

Endre hendelser

Endre hendelser

Triggers:

Event change

Sends notification to a Slack channel based on selected events.

Advarsel

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.

Hint

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

Webhook

Added in version 5.11.

Endret i version 5.15: Compliance of the secret length with the specification is now validated.

Add-on ID:

weblate.webhook.webhook

Oppsett:

webhook_url

Webhook-adresse

secret

Webhook secret

The Standard Webhooks secret is a base64 encoded string.

events

Endre hendelser

Endre hendelser

Triggers:

Event change

Sends notifications to external services based on selected events, following the Standard Webhooks specification.

The request payload complies with the Weblate Messaging schema. 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».

Obsolete add-ons

Customize XML output

Added in version 4.15.

Removed in version 5.13: Replaced by File format parameters.

Tilpass YAML-utdata

Removed in version 5.13: Replaced by File format parameters.

Common add-on parameters

Maskinoversettelsesmotorer

Available choices:

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

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

Filformat

Available choices:

apple-xliff

XLIFF 1.2 with Apple extensions

appstore

Metadatafiler for programbutikk

arb

ARB-fil

aresource

Android String Resource

asciidoc

AsciiDoc file

ass

Advanced SubStation Alpha-undertekstfil

catkeys

Haiku catkeys

cmp-resource

Compose Multiplatform Resource

csv

CSV-fil

csv-multi

Multivalue CSV file

csv-simple

Enkel CSV-fil

dokuwiki

DokuWiki-tekstfil

dtd

DTD-fil

flatxml

Flat XML-fil

fluent

Fluent-fil

formatjs

Format.JS JSON file

go-i18n-json

go-i18n v1 JSON file

go-i18n-json-v2

go-i18n v2 JSON file

go-i18n-toml

go-i18n TOML file

gotext

gotext JSON file

gwt

GWT-egenskaper

html

HTML-fil

i18next

i18next- JSON-fil versjon 3

i18nextv4

i18next JSON file v4

idml

IDML-fil

ini

INI-fil

islu

INI-fil for Inno Setup

joomla

Joomla -språkfil

json

JSON-fil

json-nested

Nøstet JSON-strukturfil

laravel

PHP-strenger for Laravel

markdown

Markdown file

mdx

MDX file

mediawiki

MediaWiki-tekstfil

mi18n-lang

@draggable/i18n lang file

moko-resource

Mobile Kotlin Resource

nextcloud-json

Nextcloud JSON file

odf

OpenDocument-fil

php

PHP-strenger

plainxliff

XLIFF 1.2 translation file

po

gettext PO-fil

po-mono

gettext PO-fil (ettspråklig)

poxliff

XLIFF 1.2 with gettext extensions

properties

Java Properties

rc

RC-fil

resjson

RESJSON file

resourcedictionary

ResourceDictionary file

resx

.NET-ressursfil

ruby-yaml

Ruby-YAML-fil

srt

SubRip-undertekstfil

ssa

SubStation Alpha-undertekstfil

strings

iOS-strenger

stringsdict

Stringsdict-fil

sub

MicroDVD-undertekstfil

tbx

TermBase eXchange-fil

toml

TOML file

ts

Qt Linguist-oversettelsesfil

txt

Klartekstfil

webextension

WebExtension JSON-fil

wxl

WixLocalization file

xliff

XLIFF 1.2 with placeables support

xliff2

XLIFF 2.0 translation file

xliff2-placeables

XLIFF 2.0 translation file with placeables support

xlsx

Excel Open XML

xwiki-fullpage

XWiki Full Page

xwiki-java-properties

XWiki Java Properties

xwiki-page-properties

XWiki Page Properties

yaml

YAML-fil

Endre hendelser

Available choices:

0

Ressurs oppdatert

1

Oversettelse fullført

2

Oversettelse endret

3

Kommentar lagt til

4

Forslag lagt til

5

Oversettelse lagt til

6

Automatically translated

7

Forslag akseptert

8

Oversettelse tilbakestilt

9

Oversettelse lastet opp

13

Kildestreng lagt til

14

Komponent låst

15

Komponent opplåst

17

Endringer innsendt

18

Changes pushed

19

Repository reset

20

Repository merged

21

Repository rebased

22

Repository merge failed

23

Repository rebase failed

24

Parsing failed

25

Translation removed

26

Forslag fjernet

27

Translation replaced

28

Repository push failed

29

Fjernet forslaget under opprydding

30

Kildestreng endret

31

Streng lagt til

32

Bulk status changed

33

Visibility changed

34

Bruker lagt til

35

User removed

36

Oversettelse godkjent

37

Merket for redigering

38

Component removed

39

Project removed

41

Project renamed

42

Component renamed

43

Flyttet komponent

45

Contributor joined

46

Announcement posted

47

Alert triggered

48

Språk lagt til

49

Language requested

50

Project created

51

Component created

52

User invited

53

Kodelagervarsel mottatt

54

Translation replaced file by upload

55

Lisens endret

56

Contributor license agreement changed

57

Skjermavbildning lagt til

58

Skjermavbildning lastet opp

59

Streng oppdatert i kodelageret

60

Add-on installed

61

Add-on configuration changed

62

Tillegg avinstallert

63

String removed

64

Comment removed

65

Comment resolved

66

Forklaring oppdatert

67

Kategori fjernet

68

Kategori endret navn

69

Kategori flyttet

70

Lagre streng feilet

71

Streng lagt til i kodelageret

72

Streng oppdatert i opplastingen

73

Streng lagt til i opplastingen

74

Oversettelse oppdatert gjennom kildeopplasting

75

Component translation completed

76

Applied enforced check

77

Propagated change

78

File uploaded

79

Extra flags updated

80

Font uploaded

81

Font changed

82

Font removed

83

Forced synchronization of translations

84

Forced rescan of translations

85

Screenshot removed

86

Etikett lagt til

87

Label removed

88

Repository cleanup

89

Source string added in the upload

90

Source string added in the repository

91

Prosjekt sikkerhetskopiert

92

Prosjekt gjenopprettet

93

Komponent gjenopprettet

94

Brukerredigering tilbakeført

95

Project setting changed

96

Component setting changed

Customizing list of add-ons

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

Writing add-on

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.

Executing scripts from add-on

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"

Installasjonsinstruks er å finne på Custom quality checks, add-ons, automatic suggestions and auto-fixes.

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

Versjonskontrollsystem brukt.

WL_REPO

Upstream repository URL.

WL_PATH

Absolutt sti til VKS-kodelager.

WL_BRANCH

Repository branch configured in the current component.

WL_FILEMASK

Filmaske for nåværende komponent.

WL_TEMPLATE

Filnavn for mal for enkeltspråklige oversettelser (kan stå tomt).

WL_NEW_BASE

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

WL_FILE_FORMAT

File format used in current component.

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

Komponentnavn.

WL_PROJECT_NAME

Prosjektnavn.

WL_COMPONENT_URL

Komponent-nettadresse.

WL_ENGAGE_URL

Project engage URL.

Se også

Komponentoppsett

Post-update repository processing

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

Pre-commit processing of translations

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.

Add-on activity logging

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

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