Localization file formats

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.

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ń

Capabilities of all supported formats

Format

Lingualność [1]

Liczba mnoga [2]

Opisy [3]

Kontekst [4]

Lokalizacja [5]

Flagi [8]

Dodatkowe stany [6]

GNU gettext PO (Portable Object)

dwujęzyczny

tak

tak

tak

tak

Tak [9]

wymaga edycji

Jednojęzyczny gettext

mono

tak

tak

tak

tak

Tak [9]

wymaga edycji

XLIFF 1.1 and 1.2

oba

tak

tak

tak

tak

tak

wymaga edycji, zatwierdzono

Właściwości Java

oba

nie

tak

nie

nie

nie

draggable/i18n lang files

mono

nie

tak

nie

nie

nie

Właściwości GWT

mono

tak

tak

nie

nie

nie

Tłumaczenia Joomli

mono

nie

tak

nie

tak

nie

Qt Linguist .ts

oba

tak

tak

nie

tak

tak

wymaga edycji

Zasoby z ciągami Androida

mono

tak

tak [7]

nie

nie

tak

Ciągi Apple iOS

oba

nie

tak

nie

nie

nie

Ciągi PHP

mono

nie [10]

tak

nie

nie

nie

Plik JSON

mono

nie

nie

nie

nie

nie

Pliki JSON i18next

mono

tak

nie

nie

nie

nie

Pliki JSON go-i18n

mono

tak

tak

nie

nie

nie

Pliki JSON gotext

mono

tak

tak

nie

tak

nie

Plik ARB

mono

tak

tak

nie

nie

nie

JSON WebExtension

mono

tak

tak

nie

nie

nie

Pliki zasobów .NET (RESX, RESW)

mono

nie

tak

nie

nie

tak

Pliki ResourceDictionary

mono

nie

nie

nie

nie

tak

Pliki CSV

oba

nie

tak

tak

tak

nie

wymaga edycji

Pliki YAML

mono

nie

nie

nie

nie

nie

Pliki Ruby YAML

mono

tak

nie

nie

nie

nie

Pliki DTD

mono

nie

nie

nie

nie

nie

Jednolity plik XML

mono

nie

nie

nie

nie

tak

Pliki RC systemu Windows

mono

nie

tak

nie

nie

nie

Excel Open XML

mono

nie

tak

tak

tak

nie

wymaga edycji

Pliki metadanych sklepu z aplikacjami

mono

nie

nie

nie

nie

nie

Pliki napisów

mono

nie

nie

nie

tak

nie

Pliki HTML

mono

nie

nie

nie

nie

nie

Pliki Markdown

mono

nie

nie

nie

nie

nie

Format OpenDocument

mono

nie

nie

nie

nie

nie

Format IDML

mono

nie

nie

nie

nie

nie

Tłumaczenia INI

mono

nie

nie

nie

nie

nie

Tłumaczenia Inno Setup INI

mono

nie

nie

nie

nie

nie

Format TermBase eXchange

dwujęzyczny

nie

tak

tak

nie

tak

Pliki tekstowe

mono

nie

nie

nie

nie

nie

Format stringsdict

mono

tak

nie

nie

nie

nie

Format Fluent

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 PO (Portable Object), XLIFF 1.1 and 1.2 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 Zasoby z ciągami Androida). 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”.

Opis ciągu źródłowego

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 1.1 and 1.2, GNU gettext PO (Portable Object), JSON WebExtension, Pliki CSV, Excel Open XML, Qt Linguist .ts, Pliki JSON go-i18n, Pliki JSON gotext, Plik ARB, Pliki zasobów .NET (RESX, RESW)). 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.

Położenie ciągu źródłowego

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 PO (Portable Object) 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 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 Określanie flag tłumaczenia.

Kontekst

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 PO (Portable Object), Zasoby z ciągami Androida or Format stringsdict.

Ciągi tylko do odczytu

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 1.1 and 1.2 and Zasoby z ciągami Androida), 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) received any testing. In most cases, an additional thin layer is needed in Weblate to hide differences in behavior of different storages.

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

Parametry formatu pliku

File format parameters provide a way to configure settings related to the file format. They are configured at component level and allow you to customize how file parsing and serialization are handled.

