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.
- Android string resources
- Apple iOS strings
- Fichiers de métadonnées de l’App Store
- ARB File
- CSV files
- DTD files
- Excel Open XML
- Flat XML files
- Fluent format
- GNU gettext
- go-i18n JSON files
- gotext JSON files
- Propriétés GWT
- HTML files
- i18next JSON files
- IDML Format
- INI translations
- Traduction des fichier INI InnoSetup
- Java properties
- Joomla translations
- JSON files
- Chaînes de caractères PHP Laravel
- mi18n lang files
- OpenDocument Format
- Chaînes de caractères PHP
- Qt Linguist .ts
- ResourceDictionary files
- RESX .NET resource files
- Ruby YAML files
- Stringsdict format
- Subtitle files
- TermBase eXchange format
- 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 |
||
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, XLIFF ou Apple iOS strings). 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 Android string resources). 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 ».
Source string description#
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, WebExtension JSON, CSV files, Excel Open XML, Qt Linguist .ts, go-i18n JSON files, gotext JSON files, ARB File, RESX .NET resource files). 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 TermBase eXchange format.
Source string location#
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 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.
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.
Context#
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, Android string resources or Stringsdict format.
Chaînes en lecture seule#
Nouveau dans la version 3.10.
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 Android string resources), 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