Suplimente¶
Add-ons provide ways to customize and automate the translation workflow. Admins can add and manage add-ons from the Operations ↓ Add-ons menu of each respective translation project or component. Add-ons can be also installed site-wide in Interfața de gestionare.
Sugestie
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.
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.
Addon-uri încorporate¶
Traducere automată¶
- ID add-on:
weblate.autotranslate.autotranslate- Configurație:
modeMod traducere automată
Alegerile disponibile:¶ suggestAdaugă ca sugestie
translateAdaugă ca traducere
fuzzyAdaugă ca „Necesită editare”
qÎnterogare
Te rugăm să reții că traducerea tuturor șirurilor va elimina toate traducerile existente.
auto_sourceSursa traducerilor automate
Alegerile disponibile:¶ othersAlte componente de traducere
mtTraducere automată
componentComponentă
Introdu descriptorul unei componente care urmează să fie utilizată ca sursă, păstrează spațiul gol pentru a utiliza toate componentele din proiectul curent.
enginesMotoare de traducere automată
thresholdPrag de punctaj
- Declanșări:
Tradu automat șirurile cu ajutorul traducerii automate sau al altor componente.
CDN de localizare JavaScript¶
Added in version 4.2.
- ID add-on:
weblate.cdn.cdnjs- Configurație:
thresholdPrag de traducere
The percentage of translated strings that must be present for translation to be included.
css_selectorSelector CSS
Selector CSS pentru detectarea elementelor traductibile.
cookie_nameNume cookie de limbă
Nume cookie care stochează preferințe lingvistice.
filesExtrage șiruri din fișiere HTML
Listă de nume de fișiere din depozitarul curent sau de adrese URL la distanță care trebuie interpretate pentru șiruri traductibile.
- Declanșări:
Add-on installation, Daily, Repository post-commit, Repository post-remove, Repository post-update
Publică traducerile în rețeaua de livrare de conținut pentru a fi utilizate în localizarea JavaScript sau HTML.
Poate fi utilizat pentru a localiza pagini HTML statice sau pentru a încărca localizarea în codul JavaScript.
Generează un URL unic pentru componenta dvs. pe care îl puteți include în paginile HTML pentru a le localiza. Consultați Traducerea HTML și JavaScript folosind Weblate CDN pentru mai multe detalii.
Notă
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.
- ID add-on:
weblate.cdn.files- Configurație:
Acest add-on nu are nicio configurație.
- Declanșări:
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 Localizare CDN for secure serving guidance.
Elimină șiruri goale¶
Added in version 4.4.
- ID add-on:
weblate.cleanup.blank- Configurație:
Acest add-on nu are nicio configurație.
- Declanșări:
Add-on installation, Repository post-commit, Repository post-update
Elimină șirurile fără traducere din fișierele de traducere.
Utilizați această opțiune pentru a nu avea șiruri goale în fișierele de traducere (de exemplu, dacă biblioteca de localizare le afișează ca fiind lipsă în loc să revină la șirul sursă).
Curăță fișierele de traducere¶
- ID add-on:
weblate.cleanup.generic- Configurație:
Acest add-on nu are nicio configurație.
- Declanșări:
Add-on installation, Repository post-update, Repository pre-commit
Actualizează toate fișierele de traducere pentru a se potrivi cu fișierul de bază monolingv. Pentru majoritatea formatelor de fișiere, aceasta înseamnă eliminarea cheilor de traducere învechite care nu mai sunt prezente în fișierul de bază.
For formats containing additional content besides translation strings (such as Fișiere HTML, Fișiere Windows RC, or Formatul OpenDocument) this also brings the translation file in sync with the base file.
Adaugă limbi lipsă¶
- ID add-on:
weblate.consistency.languages- Configurație:
Acest add-on nu are nicio configurație.
- Declanșări:
Asigură utilizarea unui set coerent de limbi pentru toate componentele unui proiect.
Notă
The components shared from other projects are not considered in this.
Limbile lipsă sunt verificate o dată la 24 de ore și atunci când sunt adăugate noi limbi în Weblate.
Spre deosebire de majoritatea celorlalte, acest add-on afectează întregul proiect.
Sugestie
Traduceți automat șirurile nou adăugate cu Traducere automată.
Descoperire componente¶
- ID add-on:
weblate.discovery.discovery- Configurație:
matchExpresie regulată pentru a potrivi fișierele de traducere
The regular expression must define named groups for component and language.
file_formatFormat fișier
name_templatePersonalizează numele componentei
Use Django template syntax. This template must include {{ component }}.
base_file_templateDefinește numele fișierului de bază monolingv
Leave empty for bilingual translation files. When set, this template must include {{ component }}.
new_base_templateDefinește fișierul de bază pentru traduceri noi
Filename of file used for creating new translations. For gettext choose .pot file. This template must include {{ component }}.
intermediate_templateFișier de limbă intermediar
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_regexFiltru limbă
Expresie regulată pentru filtrarea fișierelor de traducere la scanarea pentru masca de fișiere.
copy_addonsClonare suplimente din componenta principală în cele nou create
removeElimină componente pentru fișiere inexistente
- Declanșări:
Adaugă sau elimină automat componente ale proiectului pe baza modificărilor de fișiere din sistemul de control al versiunilor.
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
componentandlanguagenamed 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_templateand at least one translation file matchingmatch.
Worked example: news_<lang>.md¶
This is a common filename-based language variant layout:
docs/news_en.mddocs/news_cs.mddocs/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_*.mddocs/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
componentmatch group{{ component|title }}Nume de fișier al componentei cu prima literă majusculă
{{ path }}: {{ component }}Custom match group from the regular expression
După ce apăsați pe Save, va fi prezentată o previzualizare a componentelor corespunzătoare, de unde puteți verifica dacă configurația se potrivește cu nevoile dumneavoastră:
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¶
Un dosar pentru fiecare limbă care conține fișiere de traducere pentru componente.
- Regular expression:
(?P<language>[^/.]*)/(?P<component>[^/]*)\.po- Matching files:
cs/application.pocs/website.pode/application.pode/website.po
Gettext locales layout¶
Structura obișnuită pentru stocarea fișierelor gettext PO.
- Regular expression:
locale/(?P<language>[^/.]*)/LC_MESSAGES/(?P<component>[^/]*)\.po- Matching files:
locale/cs/LC_MESSAGES/application.polocale/cs/LC_MESSAGES/website.polocale/de/LC_MESSAGES/application.polocale/de/LC_MESSAGES/website.po
Complex filenames¶
Utilizarea atât a componentei, cât și a denumirii limbii în numele fișierului.
- Regular expression:
src/locale/(?P<component>[^/]*)\.(?P<language>[^/.]*)\.po- Matching files:
src/locale/application.cs.posrc/locale/website.cs.posrc/locale/application.de.posrc/locale/website.de.po
Repeated language code¶
Utilizarea limbii atât în calea de acces, cât și în numele fișierului.
- Regular expression:
locale/(?P<language>[^/.]*)/(?P<component>[^/]*)/(?P=language)\.po- Matching files:
locale/cs/application/cs.polocale/cs/website/cs.polocale/de/application/de.polocale/de/website/de.po
Split Android strings¶
Șiruri de resurse Android, împărțite în mai multe fișiere.
- Regular expression:
res/values-(?P<language>[^/.]*)/strings-(?P<component>[^/]*)\.xml- Matching files:
res/values-cs/strings-about.xmlres/values-cs/strings-help.xmlres/values-de/strings-about.xmlres/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.propertiesparent/module1/submodule/src/main/resources/ApplicationResource_es.propertiesparent/module2/src/main/resources/ApplicationResource_de.propertiesparent/module2/src/main/resources/ApplicationResource_ro.properties
Sugestie
Component discovery add-on uses URL-uri interne Weblate. 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 Depozitar cod sursă field (in Operations ↓ Settings ↓
Version control system) of each respective component.
This saves time with configuration and system resources too.
Sugestie
Ensure the new component contains the full set of translatable languages with Adaugă limbi lipsă.
Vezi și
Fedora Messaging¶
Added in version 5.15.
- ID add-on:
weblate.fedora_messaging.publish- Configurație:
eventsChange events
amqp_hostAMQP broker host
The AMQP broker to connect to.
amqp_sslUse SSL for AMQP connection
ca_certCA certificates
Bundle of PEM encoded CA certificates used to validate the certificate presented by the server.
client_keyClient SSL key
PEM encoded client private SSL key.
client_certClient SSL certificates
PEM encoded client SSL certificate.
- Declanșări:
Sends notifications to a Fedora Messaging compatible AMQP exchange.
Fedora Messaging este un editor bazat pe AMQP pentru toate modificările care se produc în Weblate. Puteți agăța servicii suplimentare pe modificările care se produc în Weblate folosind acest lucru.
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_idNumerical ID of change
actionVerbose name of the change.
timestampISO formatted timestamp
targetNew value of the change (eg. new translation of the string)
oldOld value of the change (eg. previous translation of the string)
sourceSource string.
urlAbsolute URL to view the related object.
authorAuthor username (this can be different from user for example when accepting suggestions)
userActing username
projectLimbajul proiectului
componentComponenta slug
translationCodul limbii de traducere
Message headers¶
There are additional headers which you might utilize for routing as well:
actionVerbose name of the change.
projectLimbajul proiectului
componentComponenta 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"]
}
Editare în masă¶
- ID add-on:
weblate.flags.bulk- Configurație:
qÎnterogare
stateStare de setat
Alegerile disponibile:¶ -1Nu modifica
10Necesită editare
11Needs editing (Needs rewriting)
12Needs editing (Needs checking)
20Tradus
30Aprobat
add_flagsIndicator de traducere de adăugat
remove_flagsIndicatoare de traducere de eliminat
add_labelsEtichete de adăugat
remove_labelsEtichete de eliminat
- Declanșări:
Editează majoritatea semnalărilor, etichetelor sau stării șirurilor.
Exemple:
Interogare de căutare |
|
|---|---|
Etichete de adăugat |
recent |
Interogare de căutare |
|
|---|---|
Indicator de traducere de adăugat |
|
Interogare de căutare |
|
|---|---|
Indicator de traducere de adăugat |
|
Flag unchanged translations as „Needs rewriting”¶
- ID add-on:
weblate.flags.same_edit- Configurație:
Acest add-on nu are nicio configurație.
- Declanșări:
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.
Sugestie
De asemenea, este posibil să doriți să întăriți verificarea Traducere neschimbată prin adăugarea indicatorului strict-same la Indicarori traducere.
Vezi și
Flag new source strings as „Needs checking”¶
- ID add-on:
weblate.flags.source_edit- Configurație:
Acest add-on nu are nicio configurație.
- Declanșări:
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.
Vezi și
Flag new translations as „Needs rewriting”¶
- ID add-on:
weblate.flags.target_edit- Configurație:
Acest add-on nu are nicio configurație.
- Declanșări:
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.
Vezi și
Flag updated translations from repository as „Needs rewriting”¶
- ID add-on:
weblate.flags.target_repo_update- Configurație:
Acest add-on nu are nicio configurație.
- Declanșări:
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.
Vezi și
Completare șiruri doar pentru citire cu sursa¶
Added in version 4.18.
- ID add-on:
weblate.generate.fill_read_only- Configurație:
Acest add-on nu are nicio configurație.
- Declanșări:
Completează șirurile de traducere doar pentru citire cu șirul sursă.
Generator de statistici¶
- ID add-on:
weblate.generate.generate- Configurație:
filenameNume fișier generat
templateConținut fișier generat
- Declanșări:
Generează un fișier care conține informații detaliate despre starea traducerii.
Puteți utiliza un șablon Django atât în numele fișierului, cât și în conținut; consultați Marcarea șablonului pentru o descriere detaliată a marcajului.
De exemplu, generarea unui fișier de sinteză pentru fiecare traducere:
- Nume fișier generat
locale/{{ language_code }}.json- Conținut
{ "language": "{{ language_code }}", "strings": "{{ stats.all }}", "translated": "{{ stats.translated }}", "last_changed": "{{ stats.last_changed }}", "last_author": "{{ stats.last_author }}", }
Vezi și
Precompletare traducere cu sursa¶
Added in version 4.11.
- ID add-on:
weblate.generate.prefill- Configurație:
Acest add-on nu are nicio configurație.
- Declanșări:
Completează șirurile de traducere cu șirul sursă.
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.
Generare pseudolocale¶
Added in version 4.5.
- ID add-on:
weblate.generate.pseudolocale- Configurație:
sourceȘiruri sursă
targetTraducere țintă
Toate șirurile din această traducere vor fi suprascrise
prefixPrepended static text
var_prefixPrepended variable text
suffixAppended static text
var_suffixAppended variable text
var_multiplierVariable text multiplier
How many times to repeat the variable text depending on the length of the source string.
include_readonlyInclude șiruri doar pentru citire
- Declanșări:
Generează o traducere prin adăugarea automată a prefixului și sufixului la șirurile sursă.
Pseudolocalele sunt utile pentru a găsi șiruri de caractere care nu sunt pregătite pentru localizare. Acest lucru se realizează prin modificarea tuturor șirurilor sursă traductibile pentru a facilita identificarea șirurilor nealterate la rularea aplicației în limba pseudolocală.
De asemenea, este posibil să se găsească șiruri de caractere ale căror omologi localizați ar putea să nu se potrivească cu aspectul.
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.
Șirurile vor fi generate folosind următorul model:
Prepended static text Prepended variable text Source string Appended variable text Appended static text
Sugestie
Puteți folosi limbi reale pentru testare, dar există pseudolocale dedicate disponibile în Weblate - en_XA și ar_XB.
Sugestie
Puteți utiliza acest add-on pentru a începe traducerea într-o nouă locație a unei limbi existente sau a unei limbi similare. După ce adăugați traducerea la componentă, urmați la add-on. Exemplu: Dacă aveți fr și doriți să începeți traducerea fr_CA, setați pur și simplu fr ca sursă, fr_CA ca țintă și lăsați prefixul și sufixul goale.
Dezinstalați add-on-ul după ce ați completat noua traducere pentru a împiedica Weblate să modifice traducerile făcute după copiere.
Contribuitori în comentariu¶
- ID add-on:
weblate.gettext.authors- Configurație:
Acest add-on nu are nicio configurație.
- Declanșări:
Actualizează partea de comentarii din antetul fișierului PO pentru a include numele contribuitorilor și anii de contribuție.
Antetul fișierului PO va arăta în felul următor:
# 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.
Actualizarea variabilei ALL_LINGUAS în fișierul „configure”¶
- ID add-on:
weblate.gettext.configure- Configurație:
Acest add-on nu are nicio configurație.
- Declanșări:
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.
Personalizare ieșire gettext¶
Removed in version 5.13: Replaced by File format parameters.
Update gettext template (Django)¶
Added in version 5.17.
- ID add-on:
weblate.gettext.django- Configurație:
intervalUpdate frequency
How often the add-on should update the POT file when the component is refreshed.
Alegerile disponibile:¶ dailyDaily
weeklyWeekly
monthlyLunar
normalize_headerNormalize POT header
Updates gettext headers and replaces placeholder POT comments.
- Declanșări:
Updates the gettext template using Django’s built-in makemessages command.
Actualizare fișier LINGUAS¶
- ID add-on:
weblate.gettext.linguas- Configurație:
Acest add-on nu are nicio configurație.
- Declanșări:
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.
- ID add-on:
weblate.gettext.meson- Configurație:
intervalUpdate frequency
How often the add-on should update the POT file when the component is refreshed.
Alegerile disponibile:¶ dailyDaily
weeklyWeekly
monthlyLunar
normalize_headerNormalize POT header
Updates gettext headers and replaces placeholder POT comments.
comment_modeCode comments
Choose whether xgettext should extract no comments, all comments, or only comments marked with a specific tag.
Alegerile disponibile:¶ offDo not extract comments
allExtract all comments
taggedExtract comments with tag
comment_tagComment tag
Tag passed to xgettext for comment extraction when using tagged comment mode.
checksxgettext checks
Additional xgettext validation checks to enable for extracted messages.
Alegerile disponibile:¶ ellipsis-unicodeellipsis-unicode
space-ellipsisspace-ellipsis
quote-unicodequote-unicode
bullet-unicodebullet-unicode
keywordAdditional keyword
Optional extra keyword passed to xgettext using –keyword.
presetMeson 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.
Alegerile disponibile:¶ glibGLib
- Declanșări:
Updates the gettext template using Meson gettext conventions.
Generare fișiere MO¶
- ID add-on:
weblate.gettext.mo- Configurație:
pathCale către fișierul MO generat
Dacă nu este specificat, se va utiliza locația fișierului PO.
fuzzyInclude șiruri care necesită editare
Șirurile care au nevoie de editare (neclare) nu sunt de obicei pregătite pentru a fi utilizate ca traduceri.
- Declanșări:
Generează automat un fișier MO pentru fiecare fișier PO modificat.
Locația fișierului MO generat poate fi personalizată, iar câmpul pentru acesta utilizează Marcarea șablonului.
Notă
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.
Actualizare fișiere PO pentru a se potrivi cu POT (msgmerge)¶
Schimbat în versiunea 5.13: Settings configuration has been moved to File format parameters.
- ID add-on:
weblate.gettext.msgmerge- Configurație:
Acest add-on nu are nicio configurație.
- Declanșări:
Actualizează toate fișierele PO (conform configurației „Mască de fișier”) pentru a se potrivi cu fișierul POT (conform configurației „Șablon pentru traduceri noi”) utilizând 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.
- ID add-on:
weblate.gettext.sphinx- Configurație:
intervalUpdate frequency
How often the add-on should update the POT file when the component is refreshed.
Alegerile disponibile:¶ dailyDaily
weeklyWeekly
monthlyLunar
normalize_headerNormalize POT header
Updates gettext headers and replaces placeholder POT comments.
filter_modeFiltering
Optionally remove strings that are not useful to translate after Sphinx extraction.
Alegerile disponibile:¶ noneNici unul
weblate_docsWeblate documentation
- Declanșări:
Updates the gettext template using Sphinx’s gettext builder without loading project configuration.
Update POT file (xgettext)¶
Added in version 5.17.
- ID add-on:
weblate.gettext.xgettext- Configurație:
intervalUpdate frequency
How often the add-on should update the POT file when the component is refreshed.
Alegerile disponibile:¶ dailyDaily
weeklyWeekly
monthlyLunar
normalize_headerNormalize POT header
Updates gettext headers and replaces placeholder POT comments.
comment_modeCode comments
Choose whether xgettext should extract no comments, all comments, or only comments marked with a specific tag.
Alegerile disponibile:¶ offDo not extract comments
allExtract all comments
taggedExtract comments with tag
comment_tagComment tag
Tag passed to xgettext for comment extraction when using tagged comment mode.
checksxgettext checks
Additional xgettext validation checks to enable for extracted messages.
Alegerile disponibile:¶ ellipsis-unicodeellipsis-unicode
space-ellipsisspace-ellipsis
quote-unicodequote-unicode
bullet-unicodebullet-unicode
keywordAdditional keyword
Optional extra keyword passed to xgettext using –keyword.
input_modeInput source
Choose whether xgettext should read source files from glob patterns or from a POTFILES/POTFILES.in manifest.
Alegerile disponibile:¶ patternsSource file patterns
potfilesPOTFILES manifest
languagexgettext language
Programming language passed to xgettext, for example Python or C.
source_patternsSource file patterns
Newline-separated repository-relative glob patterns for files to extract with xgettext.
potfiles_pathPOTFILES 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.
- Declanșări:
Updates the gettext template using xgettext on selected source files.
Comasează comiteri Git¶
- ID add-on:
weblate.git.squash- Configurație:
squashComitere prin comasare
Alegerile disponibile:¶ allToate comiterile într-una singură
languagePentru fiecare limbă în parte
filePentru fiecare fișier în parte
authorPentru fiecare autor în parte
append_trailersAdăugă trailere la mesajul de comitere comasată
Liniile de trailer sunt linii care se aseamănă cu anteturile de e-mail RFC 822, la sfârșitul părții de formă liberă a unui mesaj de comitere, cum ar fi „Co-autor: …”.
commit_messageMesaj comitere
Acest mesaj de comitere va fi utilizat în locul mesajelor de comitere combinate de la comiterile comasate.
- Declanșări:
Comasează comiteri Git înainte de a încărca modificările.
Sugestie
To avoid unnecessary conflicts, it is recommended to configure automatic receiving of upstream changes by webhooks or API, see Actualizarea depozitelor.
Comițările Git pot fi eliminate înainte de împingerea modificărilor în unul dintre următoarele moduri:
Toate comiterile într-una singură
Pentru fiecare limbă în parte
Pentru fiecare fișier în parte
Pentru fiecare autor în parte
Mesajele de confirmare originale sunt păstrate, dar se pierde paternitatea, cu excepția cazului în care se selectează Per author sau mesajul de confirmare este personalizat pentru a o include.
Mesajele de confirmare originale pot fi opțional înlocuite cu un mesaj de confirmare personalizat.
Remetele (commit lines like Co-authored-by: …) pot fi opțional eliminate din mesajele de confirmare originale și adăugate la sfârșitul mesajului de confirmare strivit. Acest lucru generează, de asemenea, creditul corespunzător Co-authored-by: pentru fiecare traducător.
Personalizare ieșire JSON¶
Schimbat în versiunea 5.12: Avoid spaces after separators option added.
Removed in version 5.13: Replaced by File format parameters.
Resetează depozitarul la sursa principală¶
Added in version 5.17.
- ID add-on:
weblate.hosted.reset- Configurație:
Acest add-on nu are nicio configurație.
- Declanșări:
Elimină toate modificările din depozitarul Weblate în fiecare noapte.
Formatare fișier de proprietăți Java¶
- ID add-on:
weblate.properties.sort- Configurație:
case_sensitiveEnable case-sensitive key sorting
- Declanșări:
Formatează și sortează fișierul de proprietăți Java.
Consolidează liniile noi la cele Unix.
Formatarea cu majuscule a secvențelor de evacuare Unicode (în cazul în care acestea sunt prezente).
Șiruri cu observații.
Sortează șirurile de caractere în funcție de chei.
Renunță la șirurile duplicate.
Elimină comentariu învechit¶
- ID add-on:
weblate.removal.comments- Configurație:
ageZile de păstrat
- Declanșări:
Setare termen pentru eliminare comentarii.
Acest lucru poate fi util pentru a elimina comentariile vechi care ar putea fi depășite. Folosiți-o cu grijă, deoarece faptul că comentariile devin vechi nu înseamnă că și-au pierdut importanța.
Elimină sugestie învechită¶
- ID add-on:
weblate.removal.suggestions- Configurație:
ageZile de păstrat
votesPrag de vot
Threshold for removal. Leave empty to remove suggestions regardless of votes. This field has no effect with voting turned off.
- Declanșări:
Setare termen pentru eliminare sugestii.
Poate fi foarte utilă în legătură cu votarea sugestiilor (see Evaluare reciprocă) pentru a elimina sugestiile care nu primesc suficiente voturi pozitive într-un anumit interval de timp.
Actualizare fișiere RESX¶
- ID add-on:
weblate.resx.update- Configurație:
Acest add-on nu are nicio configurație.
- Declanșări:
Actualizează toate fișierele de traducere pentru a se potrivi cu fișierul sursă monolingv din sursă principală. Șirurile neutilizate sunt eliminate, iar cele noi sunt adăugate ca copii ale șirului sursă.
Sugestie
Utilizați Curăță fișierele de traducere dacă doriți să eliminați doar cheile de traducere vechi.
Slack Webhooks¶
Added in version 5.12.
- ID add-on:
weblate.webhook.slack- Configurație:
webhook_urlWebhook URL
eventsChange events
- Declanșări:
Sends notification to a Slack channel based on selected events.
Atenționare
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.
Sugestie
To obtain a webhook URL, follow the steps outlined in the Slack Incoming Webhooks documentation
Webhook¶
Added in version 5.11.
Schimbat în versiunea 5.15: Compliance of the secret length with the specification is now validated.
- ID add-on:
weblate.webhook.webhook- Configurație:
webhook_urlWebhook URL
secretWebhook secret
The Standard Webhooks secret is a base64 encoded string.
eventsChange events
- Declanșări:
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¶
Personalizare ieșire XML¶
Added in version 4.15.
Removed in version 5.13: Replaced by File format parameters.
Personalizare ieșire YAML¶
Removed in version 5.13: Replaced by File format parameters.
Common add-on parameters¶
Motoare de traducere automată¶
|
Alibaba |
|
Amazon Translate |
|
Anthropic |
|
APy Apertium |
|
Azure AI Translator |
|
Azure OpenAI |
|
Baidu |
|
CyrTranslit |
|
DeepL |
|
Glosbe |
|
Google Cloud Translation Advanced |
|
Google Cloud Translation Basic |
|
LTEngine |
|
Traducere Libre |
|
ModernMT |
|
MyMemory |
|
Vedere Netease |
|
Ollama |
|
OpenAI |
|
Centrul de traduceri SAP |
|
Systran |
|
Weblate |
|
Memorie de traducere Weblate |
|
Yandex |
|
Yandex v2 |
|
Youdao Zhiyun |
|
tmserver |
Format fișier¶
|
XLIFF 1.2 with Apple extensions |
|
Fișiere de metadate magazin de aplicații |
|
Fișier ARB |
|
Android String Resource |
|
AsciiDoc file |
|
Fișier subtitrări Advanced SubStation Alpha |
|
Haiku catkeys |
|
Compose Multiplatform Resource |
|
Fișier CSV |
|
Fișier CSV multivaloare |
|
Fișier CSV simplu |
|
Fișier text DokuWiki |
|
Fișier DTD |
|
Fișier Flat XML |
|
Fișier Fluent |
|
Format.JS JSON file |
|
Fișier JSON go-i18n v1 |
|
Fișier JSON go-i18n v2 |
|
go-i18n TOML file |
|
Fișier JSON gotext |
|
Proprietăți GWT |
|
Fișier HTML |
|
Fișier JSON i18next v3 |
|
Fișier JSON i18next v4 |
|
Fișier IDML |
|
Fișier INI |
|
Fișier Inno Setup INI |
|
Fișier de limbă Joomla |
|
Fișier JSON |
|
Fișier de structură imbricata JSON |
|
Șiruri Laravel PHP |
|
Fișier Markdown |
|
MDX file |
|
Fișier text MediaWiki |
|
@draggable/i18n lang file |
|
Mobile Kotlin Resource |
|
Nextcloud JSON file |
|
Fișier OpenDocument |
|
Șiruri PHP |
|
Fișier de traducere XLIFF 1.2 |
|
Fișier gettext PO |
|
Fișier gettext PO (monolingv) |
|
XLIFF 1.2 cu extensii gettext |
|
Java Properties |
|
Fișier RC |
|
RESJSON file |
|
Fișier ResourceDictionary |
|
Fișier de resurse .NET |
|
Fișier Ruby YAML |
|
Fișier subtitrări SubRip |
|
Fișier subtitrări SubStation Alpha |
|
Șiruri iOS |
|
Fișier Stringsdict |
|
Fișier subtitrări MicroDVD |
|
Fișier TermBase eXchange |
|
TOML file |
|
Fișier de traducere Qt Linguist |
|
Fișier text simplu |
|
Fișier JSON WebExtension |
|
WixLocalization file |
|
XLIFF 1.2 cu suport pentru placabile |
|
XLIFF 2.0 translation file |
|
XLIFF 2.0 translation file with placeables support |
|
Excel Open XML |
|
XWiki Full Page |
|
XWiki Java Properties |
|
XWiki Page Properties |
|
Fișier YAML |
Change events¶
|
Resursă actualizată |
|
Traducere finalizată |
|
Traducere schimbată |
|
Comentariu adăugat |
|
Sugestie adăugată |
|
Traducere adăugată |
|
Tradus automat |
|
Sugestie acceptată |
|
Traducere inversată |
|
Traducere încărcată |
|
Șir sursă adăugat |
|
Componentă blocată |
|
Componentă deblocată |
|
Modificări comise |
|
Modificări încărcate |
|
Depozitar resetat |
|
Depozitar îmbinat |
|
Depozitar rebazat |
|
Eroare la îmbinarea depozitarului |
|
Eroare la rebazarea depozitarului |
|
Înterpretare eșuată |
|
Traducere eliminată |
|
Sugestie eliminată |
|
Traducere înlocuită |
|
Eroare la încărcarea depozitarului |
|
Sugestie eliminată în timpul curățării |
|
Șir sursă modificat |
|
Șir adăugat |
|
Schimbare stare în masă |
|
Vizibilitate modificată |
|
Utilizator adăugat |
|
Utilizator eliminat |
|
Traducere aprobată |
|
Marcată pentru editare |
|
Componentă eliminată |
|
Proiect eliminat |
|
Proiect redenumit |
|
Componentă redenumită |
|
Componentă mutată |
|
S-a alăturat contribuitor |
|
Anunț publicat |
|
Alertă declanșată |
|
Limbă adăugată |
|
Limbă solicitată |
|
Proiect creat |
|
Componentă creată |
|
Utilizator invitat |
|
Notificare depozitar primită |
|
Înlocuire fișier cu traduceri prin încărcare |
|
Licență schimbată |
|
Contributor license agreement changed |
|
Captură de ecran adăugată |
|
Captură de ecran încărcată |
|
Șir actualizat în depozitar |
|
Supliment instalat |
|
Configurație supliment modificată |
|
Supliment dezinstalat |
|
Șir eliminat |
|
Comentariu eliminat |
|
Comentariu rezolvat |
|
Explicație actualizată |
|
Categorie eliminată |
|
Categorie redenumită |
|
Categorie mutată |
|
Salvare șir eșuată |
|
String added in the repository |
|
String updated in the upload |
|
String added in the upload |
|
Translation updated by source upload |
|
Component translation completed |
|
Applied enforced check |
|
Propagated change |
|
File uploaded |
|
Extra flags updated |
|
Font uploaded |
|
Font changed |
|
Font removed |
|
Forced synchronization of translations |
|
Forced rescan of translations |
|
Screenshot removed |
|
Label added |
|
Label removed |
|
Repository cleanup |
|
Source string added in the upload |
|
Source string added in the repository |
|
Project backed up |
|
Project restored |
|
Component restored |
|
User edit reverted |
|
Project setting changed |
|
Component setting changed |
Personalizarea listei de add-on-uri¶
Lista de add-on-uri este configurată prin WEBLATE_ADDONS. Pentru a adăuga un alt addon, este suficient să includeți numele absolut al clasei în această setare.
Add-on de scriere¶
Puteți să vă scrieți propriile add-on-uri, să creați o subclasă de weblate.addons.base.BaseAddon pentru a defini metadatele addon-ului și apoi să implementați un callback pentru a face procesarea.
Vezi și
Executarea scripturilor din add-on¶
Suplimentele pot fi utilizate și pentru a executa scripturi externe. Acest lucru era integrat în Weblate, dar acum trebuie să scrieți niște cod pentru a înfășura scriptul vostru cu un 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"
Pentru instrucțiuni de instalare, consultați Custom quality checks, add-ons, automatic suggestions and auto-fixes.
Scriptul este executat cu directorul curent setat la rădăcina depozitului VCS pentru orice componentă dată.
În plus, sunt disponibile următoarele variabile de mediu:
- WL_VCS¶
Sistemul de control al versiunilor utilizat.
- WL_REPO¶
URL-ul depozitului din amonte.
- WL_PATH¶
Calea absolută către depozitul VCS.
- WL_BRANCH¶
Ramura de depozit configurată în componenta curentă.
- WL_FILEMASK¶
Masca de fișier pentru componenta curentă.
- WL_TEMPLATE¶
Numele de fișier al șablonului pentru traducerile monolingve (poate fi gol).
- WL_NEW_BASE¶
Numele de fișier al fișierului utilizat pentru crearea de noi traduceri (poate fi gol).
- WL_FILE_FORMAT¶
Format de fișier utilizat în componenta curentă.
- WL_LANGUAGE¶
Limba traducerii procesate în prezent (nu este disponibilă pentru cârligele la nivel de componentă).
- WL_PREVIOUS_HEAD¶
HEAD anterior după actualizare (disponibil numai după rularea cârligului post-update).
- WL_COMPONENT_SLUG¶
Denumirea componentei utilizată pentru a construi URL-ul.
- WL_PROJECT_SLUG¶
Denumirea proiectului utilizată pentru a construi URL-ul.
- WL_COMPONENT_NAME¶
Denumirea componentei.
- WL_PROJECT_NAME¶
Numele proiectului.
- WL_COMPONENT_URL¶
URL-ul componentei.
- WL_ENGAGE_URL¶
URL de angajare a proiectului.
Vezi și
Prelucrarea depozitelor după actualizare¶
Poate fi utilizat pentru a actualiza fișierele de traducere atunci când sursa VCS din amonte se modifică. Pentru a realiza acest lucru, vă rugăm să rețineți că Weblate vede numai fișierele trimise în VCS, deci trebuie să trimiteți modificările ca parte a scriptului.
De exemplu, cu Gulp puteți face acest lucru folosind următorul cod:
#! /bin/sh
gulp --gulpfile gulp-i18n-extract.js
git commit -m 'Update source strings' src/languages/en.lang.json
Pre-angajare de procesare a traducerilor¶
Utilizați scriptul de trimitere pentru a modifica automat o traducere înainte de a fi trimisă în depozit.
Acesta este transmis ca un singur parametru care constă în numele de fișier al unei traduceri curente.
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.