List of file format parameters

Parameter name

File formats

Label

Help text

csv_encoding

  • csv

  • csv-multi

Kodowanie plików

Kodowanie używane w plikach CSV

Dostępne opcje:

auto

Automatyczne wykrywanie

utf-8

UTF-8

csv_simple_encoding

  • csv-simple

Kodowanie plików

Kodowanie używane w prostych plikach CSV

Dostępne opcje:

auto

Automatyczne wykrywanie

utf-8

UTF-8

iso-8859-1

ISO-8859-1

flatxml_key_name

  • flatxml

Nazwa klucza FlatXML

flatxml_root_name

  • flatxml

Nazwa korzenia FlatXML

flatxml_value_name

  • flatxml

Nazwa wartości FlatXML

gwt_encoding

  • gwt

Kodowanie plików

Kodowanie używane w plikach właściwości GWT

Dostępne opcje:

utf-8

UTF-8

iso-8859-1

ISO-8859-1

json_indent

  • json

  • json-nested

  • webextension

  • i18next

  • i18nextv4

  • arb

  • go-i18n-json

  • go-i18n-json-v2

  • formatjs

  • gotext

Wcięcie JSON

json_indent_style

  • json

  • json-nested

  • webextension

  • i18next

  • i18nextv4

  • arb

  • go-i18n-json

  • go-i18n-json-v2

  • formatjs

  • gotext

Styl wcięć JSON

Dostępne opcje:

spaces

Spacje

tabs

Tabulatory

json_sort_keys

  • json

  • json-nested

  • webextension

  • i18next

  • i18nextv4

  • arb

  • go-i18n-json

  • go-i18n-json-v2

  • formatjs

  • gotext

Sortuj klucze JSON

json_use_compact_separators

  • json

  • json-nested

  • webextension

  • i18next

  • i18nextv4

  • arb

  • go-i18n-json

  • go-i18n-json-v2

  • formatjs

  • gotext

Unikaj spacji po separatorach

merge_duplicates

  • markdown

  • html

  • txt

  • dokuwiki

  • mediawiki

Deduplicate identical strings

Consolidates identical source strings into a single translation unit. Prevents translation loss during file restructuring or table reordering by removing position-dependent context.

po_fuzzy_matching

  • po

Użyj dopasowania rozmytego

po_keep_previous

  • po

Zachowaj poprzednie msgids przetłumaczonych ciągów

po_line_wrap

  • po

  • po-mono

Zawijanie długich linii

By default, gettext wraps lines at 77 characters and at newlines. With the --no-wrap parameter, wrapping is only done at newlines.

Dostępne opcje:

77

Zawijaj linie przy 77 znakach i przy nowych liniach (domyślnie xgettext)

65535

Only wrap lines at newlines (like xgettext --no-wrap)

-1

Bez zawijania linii

po_no_location

  • po

Nie uwzględniaj informacji o lokalizacji w pliku

properties_encoding

  • properties

  • xwiki-page-properties

Kodowanie plików

Kodowanie używane w plikach właściwości Java

Dostępne opcje:

iso-8859-1

ISO-8859-1

utf-8

UTF-8

utf-16

UTF-16

strings_encoding

  • strings

Kodowanie plików

Kodowanie używane w plikach ciągów iOS

Dostępne opcje:

utf-16

UTF-16

utf-8

UTF-8

xml_closing_tags

  • ts

  • plainxliff

  • xliff

  • xliff2

  • xliff2-placeables

  • poxliff

  • resx

  • aresource

  • moko-resource

  • cmp-resource

  • tbx

Dołącz tag zamykający do pustych tagów XML

yaml_indent

  • yaml

  • ruby-yaml

Wcięcie YAML

yaml_line_break

  • yaml

  • ruby-yaml

Podział wierszy

Dostępne opcje:

dos

DOS (\r\n)

unix

UNIX (\n)

mac

MAC (\r)

yaml_line_wrap

  • yaml

  • ruby-yaml

Zawijanie długich linii

Dostępne opcje:

80

Zawijaj linie przy 80 znakach

100

Zawijaj linie przy 100 znakach

120

Zawijaj linie przy 120 znakach

180

Zawijaj linie przy 180 znakach

65535

Bez zawijania linii