Formats de fichiers pris en charge#

Weblate supports a wide range of translation formats. Each format is slightly different and provides a different set of capabilities.

Indication

Lorsque vous choisissez un format de fichier pour votre demande, il est préférable de conserver un format bien établi dans la boîte à outils/plateforme que vous utilisez. De cette façon, vos traducteurs pourront utiliser les outils auxquels ils sont habitués et contribueront plus probablement à votre projet.

Détection automatique#

Weblate tries to detect file format during Adding translation projects and components. The detection might be wrong for different variants of the same serialization format (JSON, YAML, properties) or file encoding, so please verify that Format de fichier is correct before creating the component.

Fonctionnalités des types de traduction#

Fonctionnalités de chacun des formats pris en charge#

Format

Type [1]

Pluriels [2]

Descriptions [3]

Contexte [4]

Emplacement [5]

Drapeaux [8]

États supplémentaires [6]

GNU gettext PO (Portable Object)

bilingue

oui

oui

oui

oui

oui [9]

à vérifier

Gettext monolingue

monolingue

oui

oui

oui

oui

oui [9]

à vérifier

XLIFF

les deux

oui

oui

oui

oui

oui

à vérifier, approuver

Propriétés Java

les deux

non

oui

non

non

non

Fichiers mi18n lang

monolingue

non

oui

non

non

non

Propriétés GWT

monolingue

oui

oui

non

non

non

Joomla translations

monolingue

non

oui

non

oui

non

Qt Linguist .ts

les deux

oui

oui

non

oui

oui

à vérifier

Ressources de chaînes Android

monolingue

oui

oui [7]

non

non

oui

Chaînes Apple iOS

les deux

non

oui

non

non

non

Chaînes de caractères PHP

monolingue

non [10]

oui

non

non

non

JSON files

monolingue

non

non

non

non

non

i18next JSON files

monolingue

oui

non

non

non

non

Fichiers JSON go-i18n

monolingue

oui

oui

non

non

non

gotext JSON files

monolingue

oui

oui

non

oui

non

Fichier ARB

monolingue

oui

oui

non

non

non

WebExtension JSON

monolingue

oui

oui

non

non

non

.NET resource files (RESX, RESW)

monolingue

non

oui

non

non

oui

ResourceDictionary files

monolingue

non

non

non

non

oui

CSV files

les deux

non

oui

oui

oui

non

à vérifier

YAML files

monolingue

non

non

non

non

non

Fichiers Ruby YAML

monolingue

oui

non

non

non

non

DTD files

monolingue

non

non

non

non

non

Fichiers XML plats

monolingue

non

non

non

non

oui

Windows RC files

monolingue

non

oui

non

non

non

Excel Open XML

monolingue

non

oui

oui

oui

non

à vérifier

Fichiers de métadonnées de l’App Store

monolingue

non

non

non

non

non

Subtitle files

monolingue

non

non

non

oui

non

HTML files

monolingue

non

non

non

non

non

Fichiers Markdown

monolingue

non

non

non

non

non

OpenDocument Format

monolingue

non

non

non

non

non

Format IDML

monolingue

non

non

non

non

non

INI translations

monolingue

non

non

non

non

non

Traduction des fichier INI InnoSetup

monolingue

non

non

non

non

non

Format TermBase eXchange

bilingue

non

oui

non

non

oui

Fichiers texte

monolingue

non

non

non

non

non

Format Stringsdict

monolingue

oui

non

non

non

non

Fluent format

monolingue

no [11]

oui

non

non

non

Formats monolingues et bilingues#

Les formats monolingual et bilingual sont pris en charge. Les formats bilingues stockent deux langues dans un seul fichier — source et traduction (exemples principaux GNU gettext PO (Portable Object), XLIFF ou Chaînes Apple iOS). A l’opposé, les formats mono-langue identifient la chaîne par un identifiant, et chaque fichier de langue contient uniquement la traduction correspondante pour une langue donnée (exemple Ressources de chaînes Android). Certains formats de fichiers sont utilisés dans les deux variantes, veuillez consulter la description détaillée ci-dessous.

Pour une utilisation correcte des fichiers monolingues, Weblate nécessite l’accès à un fichier contenant la liste complète des chaînes de caractères à traduire avec leur source — ce fichier est appelé Fichier de langue de base mono-langue dans Weblate, bien que le nom puisse varier selon votre paradigme.

De plus, ce flux de travail peut être étendu en utilisant un Fichier de langue intermédiaire pour inclure des chaînes fournies par les développeurs, mais qui ne doivent pas être utilisées telles quelles dans les chaînes finales.

String states#

Many file formats only differentiate « Untranslated » and « Translated » strings. With some formats it is possible to store more fine-grained state information, such as « Needs editing » or « Approved ».

Description de la chaîne source#

Source string descriptions can be used to pass additional info about the string to translate.

Several formats have native support for providing additional info to translators (for example XLIFF, GNU gettext PO (Portable Object), WebExtension JSON, CSV files, Excel Open XML, Qt Linguist .ts, Fichiers JSON go-i18n, gotext JSON files, Fichier ARB, .NET resource files (RESX, RESW)). Many other formats extract closest comment as source string description.

Explication#

The Explication on strings can be stored and parsed from a few file formats.

Currently supported only in Format TermBase eXchange.

Emplacement de la chaîne source#

L’emplacement d’une chaîne dans le code source peut aider les traducteurs compétents à comprendre comment la chaîne est utilisée.

This information is typically available in bilingual formats where strings are extracted from the source code using tools. For example GNU gettext PO (Portable Object) and Qt Linguist .ts.

Drapeaux de traduction#

Translation flags allow customizing Weblate behavior. Some formats support defining those in the translation file (you can always define them in the Weblate interface, see Customizing behavior using flags).

This feature is modelled on flags in GNU gettext PO (Portable Object).

Additionally, for all XML based format, the flags are extracted from the non-standard attribute weblate-flags. Additionally max-length:N is supported through the maxwidth attribute as defined in the XLIFF standard, see Specifying translation flags.

Contexte#

Context is used to differentiate identical strings in a bilingual format used in different scopes (for example Sun can be used as an abbreviated name of the day « Sunday » or as the name of our closest star).

For monolingual formats the string identifier (often called key) can serve the same purpose and additional context is not necessary.

Pluralized strings#

Plurals are necessary to properly localize strings with variable count. The rules depend on a target language and many formats follow CLDR specification for that.

Indication

Pluralizing strings need proper support from the application framework as well. Choose native format of your platform such as GNU gettext PO (Portable Object), Ressources de chaînes Android or Format Stringsdict.

Chaînes en lecture seule#

Read-only strings from translation files will be included, but can not be edited in Weblate. This feature is natively supported by few formats (XLIFF and Ressources de chaînes Android), but can be emulated in others by adding a read-only flag, see Customizing behavior using flags.

Supporting other formats#

Most formats supported by translate-toolkit which support serializing can be easily supported, but they did not (yet) receive any testing. In most cases some thin layer is needed in Weblate to hide differences in behavior of different translate-toolkit storages.

To add support for a new format, the preferred approach is to first implement support for it in the translate-toolkit.