Complements¶
Els complements ofereixen maneres de personalitzar i automatitzar el flux de treball de traducció. Els administradors poden afegir i gestionar complements des del menú Operacions ↓ Complements de cada projecte o component de traducció respectiu. Els complements també es poden instal·lar a tot el lloc a Interfície de gestió.
Suggeriment
També podeu configurar complements mitjançant API, DEFAULT_ADDONS o install_addon.
Els complements que activen l’activació manual es poden executar des de la gestió de complements o mitjançant la API. Els resultats es registren al registre d’activitats del complement.
Add-ons that expose a component API show its base URL on the add-on’s API tab, alongside a link to the API root.
Add-ons can show Integration instructions above their settings. These explain how to connect your application or service to the add-on. Add-ons without configurable settings, such as CDN dels fitxers de traducció, show instructions without a settings form. Generated URLs and integration snippets are available after installation.
Add-ons are persistent administrative configuration. They run with their service identity in the scope where they are installed, rather than repeatedly using the permissions of the administrator who configured them. This ensures that equally authorized administrators see and save the same configuration, and that saving an unrelated change does not silently alter the add-on’s input scope. Removing or disabling the configuring administrator does not disable the add-on.
Project and category add-ons therefore include compatible restricted components in that scope. A component add-on can use inputs outside its destination component when documented by that add-on. Automatic translation determines its source components as follows:
Direct automatic-translation actions use the acting user’s component access.
A saved automatic-translation add-on uses its persistent administrative scope. Compatible components in the target project are eligible, including restricted components.
Components in another project are eligible when that project contributes to shared translation memory. This includes restricted components even though they do not create shared translation-memory entries; the add-on reads the explicitly selected component as an administrative input instead.
Restricted components remain filtered from ordinary listings and direct access for users without an explicit grant or Edit project settings permission. Grant add-on management permissions only to users trusted with the add-on’s complete input and effect scope. See Scope of teams and Accés restringit.
Repository add-ons, including Descobriment de components, can be installed only on the component that owns the repository. Linked components show installed repository add-ons as inherited. Their available add-on list links to the owning component’s add-ons when you can manage it; otherwise the entry is unavailable.
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.
Cada dia¶
S’activa diàriament, però els complements solen dividir la càrrega diària entre components segons BACKGROUND_TASKS.
Event change¶
Triggered after a Change event is created.
Manual trigger¶
S’activa quan un complement s’executa manualment des de la gestió de complements o l’API.
Repository post-add¶
Triggered just after the new translation is added and committed.
Repository post-commit¶
S’activa just després de confirmar els canvis.
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¶
S’ha activat just abans que es cometin els canvis.
Repository pre-push¶
Triggered just before the repository is pushed upstream.
Repository pre-update¶
S’ha activat just abans d’intentar l’actualització del dipòsit.
Unitat després de desar¶
S’ha activat just després de desar la cadena.
Post-sincronització de la unitat¶
Triggered after the string is synchronized with the VCS.
Precreació de la unitat¶
S’ha activat just després de desar la cadena acabada de crear.
Built-in add-ons¶
Avaluació de la qualitat amb IA¶
- Add-on ID:
weblate.ai.quality- Configuration:
serviceServei d’avaluació
Available choices:¶ anthropicAnthropic
openaiOpenAI
mistralMistral
ollamaOllama
azure-openaiAzure OpenAI
qConsulta
intervalFreqüència d’avaluació
Available choices:¶ disabledDesactivat
dailyCada dia
weeklySetmanal
monthlyCada mes
on_changeAvalua els canvis de traducció
on_updateAvalua les actualitzacions del repositori
- Triggers:
Add-on installation, Component update, Cada dia, Event change, Manual trigger
Evaluates existing translations using an LLM and records quality checks.
This add-on evaluates existing translations using an LLM service configured under Suggeriments automàtics. It does not generate suggestions or change translations. Choose an Evaluation service from the configured LLM services; credentials and project overrides are reused.
The Query selects strings using the normal search syntax. By default, translated strings are selected. Source strings, read-only strings, and glossary entries are excluded. Each request includes all translation plural forms, source text, language information, string context, glossary terms, placeholders, and configured translation instructions. This data is sent to the selected provider.
Requests group strings from the same translation in file order, using the service’s automatic translation batch size (currently 20 strings for built-in LLM services). All plural forms of a string stay together. Related strings share context, allowing the evaluator to check meaning and terminology across the batch. Batching reduces the number of provider requests for scheduled, manual, and change-triggered runs; it does not skip unchanged strings.
Evaluation frequency defaults to weekly. Daily and monthly schedules are also available; disabled turns off scheduled evaluation. Background processing must be enabled. A successful full run starts the next interval. Manual runs bypass the interval. Enable Evaluate translation changes or Evaluate repository updates to additionally evaluate after those events. Installation does not immediately contact the provider. Each run can incur provider costs, including reevaluation of unchanged translations.
Evaluation runs in background tasks, with results and failure counts recorded in the existing add-on activity log. Failed requests retain existing valid findings and are tried again only by a subsequent run. Evaluation shares the service’s automatic translation cooldown: rate-limit responses activate it, and batches are skipped while it is active. More specific installations take precedence: component, nearest category, project, then site-wide.
Findings appear as standard checks for accuracy, fluency, terminology, style, and
formatting. Each finding includes a minor, major, or critical severity and an
explanation. Multiple findings in one category share a check, so ignoring that
check ignores the whole category for the string. Existing search filters and API
search work, for example check:ai_accuracy. Translation flags such as
ignore-ai-accuracy disable a category; ignore-all-checks disables all checks.
Changing the source or translation removes outdated findings. Results received after any source or translation in their batch changes are discarded for the whole batch. A failed or malformed response also leaves existing findings for the whole batch unchanged; other batches can still complete. Incomplete runs do not advance the scheduled evaluation date. Reevaluation of unchanged content preserves ignored categories, and a successful evaluation removes categories that no longer have findings. Removing or reconfiguring the add-on clears its findings. Evaluator metadata is internal and cannot be edited through the API; the add-on configuration uses the existing Complements permissions and validation.
Automatització¶
Afegit a la versió 2026.10.
- Add-on ID:
weblate.automation.automation- Configuration:
workflowFlux de treball
Enter an automation definition as YAML or JSON.
- Triggers:
Component update, Cada dia, Event change, Manual trigger, Repository post-commit, Repository post-push, Repository post-update
Runs ordered translation operations with conditions and branches.
Install this add-on on a component, category, project, or site. Inherited instances run separately for each component. Multiple instances can be installed. Configuring, previewing, and running an automation requires the usual add-on management permission. Saving its configuration does not execute it.
Enter YAML or JSON in Workflow. Use Preview without changes to validate it and inspect planned actions, then Run now for real execution. Results appear in the add-on activity log.
Vegeu també
Workflow definition for the script definition and reference.
Cookbook for complete examples.
Apply translation memory before machine translation for translation memory before machine translation.
Traducció automatitzada¶
- Add-on ID:
weblate.autotranslate.autotranslate- Configuration:
modeMode de traducció automatitzada
Available choices:¶ suggestAfegeix com a suggeriments
translateAfegeix com a traducció
fuzzyAfegeix com a «cal editar»
approvedAfegeix com a traduccions aprovades
qConsulta
Tingueu en compte que traduir totes les cadenes descartarà totes les traduccions existents.
auto_sourceOrigen de les traduccions automàtiques
Available choices:¶ othersAltres components
mtTraducció automàtica
componentComponent
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.
enginesServeis de traducció
thresholdLlindar de puntuació
- Triggers:
Add-on installation, Component update, Cada dia, Event change
Tradueix automàticament les cadenes fent servir traducció automàtica o altres components.
To control translation order, use the Automatització add-on with a separate action for each pass. Follow the Apply translation memory before machine translation cookbook example to apply local translation memory first and send only the remaining strings to a machine translation service. Selecting multiple engines here uses Priority of machine translation and translation memory services; installation order of separate add-ons does not define an execution sequence.
CDN de localització de JavaScript¶
Afegit a la versió 4.2.
- Add-on ID:
weblate.cdn.cdnjs- Configuration:
thresholdLlindar de traducció
El percentatge de cadenes traduïdes que hi ha d’haver perquè la traducció s’inclogui.
css_selectorSelector CSS
Selector CSS per a detectar els elements localitzables.
cookie_nameNom de la galeta de llengua
Nom de la galeta que emmagatzema la preferència de llengua.
filesExtreu cadenes de fitxers HTML
Llista de noms de fitxer del repositori actual o URL remots que s’analitzaran cercant-hi cadenes traduïbles.
- Triggers:
Add-on installation, Cada dia, Repository post-commit, Repository post-remove, Repository post-update
Publica les traduccions en una xarxa de lliurament de continguts per al seu ús en la localització de JavaScript o HTML.
Es pot utilitzar per localitzar pàgines HTML estàtiques o per carregar la localització al codi JavaScript.
Generates a unique URL for your component you can include in HTML pages to localize them. See Traduir HTML i JavaScript mitjançant Weblate CDN for more details. Available languages and translation files are listed in the CDN manifest.
Nota
Aquest complement requereix una configuració addicional al servidor Weblate. LOCALIZE_CDN_PATH configura on s’escriuran els fitxers generats (en un sistema de fitxers), i LOCALIZE_CDN_URL defineix on es serviran (URL). Weblate no fa servir els fitxers i s’ha de configurar externament (normalment utilitzant un servei CDN).
Aquest complement està configurat a Hosted Weblate i serveix els fitxers a través de https://weblate-cdn.com/.
CDN dels fitxers de traducció¶
Afegit a la versió 2026.5.
- Add-on ID:
weblate.cdn.files- Configuration:
This add-on has no configuration.
- Triggers:
Add-on installation, Component update, Repository post-commit, Repository post-remove, Repository post-update
Publica els fitxers de les traduccions en una xarxa de lliurament de continguts.
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.
Available languages and translation files are listed in the CDN manifest.
Kotlin SDK CDN¶
Afegit a la versió 2026.10.
- Add-on ID:
weblate.cdn.kotlin- Configuration:
maximum_ageMaximum build age (days)
Retires builds this many days after their first registration. Re-registering a build does not extend its age.
maximum_versionsMàxim de versions retingudes
Limits retained builds across all package names. A build is retired when either this limit or the maximum age is reached.
- Triggers:
Add-on installation, Component update, Cada dia, Repository post-commit, Repository post-remove, Repository post-update
Publishes Android string and plural resources for registered Kotlin SDK builds.
Avís
The Kotlin SDK is available as an alpha release. No compatibility is guaranteed until the final Kotlin SDK is released. Endpoints, build metadata, CDN manifests, and generated resource formats may change without backward compatibility.
Install Kotlin SDK CDN on an Android string-resource component to
publish translations for builds registered by the Kotlin SDK. Configure
LOCALIZE_CDN_URL and LOCALIZE_CDN_PATH first. CDN output is
public, including translations from private components. Manifests expose the
application package name and version code. ARSC files expose published resource
names and their submitted IDs alongside translated text. Do not treat the
uploaded resource mapping as confidential; enable publication only when this
disclosure is intended. Registration and status API access remains permission-controlled.
Installation offers to install CDN dels fitxers de traducció by default so the SDK can also consume the original Android XML files. Existing Translation files CDN installations are reused. For existing Kotlin SDK installations, use Install Translation files CDN on the configuration page, then return to copy the updated Gradle configuration. Original files are also published publicly, including those from private components.
Copy the Gradle plugin configuration from the add-on configuration page. It
includes the Weblate server URL, separate translationFiles and kotlinSdk
public CDN URLs, project slug, and component
path (with any category path URL-encoded). Replace the placeholder with a
project-scoped API token whose permissions allow editing the component. Project
administrators can create one in the project’s API access tab; see
Per-project access tokens.
Keep that token in the build environment, not in the application. The add-on’s
API tab shows the API base URL; submit build metadata to its builds/
endpoint. See
Kotlin SDK builds for the request and response format.
For Gradle plugin and library setup, see Kotlin SDK for Android.
The add-on matches resource names and types from registered builds to current component translations. Strings, plurals, and Android styled text are supported. String arrays and resource references are not generated. Untranslated entries, read-only entries, and incomplete plural resources are omitted; applications retain their bundled values. Unsupported styling fails publication; the previous successful publication remains available.
Resource IDs must describe the final installed build. Uploading an identical mapping again is harmless; a different mapping for the same package and version is rejected. Old builds receive current translations by name, including after source text or formatting arguments change. Maintainers are responsible for compatibility with older application code.
Lifecycle settings¶
Maximum build age (days) defaults to 365 and accepts 1 through 730, measured from the first registration. Repeated uploads do not extend it.
Maximum retained versions defaults to 20 and accepts 1 through 100, counted across all package names. One additional unpublished replacement is allowed. New registrations can retire older unpublished replacements. Published builds are retired for this limit only after a replacement is published. Failed replacements preserve existing publications; maximum-age expiry still applies independently.
Either limit retires a build and immediately clears its metadata. Lightweight retired records are deleted on cleanup after 24 hours and successful manifest removal; their package/version identifiers can then be registered again. Failed or interrupted manifest removals are retried hourly. Until removal succeeds, the registration and its referenced artifacts are retained, and the files may remain publicly accessible. Resource mappings are immutable only while their registration records remain.
Each add-on permits at most 1000 registration records, including retired records. New registrations exceeding this limit return HTTP 409 until cleanup frees capacity; identical retries remain accepted. Metadata is bounded by the 5 MiB upload limit and maximum retained version count plus one replacement, without a separate byte quota. Limits are enforced during registration and scheduled cleanup.
Superseded artifacts are deleted on cleanup after a fixed 24-hour window. All artifact files, including superseded files and incomplete publication output, count towards hard limits of 5 GiB and 10000 files per add-on. The larger artifact allowance accommodates translated text and multiple locales; it does not guarantee capacity for every locale or build combination. Shared artifacts count only once. Publications exceeding either limit fail before writing new artifacts and preserve the previous manifest. Neither the window nor these limits are configurable. Limit manifest caching as described below.
Compilation stages one locale at a time on disk. A per-locale conservative encoded text and styling estimate exceeding 64 MiB fails publication.
Preparation additionally requires up to 5 GiB of temporary disk space per
publication job, separate from the published artifact allowance. Temporary
files contain staged ARSC output, shared by versions with identical resource mappings.
They are stored below LOCALIZE_CDN_PATH. Configure the server to
deny access to .kotlin-sdk-staging as described in
Localization CDN before enabling this add-on.
Manifest replacement follows the database commit. Failed or interrupted writes are retried by subsequent publication jobs, with artifacts for both the old and pending manifest protected until replacement succeeds.
Uninstalling the add-on attempts to remove its published files from the CDN origin immediately. Failed or interrupted removals are retried hourly; files may remain publicly accessible until cleanup succeeds. Removal does not revoke copies already cached or downloaded by clients.
Publication and cleanup run asynchronously after build registration, component updates, translation commits and removals, and during daily add-on processing. Failures appear in the add-on activity log and registration status. Previous successful publications remain available when replacement generation fails. If the component stops using the Android resource format, hourly maintenance retires its publications. The normal artifact retention window still applies.
CDN client contract¶
Each build has a stable manifest at
<CDN base>/<packageName>/<versionCode>/manifest.json. The version 1 manifest
contains schemaVersion, packageName, versionCode, and locales.
Locale keys are Weblate language codes. Each locale contains a relative url,
sha256, and byte size for its ARSC artifact. Resolve relative URLs against
the manifest URL. Artifact contents do not change after publication.
The manifest has a JSON Schema.
Configure the CDN origin to cache manifests for at most one hour (for example,
Cache-Control: public, max-age=3600), and artifact files with
Cache-Control: public, max-age=31536000, immutable. Artifact files may use
application/octet-stream. Configure these headers on the CDN server.
Translation updates and retirements can take up to one hour to reach clients.
Use Cache-Control: no-cache when immediate revalidation is preferred.
The fixed 24-hour artifact retention window exceeds the manifest cache lifetime.
The Kotlin SDK should validate artifact length and hash, cache successful downloads locally, and load them with Android’s resources-loader API on API 30 or newer. A missing manifest, missing locale, or download failure must preserve bundled resources. Retired manifests return 404 at the origin; cached copies can remain usable until they expire. Hashes detect corrupted or mismatched content; authentication relies on HTTPS and the configured CDN.
Suprimeix les cadenes buides¶
Afegit a la versió 4.4.
- Add-on ID:
weblate.cleanup.blank- Configuration:
This add-on has no configuration.
- Triggers:
Add-on installation, Repository post-commit, Repository post-update
Suprimeix les cadenes sense traducció dels fitxers de traducció.
Utilitzeu-ho per no tenir cap cadena buida als fitxers de traducció (per exemple, si la vostra biblioteca de localització les mostra com a faltes en lloc de tornar a la cadena d’origen).
Neteja els fitxers de traducció¶
- Add-on ID:
weblate.cleanup.generic- Configuration:
This add-on has no configuration.
- Triggers:
Add-on installation, Repository post-update, Repository pre-commit
Actualitzeu tots els fitxers de traducció perquè coincideixin amb el fitxer base monolingüe. Per a la majoria de formats de fitxer, això implica suprimir les claus de traducció obsoletes que ja no existeixen al fitxer base.
Per als formats que contenen contingut addicional a més de les cadenes de traducció (com ara Fitxers HTML, Fitxers RC del Windows, o Format OpenDocument), això també sincronitza el fitxer de traducció amb el fitxer base.
For a one-time cleanup of a single translation file, use Cleanup unused in Manteniment del repositori on that translation instead of installing the add-on.
Afegeix les llengües que hi manquin¶
- Add-on ID:
weblate.consistency.languages- Configuration:
This add-on has no configuration.
- Triggers:
Garanteix que tots els components d’un projecte utilitzin el mateix joc de llengües.
Nota
The components shared from other projects are not considered in this.
Els idiomes que falten es comproven una vegada cada 24 hores i quan s’afegeixen idiomes nous a Weblate.
A diferència de la majoria d’altres, aquest complement afecta tot el projecte.
Suggeriment
Tradueix automàticament les cadenes afegides recentment amb Traducció automatitzada.
Descobriment de components¶
- Add-on ID:
weblate.discovery.discovery- Configuration:
File matching
matchExpressió regular per a trobar fitxers de traducció
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_formatFormat de fitxer
language_regexFiltre de llengua
Expressió regular per a filtrar fitxers de traducció quan s’escanegen per filtre de fitxers.
Component naming and file templates
name_templatePersonalitza el nom del component
Utilitzeu la sintaxi de plantilles del Django. Aquesta plantilla ha d’incloure {{ component }}.
base_file_templateDefineix el nom de fitxer base monolingüe
Deixeu-ho buit per als fitxers de traducció bilingües. Quan es defineix, la plantilla ha d’incloure {{ component }}.
new_base_templateDefineix el fitxer base per a noves traduccions
Nom de fitxer del fitxer utilitzat per a crear traduccions noves. Per al gettext, trieu el fitxer .pot. Aquesta plantilla ha d’incloure {{ component }}.
intermediate_templateFitxer de llengua intermèdia
El nom del fitxer de llengua intermèdia. En molts casos, és un fitxer de traducció que aporten els desenvolupadors i que s’utilitza quan es creen les cadenes d’origen. Aquesta plantilla ha d’incloure {{ component }}.
filemask_templateDefiniu el filtre de fitxers
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.
Component lifecycle
copy_addonsClona els complements del component principal als nous components
removeSuprimeix els components dels fitxers inexistents
- Triggers:
Afegeix o suprimeix automàticament components del projecte basant-se en els canvis de fitxers del sistema de control de versions.
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.
Requisits de descoberta¶
Per descobrir un component amb èxit, la configuració ha de fer tot el següent:
The regular expression must define a
componentnamed group. Matching translation files also requires alanguagenamed group.Els camps de plantilla utilitzats per anomenar o localitzar fitxers per component han d’incloure
{{ component }}, de manera que el valor representat realment canvia per a cada component descobert.For monolingual formats, the component must contain a file matching
base_file_templateand at least one translation file matchingmatch, 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
languagegroup. Keep full control over thecomponentcapture, for examplelocale/(?P<component>[^/]+)\.potordocs/(?P<component>[^/_]+)\.md.Fill Define the file mask with a path that includes both a language wildcard and
{{ component }}, for examplelocale/*/{{ component }}.poordocs/{{ component }}_*.md.Keep using the other filename templates with any named groups from the match expression.
Exemple treballat: news_<lang>.md¶
Aquest és un disseny comú de variants d’idioma basat en noms de fitxer:
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
En aquest exemple, {{ component }} es resol amb el nom base abans del sufix d’idioma, de manera que docs/news_en.md, docs/news_pt_BR.md i docs/news_pt-BR.md es converteixen tots en el component news.
You can use Django template markup in all filename fields, for example:
{{ component }}El nom del component s’ha analitzat des del grup de concordança
component{{ component|title }}Nom de fitxer del component amb la primera lletra en majúscula
{{ path }}: {{ component }}Custom match group from the regular expression
Un cop premeu Desa, es presentarà una vista prèvia dels components coincidents, des d’on podeu comprovar si la configuració s’adapta realment a les vostres necessitats:
Component discovery examples¶
L’exemple treballat anterior cobreix el disseny de variants basat en noms de fitxer més comú. Els exemples següents mostren altres estructures de repositoris amb les quals podeu coincidir.
Una carpeta per llengua¶
Una carpeta per llengua que conté els fitxers de traducció per als components.
- Regular expression:
(?P<language>[^/.]*)/(?P<component>[^/]*)\.po- Matching files:
cs/application.pocs/website.pode/application.pode/website.po
Disposició de configuracions regionals del gettext¶
Estructura habitual per a emmagatzemar els fitxers PO del gettext.
- 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
Nom de fitxers complexos¶
Utilitzar tant el nom del component com el de la llengua al nom del fitxer.
- 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
Codi de llengua repetit¶
Utilitzar la llengua tant al camí com al nom del fitxer.
- 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
Divideix les cadenes d’Android¶
Cadenes de recursos d’Android, dividides en diversos fitxers.
- 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
Múltiples camins coincidents¶
Projecte multimòdul de Maven amb traduccions de propietats de Java.
- 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
Suggeriment
El complement de descoberta de components utilitza URL interns del lloc web. És una manera convenient de compartir la configuració de VCS entre diversos components. Els components enllaçats utilitzen el dipòsit local del component principal configurat omplint weblate://project/main-component al camp Repositori del codi font (a Operacions ↓ Configuració ↓ Sistema de control de versions) de cada component respectiu. Això també estalvia temps amb la configuració i els recursos del sistema.
Suggeriment
Assegureu-vos que el nou component contingui el conjunt complet d’idiomes traduïbles amb Afegeix les llengües que hi manquin.
Vegeu també
Fedora Messaging¶
Afegit a la versió 5.15.
- Add-on ID:
weblate.fedora_messaging.publish- Configuration:
Broker connection
amqp_urlURL del corredor AMQP
L’URL del corredor AMQP al qual es connecta.
topic_prefixTopic prefix
Optional prefix to prepend to generated message topics.
Timeouts and retries
publish_timeoutPublish timeout
How many seconds to wait for the broker delivery acknowledgement.
connection_attemptsConnection attempts
How many times to try connecting to the broker.
retry_delayRetard entre reintents
How many seconds to wait between connection attempts.
TLS credentials
ca_certPaquet de certificats CA (PEM)
Paste only PEM certificate blocks, each starting with «—–BEGIN CERTIFICATE—–» and ending with «—–END CERTIFICATE—–«.
client_keyClient private key (PEM)
Paste a single unencrypted PEM private key block. Encrypted private keys are not supported.
client_certCertificat de client (PEM)
Paste only the PEM certificate block starting with «—–BEGIN CERTIFICATE—–»; do not paste the output from «openssl x509 -text».
Event selection
event_filterEsdeveniments de canvi que s’activaran
Choose which change events should trigger this add-on. Esdeveniments de canvi que s’activaran
eventsEsdeveniments de canvi seleccionats
- Triggers:
Envia notificacions a un intercanvi AMQP compatible amb Fedora Messaging.
Fedora Messaging és un editor basat en AMQP per a tots els canvis que es produeixen a Weblate. Podeu connectar serveis addicionals als canvis que es produeixin a Weblate fent servir això.
Configure the broker with a plain amqp:// or amqps:// URL, including
its virtual host. URL query strings and fragments are not supported. Use the
add-on’s connection attempts, retry delay, and publish timeout fields instead.
The publish timeout covers connection attempts, retry delays, and broker
confirmation. Publishing resolves DNS when opening a connection and reuses the
existing connection without further DNS lookups. Resolved addresses and the
connected peer are checked against the configured private-network restrictions.
Synchronous DNS resolution cannot be interrupted by the publish timeout and
can exceed it when the system resolver is slow or unavailable. Rejected
messages are not retried.
Weblate reuses a publisher connection in each worker process, with AMQP heartbeats disabled. Failed connections are discarded and recreated on the next attempt. A lost broker confirmation can cause duplicate delivery; consumers can identify retries by their unchanged message ID.
Message topic¶
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 Esdeveniments de canvi seleccionats
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.
Message body¶
El cos consta dels següents camps (tenint en compte que estan disponibles per a l’esdeveniment):
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.
urlURL absolut per veure l’objecte relacionat.
authorNom d’usuari de l’autor (pot ser diferent de l’usuari, per exemple quan s’accepten suggeriments)
userActing username
projectLlimac del projecte
componentComponent llimac
translationCodi d’idioma de traducció
Message headers¶
Hi ha capçaleres addicionals que també podeu utilitzar per a l’encaminament:
actionVerbose name of the change.
projectLlimac del projecte
componentComponent llimac
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"]
}
Vegeu també
Edició massiva¶
- Add-on ID:
weblate.flags.bulk- Configuration:
qConsulta
search_typeTipus de cerca
Available choices:¶ textText
regexExpressió regular
searchCadena de cerca
Case-sensitive text or regular expression to replace in matching strings. Leave empty to disable replacement.
replacementCadena de substitució
Leave empty to remove matching text. In regular expression mode, use 1 for the first captured group. Named group references are also supported.
stateEstat a definir
Available choices:¶ -1No canviïs
0Buida
10Cal editar
11Needs editing (Needs rewriting)
12Needs editing (Needs checking)
20Traduït
30Aprovada
Source flags
Flags are set on the source strings corresponding to your filter results and apply to their translations in every language.
add_flagsAdd flags
remove_flagsRemove flags
Translation flags
Flags apply only to translations matching your filter. Source strings are excluded.
add_translation_flagsAdd flags
remove_translation_flagsRemove flags
Only flags set directly on these translations are removed. Inherited flags remain in effect.
Labels
Labels apply to the source strings corresponding to your filter results and are shared across all languages.
add_labelsAdd labels
remove_labelsRemove labels
- Triggers:
Bulk edit text, flags, labels, or states of strings.
Uses the operations described in Edició massiva, including literal or regular expression replacement and clearing translations. Runs process all eligible matching strings without interactive preview. See Edició massiva for replacement syntax and string state values.
Exemples:
Search query |
|
|---|---|
Labels: Add labels |
recent |
Search query |
|
|---|---|
Translation flags: Add flags |
|
Search query |
|
|---|---|
Translation flags: Add flags |
|
Marca les traduccions sense canvis com a «cal reescriure»¶
- Add-on ID:
weblate.flags.same_edit- Configuration:
This add-on has no configuration.
- Triggers:
Quan s’importa una cadena traduïble nova del sistema de control de versions i coincideix amb una cadena d’origen, es marca com a «cal reescriure» al Weblate. És especialment útil per als formats de fitxer que inclouen les cadenes d’origen per a les cadenes sense traduir.
Suggeriment
També és possible que vulgueu reforçar la comprovació Traducció no modificada afegint el senyalador strict-same a Marques de traducció.
Vegeu també
Marca les cadenes d’origen noves com a «cal revisar»¶
- Add-on ID:
weblate.flags.source_edit- Configuration:
This add-on has no configuration.
- Triggers:
Quan s’importa una cadena d’origen nova del sistema de control de versions, es marca com a «cal revisar» al Weblate. D’aquesta manera, podeu filtrar i editar fàcilment les cadenes d’origen escrites pels desenvolupadors.
Vegeu també
Marca les traduccions noves com a «cal reescriure»¶
- Add-on ID:
weblate.flags.target_edit- Configuration:
This add-on has no configuration.
- Triggers:
Quan s’importa una cadena traduïble nova del sistema de control de versions, es marca com a «cal reescriure» al Weblate. D’aquesta manera, podeu filtrar i editar fàcilment les traduccions creades pels desenvolupadors.
Vegeu també
Marca les traduccions actualitzades al repositori com a «cal reescriure»¶
- Add-on ID:
weblate.flags.target_repo_update- Configuration:
This add-on has no configuration.
- Triggers:
Quan la traducció d’una cadena canvia del sistema de control de versions, es marca com a «cal reescriure» al Weblate. És especialment útil si els fitxers de les traduccions són actualitzats sovint de manera manual o amb un servei extern.
Vegeu també
Omple les cadenes de només lectura amb l’origen¶
Afegit a la versió 4.18.
- Add-on ID:
weblate.generate.fill_read_only- Configuration:
This add-on has no configuration.
- Triggers:
Omple la traducció de les cadenes de només lectura amb la cadena d’origen.
Generador d’estadístiques¶
- Add-on ID:
weblate.generate.generate- Configuration:
scopeOutput scope
Available choices:¶ translationUn fitxer per traducció
componentUn fitxer per component
filenameNom del fitxer generat
templateContingut del fitxer generat
- Triggers:
Add-on installation, Component update, Repository post-add, Repository post-remove, Repository pre-commit
Genera un fitxer que conté informació detallada de l’estat de la traducció.
You can use a Django template in both filename and content, see Marcatge de plantilla for a detailed markup description.
For example generating a summary file for each translation:
- Nom del fitxer generat
locale/{{ language_code }}.json- Contingut
{ "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:ltrorrtl.filenameandurl: 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.
Vegeu també
Preomple la traducció amb l’origen¶
Afegit a la versió 4.11.
- Add-on ID:
weblate.generate.prefill- Configuration:
This add-on has no configuration.
- Triggers:
Omple les cadenes de traducció amb la cadena d’origen.
Totes les cadenes no traduïdes del component s’ompliran amb la cadena d’origen i es marcaran com a que necessiten edició. Utilitzeu-ho quan no pugueu tenir cadenes buides als fitxers de traducció. .. INICI AUTOGENERAT: weblate.generate.pseudolocale .. Aquesta secció es genera automàticament per ./manage.py list_addons. No editeu manualment.
Generació de pseudolocalitzacions¶
Afegit a la versió 4.5.
- Add-on ID:
weblate.generate.pseudolocale- Configuration:
Source and target
sourceCadenes d’origen
include_readonlyInclou les cadenes de només lectura
targetTraducció de destinació
Se sobreescriuran totes les cadenes d’aquesta traducció
Prepended text
prefixText estàtic al davant
var_prefixText variable al davant
Appended text
suffixText estàtic al darrere
var_suffixText variable al darrere
Text expansion
var_multiplierMultiplicador de text variable
Quantes vegades es repetirà el text variable depenent de la longitud de la cadena d’origen.
- Triggers:
Genera una traducció afegint un prefix i un sufix a les cadenes d’origen de manera automàtica.
Els pseudolocales són útils per trobar cadenes que no estan preparades per a la localització. Això es fa modificant totes les cadenes d’origen traduïbles per tal que sigui fàcil detectar cadenes no alterades quan s’executa l’aplicació en l’idioma pseudolocal.
També és possible trobar cadenes els homòlegs localitzats de les quals no s’ajustin al disseny.
L’ús de les parts variables fa possible buscar cadenes que potser no encaixen a la interfície d’usuari després de la localització; amplia el text en funció de la longitud de la cadena d’origen. Els textos variables es repeteixen per la longitud del text multiplicada pel multiplicador. Per exemple, Hola món amb text variable _ i el multiplicador variable d’1 es converteix en Hola món___________: el text es repeteix una vegada per a cada caràcter de la cadena d’origen.
Les cadenes es generaran fent servir el patró següent:
Prepended static text Prepended variable text Source string Appended variable text Appended static text
Suggeriment
Podeu utilitzar idiomes reals per fer proves, però hi ha pseudolocals dedicats disponibles a Weblate: en_XA i ar_XB.
Suggeriment
Podeu utilitzar aquest complement per iniciar la traducció a una nova configuració regional d’un idioma existent o similar. Un cop afegiu la traducció al component, aneu al complement. Exemple: Si teniu fr i voleu començar la traducció fr_CA, simplement establiu fr com a font, fr_CA com a destinació i deixeu el prefix i el sufix en blanc.
Desinstal·leu el complement un cop hàgiu omplert la traducció nova per evitar que Weblate canviï les traduccions fetes després de la còpia.
Actualitza la variable ALL_LINGUAS del fitxer «configure»¶
- Add-on ID:
weblate.gettext.configure- Configuration:
This add-on has no configuration.
- Triggers:
Add-on installation, Cada dia, Repository post-add, Repository post-remove
Actualitza la variable ALL_LINGUAS als fitxers «configure», «configure.in» o «configure.ac» quan s’afegeix o s’elimina una traducció nova.
Updates the ALL_LINGUAS variable in configure, configure.in or any
configure.ac files, when a translation is added or removed.
Personalitza la sortida del gettext¶
S’ha eliminat a la versió 5.13: Replaced by Paràmetres del format de fitxer.
Actualitza la plantilla de gettext (Django)¶
Afegit a la versió 5.17.
- Add-on ID:
weblate.gettext.django- Configuration:
intervalFreqüència d’actualització
Amb quina freqüència el complement hauria d’actualitzar el fitxer POT quan s’actualitza el component.
Available choices:¶ dailyCada dia
weeklySetmanal
monthlyCada mes
normalize_headerNormalitza la capçalera del POT
Actualitza les capçaleres del gettext i substitueix els comentaris d’espai reservat del POT.
location_modeUbicacions d’origen
Choose how extraction writes source locations to the POT file. Use this to keep locations in the template while omitting them from translated PO files.
Available choices:¶ fileUtilitza la configuració del format de fitxers
keepExtreu les ubicacions al fitxer POT
omitNo extreguis les ubicacions
- Triggers:
Actualitza la plantilla de gettext mitjançant l’ordre «makemessages» integrada del Django.
This add-on updates the template configured in Plantilla per a traduccions noves. 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 Actualitza els fitxers PO perquè coincideixin amb el 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.
Actualitza el fitxer LINGUAS¶
- Add-on ID:
weblate.gettext.linguas- Configuration:
This add-on has no configuration.
- Triggers:
Add-on installation, Cada dia, Repository post-add, Repository post-remove
Actualitza el fitxer LINGUAS en afegir o eliminar una traducció.
Actualitza el fitxer POT (Meson)¶
Afegit a la versió 5.17.
- Add-on ID:
weblate.gettext.meson- Configuration:
Update behavior
intervalFreqüència d’actualització
Amb quina freqüència el complement hauria d’actualitzar el fitxer POT quan s’actualitza el component.
Available choices:¶ dailyCada dia
weeklySetmanal
monthlyCada mes
normalize_headerNormalitza la capçalera del POT
Actualitza les capçaleres del gettext i substitueix els comentaris d’espai reservat del POT.
location_modeUbicacions d’origen
Choose how extraction writes source locations to the POT file. Use this to keep locations in the template while omitting them from translated PO files.
Available choices:¶ fileUtilitza la configuració del format de fitxers
keepExtreu les ubicacions al fitxer POT
omitNo extreguis les ubicacions
Meson preset
presetPreajust del Meson
Preajust de l’argument integrat de xgettext que coincideix amb la integració de gettext del Meson. El preajust «GLib» afegeix les opcions «keyword» i «format-flag» utilitzades per l’ajudant de gettext del Meson.
Available choices:¶ glibGLib
Comment extraction
comment_modeComentaris del codi
Trieu si xgettext ha d’extreure cap comentari, tots els comentaris o només els comentaris marcats amb una etiqueta específica.
Available choices:¶ offNo extreguis els comentaris
allExtreu tots els comentaris
taggedExtreu els comentaris amb etiqueta
comment_tagEtiqueta del comentari
Etiqueta passada a xgettext per a l’extracció de comentaris quan s’utilitza el mode de comentaris etiquetats.
Keywords
keywordParaules clau addicionals
Paraules clau addicionals separades per salts de línia passades a l’xgettext mitjançant –keyword.
keyword_exclusiveUse keywords exclusively
When enabled, passes
--keywordwithout a value to xgettext before the additional keyword, disabling all default keywords so that only the keyword specified above is recognized.Checks and ITS data
checksComprovacions de l’xgettext
Comprovacions addicionals de validació de xgettext a activar per als missatges extrets.
Available choices:¶ ellipsis-unicodepunts suspensius-unicode
space-ellipsisspace-ellipsis
quote-unicodecita-unicode
bullet-unicodebala-unicode
data_dirsDirectoris de dades ITS
Newline-separated repository-relative directories containing an its subdirectory, for example po for po/its. Earlier directories override later directories and bundled rules.
- Triggers:
Actualitza la plantilla del gettext utilitzant les convencions de gettext del Meson.
This add-on updates the template configured in Plantilla per a traduccions noves. 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 Actualitza els fitxers PO perquè coincideixin amb el 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
Plantilla per a traduccions noves. 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 Plantilla per a traduccions noves, 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 els fitxers MO¶
- Add-on ID:
weblate.gettext.mo- Configuration:
pathCamí del fitxer MO generat
Si no s’especifica, s’utilitza la ubicació del fitxer PO.
fuzzyInclou les cadenes que cal editar
Les cadenes que cal editar («fuzzy») normalment no estan preparades per a ser utilitzades com a traduccions.
- Triggers:
Genera un fitxer MO automàticament per a cada fitxer PO canviat.
The location of the generated MO file can be customized and the field for it uses Marcatge de plantilla.
Nota
Si s’elimina una traducció, el seu fitxer PO s’eliminarà del dipòsit, però el fitxer MO generat per aquest complement no ho farà. El fitxer MO s’ha d’eliminar manualment de la xarxa amunt.
Actualitza els fitxers PO perquè coincideixin amb el POT (msgmerge)¶
Canviat a la versió 5.13: La configuració Settings s’ha mogut a Paràmetres del format de fitxer.
- Add-on ID:
weblate.gettext.msgmerge- Configuration:
This add-on has no configuration.
- Triggers:
Actualitza tots els fitxers PO (com els hàgiu configurat a «Filtre de fitxers») perquè coincideixin amb el fitxer POT (com l’hàgiu configurat a «Plantilla per a noves traduccions») fent servir msgmerge.
Aquest complement és essencial quan es treballa amb fitxers gettext PO on el fitxer POT (plantilla) s’actualitza amb cadenes noves o canvis a les cadenes existents. Quan el fitxer POT s’actualitza al dipòsit, aquest complement fusiona automàticament aquests canvis amb tots els fitxers PO d’idioma, assegurant-se que:
New translatable strings appear in all languages
Removed strings are marked as obsolete
Les cadenes modificades estan marcades com a que necessiten revisió (difuses)
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.
Actualitza el fitxer POT (Sphinx)¶
Afegit a la versió 5.17.
- Add-on ID:
weblate.gettext.sphinx- Configuration:
intervalFreqüència d’actualització
Amb quina freqüència el complement hauria d’actualitzar el fitxer POT quan s’actualitza el component.
Available choices:¶ dailyCada dia
weeklySetmanal
monthlyCada mes
normalize_headerNormalitza la capçalera del POT
Actualitza les capçaleres del gettext i substitueix els comentaris d’espai reservat del POT.
location_modeUbicacions d’origen
Choose how extraction writes source locations to the POT file. Use this to keep locations in the template while omitting them from translated PO files.
Available choices:¶ fileUtilitza la configuració del format de fitxers
keepExtreu les ubicacions al fitxer POT
omitNo extreguis les ubicacions
filter_modeFiltrat
Opcionalment, elimineu les cadenes que no siguin útils per a traduir després de l’extracció de Sphinx.
Available choices:¶ noneCap
weblate_docsDocumentació del Weblate
- Triggers:
Actualitza la plantilla de gettext utilitzant el generador de gettext de Sphinx sense carregar la configuració del projecte.
This add-on updates the template configured in Plantilla per a traduccions noves. 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 Actualitza els fitxers PO perquè coincideixin amb el 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.
Actualitza el fitxer POT (xgettext)¶
Afegit a la versió 5.17.
- Add-on ID:
weblate.gettext.xgettext- Configuration:
Update behavior
intervalFreqüència d’actualització
Amb quina freqüència el complement hauria d’actualitzar el fitxer POT quan s’actualitza el component.
Available choices:¶ dailyCada dia
weeklySetmanal
monthlyCada mes
normalize_headerNormalitza la capçalera del POT
Actualitza les capçaleres del gettext i substitueix els comentaris d’espai reservat del POT.
location_modeUbicacions d’origen
Choose how extraction writes source locations to the POT file. Use this to keep locations in the template while omitting them from translated PO files.
Available choices:¶ fileUtilitza la configuració del format de fitxers
keepExtreu les ubicacions al fitxer POT
omitNo extreguis les ubicacions
Input files
input_modeOrigen de l’entrada
Trieu si xgettext ha de llegir els fitxers d’origen dels patrons glob o d’un manifest POTFILES/POTFILES.in.
Available choices:¶ patternsPatrons de fitxers d’origen
potfilesManifest POTFILES
languageLlengua de l’xgettext
Llenguatge de programació passat a l’ xgettext, per exemple, Python o C. Deixeu-ho en blanc pera permetre que l’xgettext endevini la llengua a partir de les extensions dels fitxers.
source_patternsPatrons de fitxers d’origen
Patrons glob relatius al repositori separats per salts de línia per a extreure fitxers amb xgettext.
potfiles_pathCamí al POTFILES
Camí al POTFILES o POTFILES.in relatiu al repositori. Els elements es resolen de manera relativa a l’arrel del dipòsit. Si està present juntament amb el manifest, el POTFILES.skip exclou els fitxers llistats de l’extracció.
Comment extraction
comment_modeComentaris del codi
Trieu si xgettext ha d’extreure cap comentari, tots els comentaris o només els comentaris marcats amb una etiqueta específica.
Available choices:¶ offNo extreguis els comentaris
allExtreu tots els comentaris
taggedExtreu els comentaris amb etiqueta
comment_tagEtiqueta del comentari
Etiqueta passada a xgettext per a l’extracció de comentaris quan s’utilitza el mode de comentaris etiquetats.
Keywords
keywordParaules clau addicionals
Paraules clau addicionals separades per salts de línia passades a l’xgettext mitjançant –keyword.
keyword_exclusiveUse keywords exclusively
When enabled, passes
--keywordwithout a value to xgettext before the additional keyword, disabling all default keywords so that only the keyword specified above is recognized.Checks and ITS data
checksComprovacions de l’xgettext
Comprovacions addicionals de validació de xgettext a activar per als missatges extrets.
Available choices:¶ ellipsis-unicodepunts suspensius-unicode
space-ellipsisspace-ellipsis
quote-unicodecita-unicode
bullet-unicodebala-unicode
data_dirsDirectoris de dades ITS
Newline-separated repository-relative directories containing an its subdirectory, for example po for po/its. Earlier directories override later directories and bundled rules.
- Triggers:
Actualitza la plantilla de gettext utilitzant xgettext als fitxers d’origen seleccionats.
This add-on updates the template configured in Plantilla per a traduccions noves. 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 Actualitza els fitxers PO perquè coincideixin amb el 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 Actualitza el fitxer 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.
Vegeu també
Fes comissions «squash» al Git¶
- Add-on ID:
weblate.git.squash- Configuration:
squash«Squash» de les comissions
Available choices:¶ allTotes les comissions en una
languagePer llengua
filePer fitxer
authorPer autor
author-languagePer autor i llengua
append_trailersAfegeix línies al final del missatge de la comissió amb «squash»
Les línies finals s’assemblen a capçaleres de correu RFC 822 i s’afegeixen a la secció final d’un missatge de comissió. Aquestes línies poden contenir indicacions com ara «Co-authored-by: …».
commit_messageMissatge de la comissió
S’utilitzarà aquest missatge de comissió en lloc de la combinació de missatges de les comissions amb «squash».
- Triggers:
Fa «squash» de les comissions del Git abans de pujar els canvis.
Suggeriment
Per evitar conflictes innecessaris, es recomana configurar la recepció automàtica de canvis amunt per webhooks o API, vegeu Actualització de repositoris.
Les confirmacions de Git es poden esborrar abans d’impulsar els canvis en un dels modes següents:
Totes les comissions en una
Per llengua
Per fitxer
Per autor
Per autor i llengua
Original commit messages are kept, but authorship is lost unless Per author is selected, or the commit message is customized to include it.
Els missatges de confirmació originals es poden substituir opcionalment amb un missatge de confirmació personalitzat.
Els tràilers (línies de confirmació com Co-authored-by: …) es poden eliminar opcionalment dels missatges de confirmació originals i afegir-los al final del missatge de confirmació esborrat. Això també genera el crèdit adequat de Coautor: per a cada traductor.
Personalitza la sortida JSON¶
Canviat a la versió 5.12: Evita els espais després d’haver afegit l’opció de separadors.
S’ha eliminat a la versió 5.13: Replaced by Paràmetres del format de fitxer.
Reinicialitza el dipòsit a la font¶
Afegit a la versió 5.17.
- Add-on ID:
weblate.hosted.reset- Configuration:
This add-on has no configuration.
- Triggers:
Descarta tots els canvis del dipòsit del Weblate cada nit.
Formata el fitxer de propietats de Java¶
- Add-on ID:
weblate.properties.sort- Configuration:
case_sensitiveActiva l’ordenació de claus sensible a majúscules i minúscules
- Triggers:
Formata i ordena el fitxer de propietats de Java.
Consolida les noves línies a les d’Unix.
Formatat en majúscules de les seqüències d’escapada Unicode (en cas que estiguin presents).
Strips blank lines and comments.
Sorts the strings by the keys.
Drops duplicate strings.
Supressió de comentaris antics¶
- Add-on ID:
weblate.removal.comments- Configuration:
ageDies d’emmagatzematge
- Triggers:
Defineix un interval de temps per a la supressió de comentaris.
Això pot ser útil per eliminar comentaris antics que podrien haver quedat obsolets. Utilitzar amb cura ja que els comentaris envellint no vol dir que hagin perdut la seva importància.
Supressió de suggeriments antics¶
- Add-on ID:
weblate.removal.suggestions- Configuration:
ageDies d’emmagatzematge
votesLlindar de vots
Llindar per a la supressió. Deixeu-ho en blanc per a eliminar els suggeriments independentment dels vots. Aquest camp no té efecte si els vots estan desactivats.
- Triggers:
Definiu un interval de temps per a la supressió de suggeriments.
Can be very useful in connection with suggestion voting (see Revisió per parells) to remove suggestions which don’t receive enough positive votes in a given timeframe.
Actualitza els fitxers RESX¶
- Add-on ID:
weblate.resx.update- Configuration:
This add-on has no configuration.
- Triggers:
Actualitza tots els fitxers de traducció perquè coincideixin amb el fitxer base monolingüe de la font. Les cadenes no utilitzades se suprimiran, i les noves s’afegiran com a còpies de la cadena d’origen.
Suggeriment
Utilitzeu Neteja els fitxers de traducció si només voleu eliminar les claus de traducció obsoletes.
Webhooks de Slack¶
Afegit a la versió 5.12.
- Add-on ID:
weblate.webhook.slack- Configuration:
webhook_urlURL del webhook
event_filterEsdeveniments de canvi que s’activaran
Choose which change events should trigger this add-on. Esdeveniments de canvi que s’activaran
eventsEsdeveniments de canvi seleccionats
- Triggers:
Envia una notificació a un canal de Slack en base a esdeveniments seleccionats.
Avís
El contingut de la notificació pot mostrar etiquetes HTML. Aquest és un tema conegut que s’abordarà aviat; vegeu https://github.com/WeblateOrg/weblate/issues/15056.
Suggeriment
Per obtenir un URL de webhook, seguiu els passos descrits a la documentació de Slack Incoming Webhooks
Webhook¶
Afegit a la versió 5.11.
Canviat a la versió 5.15: Ara s’ha validat el compliment de la longitud del secret amb l’especificació.
- Add-on ID:
weblate.webhook.webhook- Configuration:
webhook_urlURL del webhook
secretSecret del webhook
El secret de Standard Webhooks és una cadena codificada en base64.
event_filterEsdeveniments de canvi que s’activaran
Choose which change events should trigger this add-on. Esdeveniments de canvi que s’activaran
eventsEsdeveniments de canvi seleccionats
- Triggers:
Envia notificacions a serveis externs en base a esdeveniments seleccionats seguint l’especificació Standard Webhooks.
The request payload complies with the Weblate Messaging schema. The
action field uses the action name listed in Esdeveniments de canvi seleccionats.
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"
}
Exemple de cos de sol·licitud amb 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"
]
}
Exemples de capçaleres de sol·licituds:
{
"webhook-id": "7f1c5477f6275a69af7b83236c20cb1a",
"webhook-timestamp": "1748505623.044281",
"webhook-signature": "v1,Ceo5qEr07ixe2NLpvHk3FH9bwy/WavXrAFQ/9tdO6mc="
}
La webhook-signature és una llista separada per espais de signatures HMAC generades mitjançant la cadena secret, la càrrega útil de la sol·licitud, el webhook-timestamp i el webhook-id. Això garanteix l’autenticitat i la integritat de la sol·licitud de webhook.
El secret proporcionat és una cadena codificada en base64 entre 24 bytes (192 bits) i 64 bytes (512 bits). Pot ser prefixat amb whsec_ per facilitar la identificació.
Per verificar una sol·licitud, podeu utilitzar el mètode Webhook.verify de la biblioteca standardwebhooks o una implementació de l“«Especificació de Webhooks estàndard».
Vegeu també
The Traducció automatitzada 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 CDN dels fitxers de traducció and CDN de localització de JavaScript add-ons
publish manifest.json at their CDN base URL. Clients can download it
without an API token to discover available languages and translation files:
{
"schemaVersion": 1,
"locales": {
"cs": [
{
"url": "cs.json",
"sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"size": 123
}
]
}
}
The locales keys are Weblate language codes. Each value lists the published
files for that language, sorted by URL. The url is relative to the manifest
URL, sha256 is the SHA-256 checksum of the published bytes, and size is
the file size in bytes. Multi-file translations have several entries per
language. The JavaScript add-on includes only languages meeting its translation
threshold. Source-language inclusion follows each add-on’s existing publication
rules. The JavaScript loader and the manifest itself are not listed.
When no translation files are published, locales is an empty object.
The root filename manifest.json is reserved for this manifest.
Weblate validates each manifest against the CDN manifest before
publishing it.
Translation files are written before the manifest is replaced, and stale files are removed afterwards. File URLs remain mutable, and CDN caches can refresh the manifest and translation files at different times. If a download fails or its checksum does not match, refresh the manifest and retry the download. The manifest does not provide an immutable snapshot or revoke cached copies of removed files. Existing add-on installations publish a manifest on their next successful publication.
The Kotlin SDK CDN add-on uses a separate build-specific manifest format.
The Descobriment de components 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.
When configuring the add-on, Weblate also suggests presets detected from the repository. Preset detection analyzes at most 4,096 distinct results with file masks no longer than 512 characters or 16 path segments. It samples groups of more than 128 compatible results and limits itself to 8,192 comparisons, 50 presets, and eight examples per preset. If a limit omits results or comparisons, Weblate warns that suggestions might be incomplete. You can enter the configuration manually.
The Webhook and
Webhooks de Slack add-ons request uncompressed responses and
reject responses with a Content-Encoding other than identity before
reading their bodies. They limit each response body to 1 MiB and response
headers to 64 KiB, including duplicate headers and separators.
If a response is encoded or either fixed limit is exceeded, Weblate closes the
response and records an add-on error without storing the response body or headers.
The remote service might already have accepted the notification even when
Weblate records this error.
Obsolete add-ons¶
Col·laboradors als comentaris¶
S’ha eliminat a la versió 2026.10: Replaced by Contributor comments.
Existing installations of weblate.gettext.authors are migrated to the
gettext value of the po_contributor_comments file format parameter for
each affected PO component. This includes components covered by category-,
project-, and site-wide installations. New components default to disabled unless
their file format parameters are copied from another component.
Remove weblate.addons.gettext.GettextAuthorComments from custom
WEBLATE_ADDONS lists and weblate.gettext.authors entries from
DEFAULT_ADDONS. Configure Contributor comments instead.
Personalitza la sortida XML¶
Afegit a la versió 4.15.
S’ha eliminat a la versió 5.13: Replaced by Paràmetres del format de fitxer.
Personalitza la sortida YAML¶
S’ha eliminat a la versió 5.13: Replaced by Paràmetres del format de fitxer.
Common add-on parameters¶
Serveis de traducció¶
|
Alibaba |
|
Amazon Translate |
|
Anthropic |
|
Apertium APy |
|
Azure AI Translator |
|
Azure OpenAI |
|
Baidu |
|
CyrTranslit |
|
DeepL |
|
Glosbe |
|
Google Cloud Translation Advanced |
|
Google Cloud Translation Basic |
|
LTEngine |
|
LibreTranslate |
|
Mistral |
|
ModernMT |
|
MyMemory |
|
Netease Sight |
|
Ollama |
|
OpenAI |
|
SAP Translation Hub |
|
Systran |
|
Weblate |
|
Weblate Memòria de traducció |
|
Yandex |
|
Yandex v2 |
|
Youdao Zhiyun |
|
eTranslation |
|
tmserver |
Format de fitxer¶
|
XLIFF 1.2 amb extensions d’Apple |
|
Fitxers de metadades de botiga d’aplicacions |
|
Fitxer ARB |
|
Recurs de cadenes de l’Android |
|
Fitxer AsciiDoc |
|
Fitxer de subtítols Advanced SubStation Alpha |
|
catkeys del Haiku |
|
Recurs de Compose Multiplatform |
|
Fitxer CSV |
|
Fitxer CSV multivalor |
|
Fitxer CSV simple |
|
Fitxer de text DokuWiki |
|
Fitxer DTD |
|
Fitxer XML pla |
|
Fitxer Fluent |
|
Fitxer JSON de Format.JS |
|
Fitxer JSON de go-i18n v1 |
|
Fitxer JSON de go-i18n v2 |
|
Fitxer TOML de go-i18n |
|
Fitxer JSON de gotext |
|
Propietats de GWT |
|
Fitxer HTML |
|
Fitxer JSON i18next v3 |
|
Fitxer JSON i18next v4 |
|
Fitxer IDML |
|
Fitxer INI |
|
Fitxer INI de l’Inno Setup |
|
Fitxer de llengua del Joomla |
|
Fitxer JSON |
|
Fitxer JSON d’estructura imbricada |
|
Cadenes de PHP de Laravel |
|
Fitxer Markdown |
|
Fitxer MDX |
|
Fitxer de text MediaWiki |
|
Fitxer lang de @draggable/i18n |
|
Recurs de Kotlin per a mòbils |
|
Fitxer JSON de Nextcloud |
|
Fitxer OpenDocument |
|
Cadenes de PHP |
|
Fitxer PO del gettext |
|
Fitxer PO del gettext (monolingüe) |
|
XLIFF 1.2 amb extensions gettext |
|
Propietats de Java |
|
Fitxer RC |
|
Fitxer RESJSON |
|
Fitxer ResourceDictionary |
|
Fitxer de recursos de .NET |
|
Fitxer YAML de Ruby |
|
Fitxer de subtítols del SubRip |
|
Fitxer de subtítols SubStation Alpha |
|
Cadenes de l’iOS |
|
Fitxer Stringsdict |
|
Fitxer de subtítols MicroDVD |
|
Fitxer TermBase eXchange |
|
Fitxer TOML |
|
Fitxer de traducció del Qt Linguist (versió 2) |
|
Fitxer de traducció del Qt Linguist (versió 1) |
|
Fitxer de text net |
|
Fitxer JSON de WebExtension |
|
Fitxer WixLocalization |
|
Fitxer de traducció XLIFF 1.2 |
|
Fitxer de traducció XLIFF 2.0 |
|
Open XML de l’Excel |
|
Pàgina completa de XWiki |
|
XWiki Java Properties |
|
XWiki Page Properties |
|
Fitxer YAML |
Esdeveniments de canvi que s’activaran¶
|
Esdeveniments del contingut de la traducció |
|
Tots els esdeveniments de canvi |
|
Esdeveniments de canvi seleccionats |
Esdeveniments de canvi seleccionats¶
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.
ID |
Identifier |
Nom |
Descripció |
|---|---|---|---|
|
|
S’ha actualitzat el recurs |
A translation file was synchronized with its repository. |
|
|
S’ha completat la traducció |
A language translation became fully translated after an individual edit. Automatic translation, uploads, and bulk edits do not emit this event. |
|
|
S’ha canviat la traducció |
An existing translation was edited by a user. |
|
|
S’ha afegit un comentari |
A comment was added to a string. |
|
|
S’ha afegit un suggeriment |
A translation suggestion was added. |
|
|
S’ha afegit una traducció |
A previously untranslated string was translated by a user. |
|
|
Traduïda de manera automatitzada |
A translation was added or changed by automatic translation. This is emitted instead of Translation added or Translation changed. |
|
|
S’ha acceptat el suggeriment |
A translation suggestion was accepted as the translation. |
|
|
S’ha revertit la traducció |
A translation was restored to an earlier value. |
|
|
S’ha pujat la traducció |
A translation was added or changed by a translation file upload. This is emitted instead of Translation added or Translation changed. |
|
|
S’ha afegit una cadena d’origen |
A source string was added outside repository or upload updates. |
|
|
S’ha blocat el component |
A component was locked for translation. |
|
|
S’ha desblocat el component |
A component was unlocked for translation. |
|
|
S’han publicat els canvis |
Pending component changes were committed. |
|
|
S’han pujat els canvis |
Repository changes were pushed upstream. |
|
|
S’ha reinicialitzat el repositori |
A repository was reset to its upstream state. |
|
|
S’ha fusionat el repositori |
Upstream repository changes were merged. |
|
|
S’ha fet «rebase» al repositori |
Repository changes were rebased on upstream. |
|
|
S’ha produït un error en fusionar el repositori |
Merging upstream repository changes failed. |
|
|
S’ha produït un error en fer «rebase» al repositori |
Rebasing repository changes failed. |
|
|
S’ha produït un error en l’anàlisi |
Weblate could not parse a translation file. |
|
|
S’ha suprimit una traducció |
A language translation was removed. |
|
|
S’ha suprimit el suggeriment |
A translation suggestion was removed. |
|
|
S’ha substituït una traducció |
A translation was changed by a search-and-replace operation. This is emitted instead of Translation changed. |
|
|
S’ha produït un error en pujar el repositori |
Pushing repository changes upstream failed. |
|
|
S’ha suprimit el suggeriment durant la neteja |
An obsolete translation suggestion was removed during cleanup. |
|
|
S’ha canviat la cadena d’origen |
A source string was edited in Weblate. |
|
|
S’ha afegit una cadena |
A new string was added in Weblate. |
|
|
S’ha canviat l’estat de manera massiva |
The translation state of one or more strings was changed in bulk. |
|
|
S’ha canviat la visibilitat |
Project or component visibility was changed. |
|
|
S’ha afegit un usuari |
A user was granted access. |
|
|
S’ha suprimit un usuari |
A user’s access was removed. |
|
|
S’ha aprovat la traducció |
A translation was approved during review. |
|
|
S’ha marcat com a «cal editar» |
A translation was marked as needing editing. |
|
|
S’ha suprimit un component |
A translation component was removed. |
|
|
S’ha suprimit un projecte |
A translation project was removed. |
|
|
S’ha canviat el nom d’un projecte |
A translation project was renamed. |
|
|
S’ha canviat el nom d’un component |
A translation component was renamed. |
|
|
S’ha mogut el component |
A component was moved within a project. |
|
|
S’ha unit un col·laborador |
A user made their first contribution to a translation. |
|
|
S’ha publicat un anunci |
An announcement was posted. |
|
|
S’ha activat una alerta |
A component alert was triggered. |
|
|
S’ha afegit una llengua |
A language translation was added. |
|
|
S’ha sol·licitat una llengua |
A user requested a new language. |
|
|
S’ha creat un projecte |
A translation project was created. |
|
|
S’ha creat un component |
A translation component was created. |
|
|
S’ha convidat un usuari |
A user was invited to a project. |
|
|
S’ha rebut una notificació del repositori |
Weblate received a repository notification from a code host. |
|
|
S’ha substituït el fitxer de la traducció per una pujada |
A translation file was replaced by an uploaded file. |
|
|
S’ha canviat la llicència |
Project or component license information changed. |
|
|
Ha canviat l’acord de llicència de col·laboració |
The contributor license agreement was changed. |
|
|
S’ha afegit una captura de pantalla |
A screenshot was associated with a string. |
|
|
S’ha pujat una captura de pantalla |
A screenshot image was uploaded. |
|
|
Cadena actualitzada al repositori |
A string was changed while synchronizing from the repository. |
|
|
S’ha instal·lat un complement |
An add-on was installed. |
|
|
S’ha canviat la configuració d’un complement |
An add-on’s configuration was changed. |
|
|
S’ha desinstal·lat un complement |
An add-on was uninstalled. |
|
|
S’ha suprimit una cadena |
A string was removed from a translation. |
|
|
S’ha suprimit un comentari |
A string comment was removed. |
|
|
S’ha resolt el comentari |
A string comment was marked as resolved. |
|
|
S’ha actualitzat l’explicació |
The explanation for a source string was updated. |
|
|
S’ha suprimit una categoria |
A component category was removed. |
|
|
S’ha canviat de nom una categoria |
A component category was renamed. |
|
|
S’ha mogut una categoria |
A component category was moved. |
|
|
S’ha produït un error en desar una cadena |
Weblate could not save a changed string. |
|
|
Cadena afegida al repositori |
A new string was found while synchronizing from the repository. |
|
|
Cadena actualitzada a la pujada |
A string was changed while processing an uploaded file. |
|
|
Cadena afegida a la pujada |
A new string was found while processing an uploaded file. |
|
|
S’ha actualitzat la traducció amb una pujada de la font |
A translation was synchronized after uploading a source file. |
|
|
S’ha completat la traducció del component |
All language translations in a component became fully translated after an individual edit. Automatic translation, uploads, and bulk edits do not emit this event. |
|
|
S’ha aplicat una comprovació obligatòria |
A translation was marked as needing editing by an enforced check. |
|
|
S’ha propagat un canvi |
A translation edit was propagated to another matching string. |
|
|
S’ha pujat un fitxer |
A file was uploaded to a translation. |
|
|
S’han actualitzat les marques extres |
Additional source-string flags were updated. |
|
|
S’ha pujat una font |
A font was uploaded. |
|
|
S’ha canviat una font |
An uploaded font was changed. |
|
|
S’ha suprimit una font |
An uploaded font was removed. |
|
|
S’ha forçat la sincronització de les traduccions |
Translation files were forcibly synchronized with the repository. |
|
|
S’ha forçat un reescaneig de les traduccions |
Translation files were forcibly rescanned for changes. |
|
|
S’ha suprimit una captura de pantalla |
A screenshot was removed. |
|
|
S’ha afegit una etiqueta |
A label was added to a string. |
|
|
S’ha suprimit una etiqueta |
A label was removed from a string. |
|
|
S’ha netejat el repositori |
The repository working tree was cleaned up. |
|
|
Source string added in the upload |
A source string was added while processing an uploaded file. |
|
|
Source string added in the repository |
A source string was added while synchronizing from the repository. |
|
|
Project backed up |
A project backup was created. |
|
|
Project restored |
A project was restored from a backup. |
|
|
Component restored |
A component was restored from a backup. |
|
|
User edit reverted |
All selected edits by a user were reverted. |
|
|
Project setting changed |
A project setting was changed. |
|
|
Component setting changed |
A component setting was changed. |
|
|
User access changed |
A user’s access permissions were changed. |
|
|
Workspace created |
A workspace was created. |
|
|
Workspace setting changed |
A workspace setting was changed. |
|
|
Project moved |
A project was moved into or out of a workspace. |
|
|
Remote repository updated |
A remote repository update was completed. |
|
|
Remote repository update failed |
Updating a remote repository failed. |
|
|
Alert dismissed |
A component alert was dismissed. |
|
|
Alert reopened |
A component alert was reopened after its context changed. |
Customizing list of add-ons¶
La llista de complements es configura mitjançant WEBLATE_ADDONS. Per afegir un altre complement, només cal incloure el nom absolut de la classe en aquesta configuració.
Writing add-on¶
També podeu escriure els vostres propis complements, crear una subclasse de weblate.addons.base.BaseAddon per definir les metadades del complement i, a continuació, implementar una devolució de trucada per fer el processament.
Vegeu també
Executing scripts from add-on¶
Els complements també es poden utilitzar per executar scripts externs. Abans s’integrava a Weblate, però ara heu d’escriure algun codi per embolicar el vostre script amb un complement.
# 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"
Per obtenir instruccions d’instal·lació, consulteu Custom quality checks, add-ons, translation services and auto-fixes.
L’script s’executa amb el directori actual establert a l’arrel del dipòsit VCS per a qualsevol component determinat.
A més, hi ha disponibles les variables d’entorn següents:
- WL_VCS¶
Sistema de control de versions utilitzat.
- WL_REPO¶
URL del repositori amunt.
- WL_PATH¶
Camí absolut al repositori VCS.
- WL_BRANCH¶
Branca del repositori configurada al component actual.
- WL_FILEMASK¶
Màscara de fitxer per al component actual.
- WL_TEMPLATE¶
Nom del fitxer de la plantilla per a traduccions monolingües (pot estar buit).
- WL_NEW_BASE¶
Nom del fitxer utilitzat per crear noves traduccions (pot estar buit).
- WL_FILE_FORMAT¶
File format used in current component.
- WL_LANGUAGE¶
Idioma de la traducció processada actualment (no disponible per a ganxos a nivell de components).
- WL_PREVIOUS_HEAD¶
HEAD anterior després de l’actualització (només disponible després d’executar el ganxo posterior a l’actualització).
- WL_COMPONENT_SLUG¶
Slug de components utilitzat per construir l’URL.
- WL_PROJECT_SLUG¶
Slug del projecte utilitzat per construir l’URL.
- WL_COMPONENT_NAME¶
Nom del component.
- WL_PROJECT_NAME¶
Nom del projecte.
- WL_COMPONENT_URL¶
URL del component.
- WL_ENGAGE_URL¶
URL d’interacció del projecte.
Vegeu també
Post-update repository processing¶
Es pot utilitzar per actualitzar fitxers de traducció quan canvia la font ascendent del VCS. Per aconseguir-ho, recordeu que Weblate només veu els fitxers compromesos amb el VCS, de manera que heu de confirmar els canvis com a part de l’script.
Per exemple, amb Gulp, podeu fer-ho utilitzant el codi següent:
#! /bin/sh
gulp --gulpfile gulp-i18n-extract.js
git commit -m 'Update source strings' src/languages/en.lang.json
Pre-commit processing of translations¶
Utilitzeu l’script de confirmació per canviar automàticament una traducció abans que es comprometi al repositori.
Es passa com un únic paràmetre que consisteix en el nom de fitxer d’una traducció actual.
Add-on activity logging¶
El registre d’activitat del complement fa un seguiment de l’execució del complement i es pot utilitzar per fer un seguiment de l’activitat del complement.
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.
Els registres es poden retallar després d’un interval de temps determinat configurant el ADDON_ACTIVITY_LOG_EXPIRY.