Obsługiwane formaty plików#
Weblate supports a wide range of translation formats. Each format is slightly different and provides a different set of capabilities.
Podpowiedź
When choosing a file format for your application, it’s better to stick some well established format in the toolkit/platform you use. This way your translators can additionally use whatever tools they are used to, and will more likely contribute to your project.
- Android string resources
- Ciągi Apple iOS
- Pliki metadanych sklepu z aplikacjami
- Plik ARB
- Pliki CSV
- Pliki DTD
- Excel Open XML
- Jednolity plik XML
- Format Fluent
- GNU gettext
- go-i18n pliki JSON
- gotext JSON files
- Właściwości GWT
- Pliki HTML
- i18next JSON files
- Format IDML
- Tłumaczenia INI
- Tłumaczenia Inno Setup INI
- Właściwości Java
- Tłumaczenia Joomli
- Plik JSON
- Ciągi znaków Laravel PHP
- Pliki lang dla mi18n
- Format OpenDocument
- Ciągi PHP
- Qt Linguist .ts
- Pliki ResourceDictionary
- RESX .NET resource files
- Pliki Ruby YAML
- Format stringsdict
- Pliki napisów
- Format TermBase eXchange
- Pliki tekstowe
- WebExtension JSON
- Pliki RC systemu Windows
- XLIFF
- Pliki YAML
Zobacz także
Automatyczne wykrywanie#
Weblate tries to detect file format during Dodawanie projektów i komponentów tłumaczeniowych. The detection might be wrong for different variants of the same serialization format (JSON, YAML, properties) or file encoding, so please verify that Format pliku is correct before creating the component.
Możliwe typy tłumaczeń#
Format |
Lingualność [1] |
Liczba mnoga [2] |
Opisy [3] |
Kontekst [4] |
Lokalizacja [5] |
Flagi [8] |
Dodatkowe stany [6] |
---|---|---|---|---|---|---|---|
dwujęzyczny |
tak |
tak |
tak |
tak |
Tak [9] |
wymaga edycji |
|
mono |
tak |
tak |
tak |
tak |
Tak [9] |
wymaga edycji |
|
oba |
tak |
tak |
tak |
tak |
tak |
wymaga edycji, zatwierdzono |
|
oba |
nie |
tak |
nie |
nie |
nie |
||
mono |
nie |
tak |
nie |
nie |
nie |
||
mono |
tak |
tak |
nie |
nie |
nie |
||
mono |
nie |
tak |
nie |
tak |
nie |
||
oba |
tak |
tak |
nie |
tak |
tak |
wymaga edycji |
|
mono |
tak |
tak [7] |
nie |
nie |
tak |
||
oba |
nie |
tak |
nie |
nie |
nie |
||
mono |
nie [10] |
tak |
nie |
nie |
nie |
||
mono |
nie |
nie |
nie |
nie |
nie |
||
mono |
tak |
nie |
nie |
nie |
nie |
||
mono |
tak |
tak |
nie |
nie |
nie |
||
mono |
tak |
tak |
nie |
tak |
nie |
||
mono |
tak |
tak |
nie |
nie |
nie |
||
mono |
tak |
tak |
nie |
nie |
nie |
||
mono |
nie |
tak |
nie |
nie |
tak |
||
mono |
nie |
nie |
nie |
nie |
tak |
||
oba |
nie |
tak |
tak |
tak |
nie |
wymaga edycji |
|
mono |
nie |
nie |
nie |
nie |
nie |
||
mono |
tak |
nie |
nie |
nie |
nie |
||
mono |
nie |
nie |
nie |
nie |
nie |
||
mono |
nie |
nie |
nie |
nie |
tak |
||
mono |
nie |
tak |
nie |
nie |
nie |
||
mono |
nie |
tak |
tak |
tak |
nie |
wymaga edycji |
|
mono |
nie |
nie |
nie |
nie |
nie |
||
mono |
nie |
nie |
nie |
tak |
nie |
||
mono |
nie |
nie |
nie |
nie |
nie |
||
mono |
nie |
nie |
nie |
nie |
nie |
||
mono |
nie |
nie |
nie |
nie |
nie |
||
mono |
nie |
nie |
nie |
nie |
nie |
||
mono |
nie |
nie |
nie |
nie |
nie |
||
dwujęzyczny |
nie |
tak |
nie |
nie |
tak |
||
mono |
nie |
nie |
nie |
nie |
nie |
||
mono |
tak |
nie |
nie |
nie |
nie |
||
mono |
nie [11] |
tak |
nie |
nie |
nie |
Formaty dwujęzyczne i jednojęzyczne#
Both monolingual and bilingual formats are supported. Bilingual formats store two languages in single file—source and translation (typical examples are GNU gettext, XLIFF or Ciągi Apple iOS). On the other side, monolingual formats identify the string by ID, and each language file contains only the mapping of those to any given language (typically Android string resources). Some file formats are used in both variants, see the detailed description below.
For correct use of monolingual files, Weblate requires access to a file containing complete list of strings to translate with their source—this file is called Jednojęzyczny bazowy plik języka within Weblate, though the naming might vary in your paradigm.
Additionally this workflow can be extended by utilizing Plik języka pośredniego to include strings provided by developers, but not to be used as is in the final strings.
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, Pliki CSV, Excel Open XML, Qt Linguist .ts, go-i18n pliki JSON, gotext JSON files, Plik ARB, RESX .NET resource files). Many other formats extract closest comment as source string description.
Objaśnienie#
The Objaśnienie on strings can be stored and parsed from a few file formats.
Currently supported only in Format TermBase eXchange.
Source string location#
Location of a string in source code might help proficient translators figure out how the string is used.
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.
Flagi tłumaczeń#
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 Dostosowywanie zachowania za pomocą flag).
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 Określanie flag tłumaczenia.
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.
Podpowiedź
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 Format stringsdict.
Ciągi tylko do odczytu#
Nowe w wersji 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 Dostosowywanie zachowania za pomocą flag.
Obsługa innych formatów#
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.
Zobacz także