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.
- Ressources de chaînes Android
- Chaînes Apple iOS
- Fichiers de métadonnées de l’App Store
- Fichier ARB
- CSV files
- DTD files
- Excel Open XML
- Fichiers XML plats
- Fluent format
- Format.JS JSON file
- GNU gettext PO (Portable Object)
- Fichiers JSON go-i18n
- gotext JSON files
- Propriétés GWT
- HTML files
- i18next JSON files
- Format IDML
- INI translations
- Traduction des fichier INI InnoSetup
- Propriétés Java
- Joomla translations
- JSON files
- Chaînes de caractères PHP Laravel
- Fichiers Markdown
- Fichiers mi18n lang
- Ressources Kotlin mobile
- OpenDocument Format
- Chaînes de caractères PHP
- Qt Linguist .ts
- ResourceDictionary files
- .NET resource files (RESX, RESW)
- Fichiers Ruby YAML
- Format Stringsdict
- Subtitle files
- Format TermBase eXchange
- Fichiers texte
- WebExtension JSON
- Windows RC files
- XLIFF
- YAML files
Voir aussi
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#
Format |
Type [1] |
Pluriels [2] |
Descriptions [3] |
Contexte [4] |
Emplacement [5] |
Drapeaux [8] |
États supplémentaires [6] |
---|---|---|---|---|---|---|---|
bilingue |
oui |
oui |
oui |
oui |
oui [9] |
à vérifier |
|
monolingue |
oui |
oui |
oui |
oui |
oui [9] |
à vérifier |
|
les deux |
oui |
oui |
oui |
oui |
oui |
à vérifier, approuver |
|
les deux |
non |
oui |
non |
non |
non |
||
monolingue |
non |
oui |
non |
non |
non |
||
monolingue |
oui |
oui |
non |
non |
non |
||
monolingue |
non |
oui |
non |
oui |
non |
||
les deux |
oui |
oui |
non |
oui |
oui |
à vérifier |
|
monolingue |
oui |
oui [7] |
non |
non |
oui |
||
les deux |
non |
oui |
non |
non |
non |
||
monolingue |
non [10] |
oui |
non |
non |
non |
||
monolingue |
non |
non |
non |
non |
non |
||
monolingue |
oui |
non |
non |
non |
non |
||
monolingue |
oui |
oui |
non |
non |
non |
||
monolingue |
oui |
oui |
non |
oui |
non |
||
monolingue |
oui |
oui |
non |
non |
non |
||
monolingue |
oui |
oui |
non |
non |
non |
||
monolingue |
non |
oui |
non |
non |
oui |
||
monolingue |
non |
non |
non |
non |
oui |
||
les deux |
non |
oui |
oui |
oui |
non |
à vérifier |
|
monolingue |
non |
non |
non |
non |
non |
||
monolingue |
oui |
non |
non |
non |
non |
||
monolingue |
non |
non |
non |
non |
non |
||
monolingue |
non |
non |
non |
non |
oui |
||
monolingue |
non |
oui |
non |
non |
non |
||
monolingue |
non |
oui |
oui |
oui |
non |
à vérifier |
|
monolingue |
non |
non |
non |
non |
non |
||
monolingue |
non |
non |
non |
oui |
non |
||
monolingue |
non |
non |
non |
non |
non |
||
monolingue |
non |
non |
non |
non |
non |
||
monolingue |
non |
non |
non |
non |
non |
||
monolingue |
non |
non |
non |
non |
non |
||
monolingue |
non |
non |
non |
non |
non |
||
monolingue |
non |
non |
non |
non |
non |
||
bilingue |
non |
oui |
non |
non |
oui |
||
monolingue |
non |
non |
non |
non |
non |
||
monolingue |
oui |
non |
non |
non |
non |
||
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.
Voir aussi