# Comprovacions i correccions

<a id="custom-autofix"></a>

## Correccions automàtiques personalitzades

També podeu implementar la vostra pròpia reparació automàtica a més de les estàndards i incloure-les a [`AUTOFIX_LIST`](https://docs.weblate.org/ca/latest/admin/config.md#std-setting-AUTOFIX_LIST).

Les solucions automàtiques són potents, però també poden causar danys; aneu amb compte a l’hora d’escriure’n un.

Per exemple, la següent correcció automàtica substituiria cada ocurrència de la cadena `foo` en una traducció amb `bar`:

```python
from __future__ import annotations

from typing import TYPE_CHECKING

from weblate.trans.autofixes.base import AutoFix

if TYPE_CHECKING:
    from weblate.trans.models import Unit


class ReplaceFooWithBar(AutoFix):
    """Replace foo with bar."""

    # Might be localized using gettext_lazy
    name = "Foobar"

    def fix_single_target(
        self, target: str, source: str, unit: Unit
    ) -> tuple[str, bool]:
        if "foo" in target:
            return target.replace("foo", "bar"), True
        return target, False
```

Per instal·lar comprovacions personalitzades, proporcioneu un camí completament qualificat a la classe Python a [`AUTOFIX_LIST`](https://docs.weblate.org/ca/latest/admin/config.md#std-setting-AUTOFIX_LIST), vegeu [Custom quality checks, add-ons, automatic suggestions and auto-fixes](https://docs.weblate.org/ca/latest/admin/customize.md#custom-check-modules).

<a id="custom-checks"></a>

## Personalització del comportament mitjançant banderes

Podeu afinar el comportament de Weblate utilitzant banderes. Les banderes proporcionen comentaris visuals als traductors i els ajuden a millorar la seva traducció. Les banderes es combinen a partir de les fonts següents:

* Source string additional flags:
  * [Informació addicional sobre les cadenes d’origen](https://docs.weblate.org/ca/latest/admin/translating.md#additional) describes manual editing.
  * [Edició massiva](https://docs.weblate.org/ca/latest/user/translating.md#bulk-edit) es pot utilitzar per aplicar senyals per lots.
  * El complement [Edició massiva](https://docs.weblate.org/ca/latest/admin/addons.md#addon-weblate-flags-bulk) pot aplicar senyals automàticament.
* Senyals per cadena extretes del format de fitxer, vegeu [Localization file formats](https://docs.weblate.org/ca/latest/formats.md#formats).
* Senyals de traducció (actualment només el senyalador `només de lectura` per a la cadena d’origen bilingüe o quan l’edició de plantilles monolingües està desactivada).
* Banderes específiques de format de fitxer.
* [Configuració dels components](https://docs.weblate.org/ca/latest/admin/projects.md#component) ([Marques de traducció](https://docs.weblate.org/ca/latest/admin/projects.md#component-check-flags)).
* [Configuració del projecte](https://docs.weblate.org/ca/latest/admin/projects.md#project) ([Marques de traducció](https://docs.weblate.org/ca/latest/admin/projects.md#project-check-flags)).

Les banderes estan separades per comes; si tenen paràmetres, es separen amb dos punts. Podeu utilitzar cometes per incloure espais en blanc o caràcters especials a la cadena. Per exemple:

```text
placeholders:"special:value":"other value", regex:.*
```

S’accepten cometes simples i dobles, els caràcters especials s’escaparan mitjançant la barra invertida:

```text
placeholders:"quoted \"string\"":'single \'quoted\''
```

```text
placeholders:r"^#*"
```

Per verificar que els traductors no canvien l’encapçalament d’un document Markdown. S’activarà una comprovació fallida si la cadena `### Index` es tradueix com a `# Índex`.

```text
placeholders:r"\]\([^h].*?\)"
```

Per garantir que els enllaços interns no es tradueixin (és a dir, [test](../checks) no es converteixi en [test](../chequeos).

The flags defined on a higher level can be discarded using the
`discard:NAME` syntax. For example, if a component is configured to
`safe-html`, you can add `discard:safe-html` to the string flags to skip it
for this particular string. Translation flags cannot discard an explicit
`read-only` flag set on the source string.

Aquí teniu una llista de banderes acceptades actualment:

`read-only`
: The string is read-only and should not be edited in Weblate, see [Cadenes de només lectura](https://docs.weblate.org/ca/latest/formats.md#read-only-strings).

`terminology`
: Used in [Glossari](https://docs.weblate.org/ca/latest/user/glossary.md#glossary). Copies the string into all glossary languages so it can be used consistently in all translations. Also useful in combination with `read-only`, for example in product names.

`priority:N`
: Prioritat de la cadena. Les cadenes de prioritat més alta es presenten primer per a la traducció. La prioritat per defecte és 100, com més alta tingui una cadena, més aviat s’ofereix per a la traducció.

`xml-text`
: Tracta el text com a document XML, afecta [Sintaxi XML](https://docs.weblate.org/ca/latest/user/checks.md#check-xml-invalid) i [Marcatge XML](https://docs.weblate.org/ca/latest/user/checks.md#check-xml-tags).

`font-family:NAME`
: Definiu la família de fonts per a les comprovacions de representació, vegeu [Gestió de tipus de lletra](#fonts).

`font-weight:WEIGHT`
: Definiu el pes de la font per a les comprovacions de representació, vegeu [Gestió de tipus de lletra](#fonts).

`font-size:SIZE`
: Definiu la mida del tipus de lletra per a les comprovacions de representació, vegeu [Gestió de tipus de lletra](#fonts).

`font-spacing:SPACING`
: Definiu l’espaiat entre lletres per a comprovacions de representació, vegeu [Gestió de tipus de lletra](#fonts).

`font-monospace`
: Display the string in the translation editor using a monospace font.
  Unlike the `font-family`/`font-size`/`font-weight`/`font-spacing`
  flags, this does not affect rendering checks and never loads an uploaded
  font; it only switches the editor to the browser’s built-in monospace
  font stack.

`icu-flags:FLAGS`
: Define flags for customizing the behavior of the [MessageFormat d’ICU](https://docs.weblate.org/ca/latest/user/checks.md#check-icu-message-format) quality check.

`icu-tag-prefix:PREFIX`
: Set a required prefix for XML tags for the [MessageFormat d’ICU](https://docs.weblate.org/ca/latest/user/checks.md#check-icu-message-format) quality check.

`placeholders:NAME:NAME2:...`
: S’esperen cadenes de marcador de posició a la traducció, vegeu [Marcadors de substitució](https://docs.weblate.org/ca/latest/user/checks.md#check-placeholders).

`replacements:FROM:TO:FROM2:TO2...`
: Reemplaçaments a realitzar en comprovar els paràmetres de text resultants (per exemple a [Mida màxima de la traducció](https://docs.weblate.org/ca/latest/user/checks.md#check-max-size) o [Longitud màxima de la traducció](https://docs.weblate.org/ca/latest/user/checks.md#check-max-length)). El cas d’ús típic d’això és ampliar els elements ubicables per assegurar-se que el text s’ajusta fins i tot amb valors llargs, per exemple: `replacements:%s:"John Doe"`.

`variants:SOURCE`
: Marqueu aquesta cadena com una variant de cadena amb la font coincident. Vegeu [Variants de corda](https://docs.weblate.org/ca/latest/devel/translations.md#variants).

`regex:REGEX`
: Regular expression to match translation, see [Expressió regular](https://docs.weblate.org/ca/latest/user/checks.md#check-regex).

`discard:NAME`
: Descarta la bandera definida en un nivell superior.

`forbidden`
: Indica la traducció prohibida en un glossari, vegeu [Forbidden translations](https://docs.weblate.org/ca/latest/user/glossary.md#glossary-forbidden).

`strict-same`
: Feu que [Traducció no modificada](https://docs.weblate.org/ca/latest/user/checks.md#check-same) eviteu utilitzar les excepcions de paraules incorporades.

`strict-format`
: Feu que les comprovacions de format s’apliquin utilitzant format fins i tot per a formes plurals amb un sol valor, vegeu [Cordes formatades](https://docs.weblate.org/ca/latest/user/checks.md#check-formats).

`case-insensitive`
: Ajusteu el comportament de les comprovacions perquè no distingeixi entre majúscules i minúscules. Actualment només afecta la comprovació de qualitat de [Marcadors de substitució](https://docs.weblate.org/ca/latest/user/checks.md#check-placeholders).

<!-- AUTOGENERATED START: check-flags-enables -->
<!-- This section is automatically generated by `./manage.py list_checks`. Do not edit manually. -->

`accelerator`
: Specify the single punctuation accelerator marker, for example `accelerator:&`, `accelerator:_`, or `accelerator:~`.
  Enables the [Accelerator key](https://docs.weblate.org/ca/latest/user/checks.md#check-accelerator) quality check.

`asciidoc-text`
: Treat a text as an AsciiDoc document, affects [Traducció no modificada](https://docs.weblate.org/ca/latest/user/checks.md#check-same).
  Enables the [AsciiDoc markup](https://docs.weblate.org/ca/latest/user/checks.md#check-asciidoc-markup) quality check.

`bbcode-text`
: Tracta un text com un document de codi de tauler d’anuncis (BBCode), afecta [Traducció no modificada](https://docs.weblate.org/ca/latest/user/checks.md#check-same). Habilita la comprovació de qualitat [Sintaxi de BBCode](https://docs.weblate.org/ca/latest/user/checks.md#check-bbcode).

`check-glossary`
: Enables the [No s’ajusta al glossari](https://docs.weblate.org/ca/latest/user/checks.md#check-check-glossary) quality check.

`fluent-parts`
: Enables the [Parts de Fluent](https://docs.weblate.org/ca/latest/user/checks.md#check-fluent-parts) quality check.

`fluent-references`
: Enables the [Referències de Fluent](https://docs.weblate.org/ca/latest/user/checks.md#check-fluent-references) quality check.

`fluent-target-inner-html`
: Enables the [HTML interior de la traducció de Fluent](https://docs.weblate.org/ca/latest/user/checks.md#check-fluent-target-inner-html) quality check.

`fluent-target-syntax`
: Enables the [Sintaxi de la traducció de Fluent](https://docs.weblate.org/ca/latest/user/checks.md#check-fluent-target-syntax) quality check.

`angularjs-format`
: Enables the [Cadena d’interpolació d’AngularJS](https://docs.weblate.org/ca/latest/user/checks.md#check-angularjs-format) quality check.

`automattic-components-format`
: Enables the [Formatació de components d’Automattic](https://docs.weblate.org/ca/latest/user/checks.md#check-automattic-components-format) quality check.

`c-format`
: Enables the [Format C](https://docs.weblate.org/ca/latest/user/checks.md#check-c-format) quality check.

`c-sharp-format`
: Enables the [Format C#](https://docs.weblate.org/ca/latest/user/checks.md#check-c-sharp-format) quality check.

`csharp-format`
: Enables the [Format C#](https://docs.weblate.org/ca/latest/user/checks.md#check-c-sharp-format) quality check.

`es-format`
: Enables the [Literals de la plantilla ECMAScript](https://docs.weblate.org/ca/latest/user/checks.md#check-es-format) quality check.

`i18next-interpolation`
: Enables the [Interpolació d’i18next](https://docs.weblate.org/ca/latest/user/checks.md#check-i18next-interpolation) quality check.

`icu-message-format`
: Enables the [MessageFormat d’ICU](https://docs.weblate.org/ca/latest/user/checks.md#check-icu-message-format) and [Sintaxi MessageFormat d’ICU](https://docs.weblate.org/ca/latest/user/checks.md#check-icu-message-format-syntax) quality checks.

`java-printf-format`
: Enables the [Format Java](https://docs.weblate.org/ca/latest/user/checks.md#check-java-printf-format) quality check.

`java-format`
: Enables the [MessageFormat de Java](https://docs.weblate.org/ca/latest/user/checks.md#check-java-format) quality check.

`auto-java-messageformat`
: Tracteu un text com a Java MessageFormat condicional, habilitant [MessageFormat de Java](https://docs.weblate.org/ca/latest/user/checks.md#check-java-format) només quan la font conté marcadors de posició Java MessageFormat. Habilita la comprovació de qualitat [MessageFormat de Java](https://docs.weblate.org/ca/latest/user/checks.md#check-java-format).

`javascript-format`
: Enables the [Format JavaScript](https://docs.weblate.org/ca/latest/user/checks.md#check-javascript-format) quality check.

`laravel-format`
: Enables the [Format Laravel](https://docs.weblate.org/ca/latest/user/checks.md#check-laravel-format) quality check.

`lua-format`
: Enables the [Format Lua](https://docs.weblate.org/ca/latest/user/checks.md#check-lua-format) quality check.

`object-pascal-format`
: Enables the [Format d’Object Pascal](https://docs.weblate.org/ca/latest/user/checks.md#check-object-pascal-format) quality check.

`objc-format`
: Enables the [Objective-C format](https://docs.weblate.org/ca/latest/user/checks.md#check-objc-format) quality check.

`percent-placeholders`
: Enables the [Marcadors de substitució de percentatge](https://docs.weblate.org/ca/latest/user/checks.md#check-percent-placeholders) quality check.

`perl-brace-format`
: Enables the [Format de claus del Perl](https://docs.weblate.org/ca/latest/user/checks.md#check-perl-brace-format) quality check.

`perl-format`
: Enables the [Format Perl](https://docs.weblate.org/ca/latest/user/checks.md#check-perl-format) quality check.

`php-format`
: Enables the [Format PHP](https://docs.weblate.org/ca/latest/user/checks.md#check-php-format) quality check.

`python-brace-format`
: Enables the [Format de claus del Python](https://docs.weblate.org/ca/latest/user/checks.md#check-python-brace-format) quality check.

`python-format`
: Enables the [Format Python](https://docs.weblate.org/ca/latest/user/checks.md#check-python-format) quality check.

`qt-format`
: Enables the [Format Qt](https://docs.weblate.org/ca/latest/user/checks.md#check-qt-format) quality check.

`qt-plural-format`
: Enables the [Format de plurals de Qt](https://docs.weblate.org/ca/latest/user/checks.md#check-qt-plural-format) quality check.

`ruby-format`
: Enables the [Format Ruby](https://docs.weblate.org/ca/latest/user/checks.md#check-ruby-format) quality check.

`scheme-format`
: Enables the [Format Scheme](https://docs.weblate.org/ca/latest/user/checks.md#check-scheme-format) quality check.

`vue-format`
: Enables the [Formatació l18n de Vue](https://docs.weblate.org/ca/latest/user/checks.md#check-vue-format) quality check.

`rst-text`
: Tracta un text com un document reStructuredText, afecta [Traducció no modificada](https://docs.weblate.org/ca/latest/user/checks.md#check-same). Habilita les comprovacions de qualitat [reStructuredText inconsistent](https://docs.weblate.org/ca/latest/user/checks.md#check-rst-references) i [Error de sintaxi de reStructuredText](https://docs.weblate.org/ca/latest/user/checks.md#check-rst-syntax).

`md-text`
: Tracteu un text com un document de Markdown i proporcioneu un ressaltat de sintaxi de Markdown a l’àrea de text de traducció. Habilita les comprovacions de qualitat [Enllaços Markdown](https://docs.weblate.org/ca/latest/user/checks.md#check-md-link), [Referències de Markdown](https://docs.weblate.org/ca/latest/user/checks.md#check-md-reflink) i [Sintaxi Markdown](https://docs.weblate.org/ca/latest/user/checks.md#check-md-syntax).

`max-length`
: Enables the [Longitud màxima de la traducció](https://docs.weblate.org/ca/latest/user/checks.md#check-max-length) quality check.

`max-lines`
: Enables the [Maximum number of lines](https://docs.weblate.org/ca/latest/user/checks.md#check-max-lines) quality check.

`max-size`
: Enables the [Mida màxima de la traducció](https://docs.weblate.org/ca/latest/user/checks.md#check-max-size) quality check.

`placeholders`
: Enables the [Marcadors de substitució](https://docs.weblate.org/ca/latest/user/checks.md#check-placeholders) quality check.

`regex`
: Enables the [Expressió regular](https://docs.weblate.org/ca/latest/user/checks.md#check-regex) quality check.

`safe-mdx`
: Enables the [Safe MDX](https://docs.weblate.org/ca/latest/user/checks.md#check-safe-mdx) quality check.

`safe-html`
: Enables the [HTML insegur](https://docs.weblate.org/ca/latest/user/checks.md#check-safe-html) quality check.

`auto-safe-html`
: Tracteu un text com a HTML condicional, activant [HTML insegur](https://docs.weblate.org/ca/latest/user/checks.md#check-safe-html) només per a text sense format o cadenes d’origen que continguin un marcatge HTML estàndard o elements personalitzats vàlids. Això és útil per a variants de Markdown esteses, com ara MDX, on la sintaxi entre claudàtors no és HTML. Habilita la comprovació de qualitat [HTML insegur](https://docs.weblate.org/ca/latest/user/checks.md#check-safe-html).

`url`
: The string should consist of only a URL.
  Enables the [URL](https://docs.weblate.org/ca/latest/user/checks.md#check-url) quality check.

`fluent-source-inner-html`
: Enables the [HTML interior de l’origen Fluent](https://docs.weblate.org/ca/latest/user/checks.md#check-fluent-source-inner-html) quality check.

`fluent-source-syntax`
: Enables the [Sintaxi de l’origen de Fluent](https://docs.weblate.org/ca/latest/user/checks.md#check-fluent-source-syntax) quality check.

<!-- AUTOGENERATED END: check-flags-enables -->

`ignore-all-checks`
: Ignore all quality checks.

<!-- AUTOGENERATED START: check-flags-ignores -->
<!-- This section is automatically generated by `./manage.py list_checks`. Do not edit manually. -->

`ignore-accelerator`
: Skip the [Accelerator key](https://docs.weblate.org/ca/latest/user/checks.md#check-accelerator) quality check.

`ignore-ai-accuracy`
: Skip the [AI: Accuracy](https://docs.weblate.org/ca/latest/user/checks.md#check-ai-accuracy) quality check.

`ignore-ai-fluency`
: Skip the [AI: Fluency](https://docs.weblate.org/ca/latest/user/checks.md#check-ai-fluency) quality check.

`ignore-ai-formatting`
: Skip the [AI: Formatting](https://docs.weblate.org/ca/latest/user/checks.md#check-ai-formatting) quality check.

`ignore-ai-style`
: Skip the [AI: Style](https://docs.weblate.org/ca/latest/user/checks.md#check-ai-style) quality check.

`ignore-ai-terminology`
: Skip the [AI: Terminology](https://docs.weblate.org/ca/latest/user/checks.md#check-ai-terminology) quality check.

`ignore-asciidoc-markup`
: Skip the [AsciiDoc markup](https://docs.weblate.org/ca/latest/user/checks.md#check-asciidoc-markup) quality check.

`ignore-bbcode`
: Skip the [Sintaxi de BBCode](https://docs.weblate.org/ca/latest/user/checks.md#check-bbcode) quality check.

`ignore-xml-chars-around-tags`
: Skip the [Caràcters al voltant de les etiquetes XML](https://docs.weblate.org/ca/latest/user/checks.md#check-xml-chars-around-tags) quality check.

`ignore-duplicate`
: Skip the [Paraules duplicades consecutives](https://docs.weblate.org/ca/latest/user/checks.md#check-duplicate) quality check.

`ignore-check-glossary`
: Skip the [No s’ajusta al glossari](https://docs.weblate.org/ca/latest/user/checks.md#check-check-glossary) quality check.

`ignore-double-space`
: Skip the [Espai doble](https://docs.weblate.org/ca/latest/user/checks.md#check-double-space) quality check.

`ignore-fluent-parts`
: Skip the [Parts de Fluent](https://docs.weblate.org/ca/latest/user/checks.md#check-fluent-parts) quality check.

`ignore-fluent-references`
: Skip the [Referències de Fluent](https://docs.weblate.org/ca/latest/user/checks.md#check-fluent-references) quality check.

`ignore-fluent-target-inner-html`
: Skip the [HTML interior de la traducció de Fluent](https://docs.weblate.org/ca/latest/user/checks.md#check-fluent-target-inner-html) quality check.

`ignore-fluent-target-syntax`
: Skip the [Sintaxi de la traducció de Fluent](https://docs.weblate.org/ca/latest/user/checks.md#check-fluent-target-syntax) quality check.

`ignore-angularjs-format`
: Skip the [Cadena d’interpolació d’AngularJS](https://docs.weblate.org/ca/latest/user/checks.md#check-angularjs-format) quality check.

`ignore-automattic-components-format`
: Skip the [Formatació de components d’Automattic](https://docs.weblate.org/ca/latest/user/checks.md#check-automattic-components-format) quality check.

`ignore-c-format`
: Skip the [Format C](https://docs.weblate.org/ca/latest/user/checks.md#check-c-format) quality check.

`ignore-c-sharp-format`
: Skip the [Format C#](https://docs.weblate.org/ca/latest/user/checks.md#check-c-sharp-format) quality check.

`ignore-es-format`
: Skip the [Literals de la plantilla ECMAScript](https://docs.weblate.org/ca/latest/user/checks.md#check-es-format) quality check.

`ignore-i18next-interpolation`
: Skip the [Interpolació d’i18next](https://docs.weblate.org/ca/latest/user/checks.md#check-i18next-interpolation) quality check.

`ignore-icu-message-format`
: Skip the [MessageFormat d’ICU](https://docs.weblate.org/ca/latest/user/checks.md#check-icu-message-format) quality check.

`ignore-java-printf-format`
: Skip the [Format Java](https://docs.weblate.org/ca/latest/user/checks.md#check-java-printf-format) quality check.

`ignore-java-format`
: Skip the [MessageFormat de Java](https://docs.weblate.org/ca/latest/user/checks.md#check-java-format) quality check.

`ignore-javascript-format`
: Skip the [Format JavaScript](https://docs.weblate.org/ca/latest/user/checks.md#check-javascript-format) quality check.

`ignore-laravel-format`
: Skip the [Format Laravel](https://docs.weblate.org/ca/latest/user/checks.md#check-laravel-format) quality check.

`ignore-lua-format`
: Skip the [Format Lua](https://docs.weblate.org/ca/latest/user/checks.md#check-lua-format) quality check.

`ignore-object-pascal-format`
: Skip the [Format d’Object Pascal](https://docs.weblate.org/ca/latest/user/checks.md#check-object-pascal-format) quality check.

`ignore-objc-format`
: Skip the [Objective-C format](https://docs.weblate.org/ca/latest/user/checks.md#check-objc-format) quality check.

`ignore-percent-placeholders`
: Skip the [Marcadors de substitució de percentatge](https://docs.weblate.org/ca/latest/user/checks.md#check-percent-placeholders) quality check.

`ignore-perl-brace-format`
: Skip the [Format de claus del Perl](https://docs.weblate.org/ca/latest/user/checks.md#check-perl-brace-format) quality check.

`ignore-perl-format`
: Skip the [Format Perl](https://docs.weblate.org/ca/latest/user/checks.md#check-perl-format) quality check.

`ignore-php-format`
: Skip the [Format PHP](https://docs.weblate.org/ca/latest/user/checks.md#check-php-format) quality check.

`ignore-python-brace-format`
: Skip the [Format de claus del Python](https://docs.weblate.org/ca/latest/user/checks.md#check-python-brace-format) quality check.

`ignore-python-format`
: Skip the [Format Python](https://docs.weblate.org/ca/latest/user/checks.md#check-python-format) quality check.

`ignore-qt-format`
: Skip the [Format Qt](https://docs.weblate.org/ca/latest/user/checks.md#check-qt-format) quality check.

`ignore-qt-plural-format`
: Skip the [Format de plurals de Qt](https://docs.weblate.org/ca/latest/user/checks.md#check-qt-plural-format) quality check.

`ignore-ruby-format`
: Skip the [Format Ruby](https://docs.weblate.org/ca/latest/user/checks.md#check-ruby-format) quality check.

`ignore-scheme-format`
: Skip the [Format Scheme](https://docs.weblate.org/ca/latest/user/checks.md#check-scheme-format) quality check.

`ignore-vue-format`
: Skip the [Formatació l18n de Vue](https://docs.weblate.org/ca/latest/user/checks.md#check-vue-format) quality check.

`ignore-translated`
: Skip the [S’ha traduït](https://docs.weblate.org/ca/latest/user/checks.md#check-translated) quality check.

`ignore-inconsistent`
: Skip the [Inconsistent](https://docs.weblate.org/ca/latest/user/checks.md#check-inconsistent) quality check.

`ignore-rst-references`
: Skip the [reStructuredText inconsistent](https://docs.weblate.org/ca/latest/user/checks.md#check-rst-references) quality check.

`ignore-kashida`
: Skip the [S’ha utilitzat kashida](https://docs.weblate.org/ca/latest/user/checks.md#check-kashida) quality check.

`ignore-md-link`
: Skip the [Enllaços Markdown](https://docs.weblate.org/ca/latest/user/checks.md#check-md-link) quality check.

`ignore-md-reflink`
: Skip the [Referències de Markdown](https://docs.weblate.org/ca/latest/user/checks.md#check-md-reflink) quality check.

`ignore-md-syntax`
: Skip the [Sintaxi Markdown](https://docs.weblate.org/ca/latest/user/checks.md#check-md-syntax) quality check.

`ignore-max-length`
: Skip the [Longitud màxima de la traducció](https://docs.weblate.org/ca/latest/user/checks.md#check-max-length) quality check.

`ignore-max-lines`
: Skip the [Maximum number of lines](https://docs.weblate.org/ca/latest/user/checks.md#check-max-lines) quality check.

`ignore-max-size`
: Skip the [Mida màxima de la traducció](https://docs.weblate.org/ca/latest/user/checks.md#check-max-size) quality check.

`ignore-escaped-newline`
: Skip the [Mismatched \\n](https://docs.weblate.org/ca/latest/user/checks.md#check-escaped-newline) quality check.

`ignore-end-colon`
: Skip the [Dos punts no coincidents](https://docs.weblate.org/ca/latest/user/checks.md#check-end-colon) quality check.

`ignore-end-ellipsis`
: Skip the [Punts suspensius no coincidents](https://docs.weblate.org/ca/latest/user/checks.md#check-end-ellipsis) quality check.

`ignore-end-exclamation`
: Skip the [Signe d’exclamació no coincident](https://docs.weblate.org/ca/latest/user/checks.md#check-end-exclamation) quality check.

`ignore-end-stop`
: Skip the [Punt no coincident](https://docs.weblate.org/ca/latest/user/checks.md#check-end-stop) quality check.

`ignore-end-interrobang`
: Skip the [Interrobang no coincident](https://docs.weblate.org/ca/latest/user/checks.md#check-end-interrobang) quality check.

`ignore-end-question`
: Skip the [Signe d’interrogació no coincident](https://docs.weblate.org/ca/latest/user/checks.md#check-end-question) quality check.

`ignore-end-semicolon`
: Skip the [Punt i coma no coincident](https://docs.weblate.org/ca/latest/user/checks.md#check-end-semicolon) quality check.

`ignore-newline-count`
: Skip the [Salts de línia no coincidents](https://docs.weblate.org/ca/latest/user/checks.md#check-newline-count) quality check.

`ignore-plurals`
: Skip the [Manquen plurals](https://docs.weblate.org/ca/latest/user/checks.md#check-plurals) quality check.

`ignore-multiple-capital`
: Skip the [Multiple capitals](https://docs.weblate.org/ca/latest/user/checks.md#check-multiple-capital) quality check.

`ignore-kabyle-characters`
: Skip the [Caràcters no estàndard en cabilenc](https://docs.weblate.org/ca/latest/user/checks.md#check-kabyle-characters) quality check.

`ignore-placeholders`
: Skip the [Marcadors de substitució](https://docs.weblate.org/ca/latest/user/checks.md#check-placeholders) quality check.

`ignore-prohibited-initial-character`
: Skip the [Caràcter inicial prohibit](https://docs.weblate.org/ca/latest/user/checks.md#check-prohibited-initial-character) quality check.

`ignore-punctuation-spacing`
: Skip the [Espaiat de la puntuació](https://docs.weblate.org/ca/latest/user/checks.md#check-punctuation-spacing) quality check.

`ignore-regex`
: Skip the [Expressió regular](https://docs.weblate.org/ca/latest/user/checks.md#check-regex) quality check.

`ignore-rst-syntax`
: Skip the [Error de sintaxi de reStructuredText](https://docs.weblate.org/ca/latest/user/checks.md#check-rst-syntax) quality check.

`ignore-reused`
: Skip the [Traducció reutilitzada](https://docs.weblate.org/ca/latest/user/checks.md#check-reused) quality check.

`ignore-safe-mdx`
: Skip the [Safe MDX](https://docs.weblate.org/ca/latest/user/checks.md#check-safe-mdx) quality check.

`ignore-same-plurals`
: Skip the [Plurals idèntics](https://docs.weblate.org/ca/latest/user/checks.md#check-same-plurals) quality check.

`ignore-begin-newline`
: Skip the [Salt de línia inicial](https://docs.weblate.org/ca/latest/user/checks.md#check-begin-newline) quality check.

`ignore-begin-space`
: Skip the [Espais inicials](https://docs.weblate.org/ca/latest/user/checks.md#check-begin-space) quality check.

`ignore-end-newline`
: Skip the [Salt de línia final](https://docs.weblate.org/ca/latest/user/checks.md#check-end-newline) quality check.

`ignore-end-space`
: Skip the [Espai al final](https://docs.weblate.org/ca/latest/user/checks.md#check-end-space) quality check.

`ignore-same`
: Skip the [Traducció no modificada](https://docs.weblate.org/ca/latest/user/checks.md#check-same) quality check.

`ignore-safe-html`
: Skip the [HTML insegur](https://docs.weblate.org/ca/latest/user/checks.md#check-safe-html) quality check.

`ignore-url`
: Skip the [URL](https://docs.weblate.org/ca/latest/user/checks.md#check-url) quality check.

`ignore-xml-tags`
: Skip the [Marcatge XML](https://docs.weblate.org/ca/latest/user/checks.md#check-xml-tags) quality check.

`ignore-xml-invalid`
: Skip the [Sintaxi XML](https://docs.weblate.org/ca/latest/user/checks.md#check-xml-invalid) quality check.

`ignore-zero-width-space`
: Skip the [Espai d’amplada zero](https://docs.weblate.org/ca/latest/user/checks.md#check-zero-width-space) quality check.

`ignore-ellipsis`
: Skip the [Punts suspensius](https://docs.weblate.org/ca/latest/user/checks.md#check-ellipsis) quality check.

`ignore-fluent-source-inner-html`
: Skip the [HTML interior de l’origen Fluent](https://docs.weblate.org/ca/latest/user/checks.md#check-fluent-source-inner-html) quality check.

`ignore-fluent-source-syntax`
: Skip the [Sintaxi de l’origen de Fluent](https://docs.weblate.org/ca/latest/user/checks.md#check-fluent-source-syntax) quality check.

`ignore-icu-message-format`
: Skip the [Sintaxi MessageFormat d’ICU](https://docs.weblate.org/ca/latest/user/checks.md#check-icu-message-format-syntax) quality check.

`ignore-long-untranslated`
: Skip the [No traduïda de fa molt de temps](https://docs.weblate.org/ca/latest/user/checks.md#check-long-untranslated) quality check.

`ignore-multiple-failures`
: Skip the [Diverses comprovacions fallides](https://docs.weblate.org/ca/latest/user/checks.md#check-multiple-failures) quality check.

`ignore-unnamed-format`
: Skip the [Múltiples variables sense nom](https://docs.weblate.org/ca/latest/user/checks.md#check-unnamed-format) quality check.

`ignore-source-max-length`
: Skip the [Longitud de la cadena d’origen](https://docs.weblate.org/ca/latest/user/checks.md#check-source-max-length) quality check.

`ignore-optional-plural`
: Skip the [No pluralitzada](https://docs.weblate.org/ca/latest/user/checks.md#check-optional-plural) quality check.

<!-- AUTOGENERATED END: check-flags-ignores -->

#### NOTE
Generalment, la regla s’anomena `ignore-*` per a qualsevol comprovació, utilitzant el seu identificador, de manera que podeu utilitzar-la fins i tot per a les vostres comprovacions personalitzades.

Aquests senyaladors s’entenen tant en la configuració de [Configuració dels components](https://docs.weblate.org/ca/latest/admin/projects.md#component), per la configuració de la cadena d’origen i en el propi fitxer de traducció (per exemple, a GNU gettext).

<a id="location-based-flags"></a>

## Location-based flags

Algunes marques s’afegeixen a les cadenes de manera predeterminada, en funció de les seves ubicacions. Això vol dir que determinades comprovacions s’habilitaran automàticament en funció d’on s’utilitzi la cadena.

* `rst-text`: aquesta marca s’afegeix automàticament a les cadenes dels fitxers reStructuredText, si l’extensió d’ubicació és `.rst`.
* `md-text`: aquesta marca s’afegeix automàticament a les cadenes dels fitxers Markdown i MDX, si l’extensió d’ubicació és `.md`, `.markdown` o `.mdx`.

<a id="enforcing-checks"></a>

## Execució de controls

Les comprovacions aplicades no es poden descartar i marcar la cadena com a Necessita edició (vegeu [Estats de traducció](https://docs.weblate.org/ca/latest/workflows.md#states)). Això evita que els traductors ocultin aquestes comprovacions.

#### HINT
Turning on check enforcing doesn’t enable it automatically. Some checks have
to be turned on by adding the corresponding flag to the string or component
flags.

Això s’utilitza millor amb comprovacions que poden causar problemes greus quan s’utilitzen com ara comprovacions per a [Cordes formatades](https://docs.weblate.org/ca/latest/user/checks.md#check-formats). No es recomana utilitzar per a comprovacions d’estil com [Traducció no modificada](https://docs.weblate.org/ca/latest/user/checks.md#check-same) perquè de vegades l’acomiadament és un enfocament raonable en aquestes.

Aleshores, el [Filtre de qualitat de les traduccions](https://docs.weblate.org/ca/latest/admin/projects.md#project-commit-policy) es pot utilitzar per excloure que les cadenes que necessiten editar-se es comprometin amb el control de versions.

#### SEE ALSO
* [Estats de traducció](https://docs.weblate.org/ca/latest/workflows.md#states)
* [Comprovacions obligatòries](https://docs.weblate.org/ca/latest/admin/projects.md#component-enforced-checks)
* [Filtre de qualitat de les traduccions](https://docs.weblate.org/ca/latest/admin/projects.md#project-commit-policy)
* [Informació addicional sobre les cadenes d’origen](https://docs.weblate.org/ca/latest/admin/translating.md#additional)
* [Marques de traducció](https://docs.weblate.org/ca/latest/admin/projects.md#component-check-flags)

<a id="fonts"></a>

## Gestió de tipus de lletra

#### HINT
Els tipus de lletra penjats a Weblate s’utilitzen únicament per a la comprovació [Mida màxima de la traducció](https://docs.weblate.org/ca/latest/user/checks.md#check-max-size), no tenen cap efecte a la interfície d’usuari de Weblate.

La comprovació [Mida màxima de la traducció](https://docs.weblate.org/ca/latest/user/checks.md#check-max-size) que s’utilitza per calcular les dimensions del text representat ha de carregar el tipus de lletra a Weblate i seleccionar-lo mitjançant un senyalador de traducció (vegeu [Personalització del comportament mitjançant banderes](#custom-checks)).

L’eina de gestió de fonts del Weblate a Fonts al menú Operacions del vostre projecte de traducció ofereix una interfície per carregar i gestionar tipus de lletra. Els tipus de lletra TrueType o OpenType es poden carregar, configurar grups de fonts i utilitzar-los a la comprovació.

Els grups de fonts us permeten definir diferents tipus de lletra per a diferents idiomes, que normalment es necessita per a idiomes no llatins:

![image](screenshots/font-group-edit.webp)

Els grups de fonts s’identifiquen pel nom, que no pot contenir espais en blanc ni caràcters especials, de manera que es pot utilitzar fàcilment en la definició de comprovació:

![image](screenshots/font-group-list.webp)

La família de tipus de lletra i l’estil es reconeixen automàticament després de penjar-los:

![image](screenshots/font-edit.webp)

Podeu carregar diversos tipus de lletra a Weblate:

![image](screenshots/font-list.webp)

Per utilitzar els tipus de lletra per comprovar la longitud de la cadena, passeu-li els senyaladors adequats (vegeu [Personalització del comportament mitjançant banderes](#custom-checks)). Probablement necessitareu els següents:

`mida màxima: 500` / `mida màxima: 300:5`
: Defines maximal width in pixels and, optionally, the maximum number of lines. Word wrapping is applied when more than one line is configured.

`font-family:ubuntu`
: Defineix el grup de fonts que s’utilitzarà especificant el seu identificador.

`font-size:22`
: Defineix la mida de la lletra en píxels.

<a id="own-checks"></a>

## Redacció de xecs propis

Hi ha una àmplia gamma de controls de qualitat incorporats (vegeu [Controls de qualitat](https://docs.weblate.org/ca/latest/user/checks.md#checks)), encara que potser no cobreixen tot el que voleu comprovar. La llista de comprovacions realitzades es pot ajustar mitjançant [`CHECK_LIST`](https://docs.weblate.org/ca/latest/admin/config.md#std-setting-CHECK_LIST), i també podeu afegir comprovacions personalitzades.

1. Subclasse weblate.checks.Check
2. Estableix uns quants atributs.
3. Implementeu el mètode `check` (si voleu tractar amb els plurals al vostre codi) o el mètode `check_single` (que ho fa per vosaltres).

Alguns exemples:

Per instal·lar comprovacions personalitzades, proporcioneu un camí completament qualificat a la classe Python a [`CHECK_LIST`](https://docs.weblate.org/ca/latest/admin/config.md#std-setting-CHECK_LIST), vegeu [Custom quality checks, add-ons, automatic suggestions and auto-fixes](https://docs.weblate.org/ca/latest/admin/customize.md#custom-check-modules).

Checks declaring `propagates = "source"` or `propagates = "target"` update
related strings in the background after a save. They can override
`evaluate_propagated(units)` to evaluate a matching group in bulk. Yield a
`(unit, failed)` pair for every string, including passing strings so stale
warnings can be removed. Without this override, Weblate evaluates the check
on each matching string in chunks.

### Comprovant el text de la traducció no conté «foo»

Aquesta és una comprovació bastant senzilla que només comprova si a la traducció li falta la cadena «foo».

```python
"""Simple quality check example."""

from __future__ import annotations

from typing import TYPE_CHECKING

from django.utils.translation import gettext_lazy

from weblate.checks.base import TargetCheck

if TYPE_CHECKING:
    from weblate.trans.models import Unit


class FooCheck(TargetCheck):
    # Used as identifier for check, should be unique
    # Has to be shorter than 50 characters
    check_id = "foo"

    # Short name used to display failing check
    # Might be localized using gettext_lazy
    name = "Foo check"

    # Description for failing check
    description = gettext_lazy("Your translation is foo")

    # Real check code
    def check_single(self, source: str, target: str, unit: Unit) -> bool:
        return "foo" in target
```

### Comprovar que els plurals del text de traducció txec són diferents

Comproveu l’ús de la informació de l’idioma per verificar que les dues formes de plural en llengua txeca no són iguals.

```python
"""Quality check example for Czech plurals."""

from __future__ import annotations

from django.utils.translation import gettext_lazy

from weblate.checks.base import TargetCheck


class PluralCzechCheck(TargetCheck):
    # Used as identifier for check, should be unique
    # Has to be shorter than 50 characters
    check_id = "foo"

    # Short name used to display failing check
    # Might be localized using gettext_lazy
    name = "Foo check"

    # Description for failing check
    description = gettext_lazy("Your translation is foo")

    # Real check code
    def check_target_unit(self, sources, targets, unit) -> bool:
        if unit.translation.language.is_base({"cs"}):
            return targets[1] == targets[2]
        return False

    def check_single(self, source, target, unit) -> bool:
        """We don't check target strings here."""
        return False
```
