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 to 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ń

Please refer to the documentation page of each individual file format for information about which features are supported in that format.

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, XML-based formats that support flags extract them from the non-standard attribute weblate-flags. The max-length:N flag is also 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.

Plural support in the supported features table means Weblate can represent plural strings for the format. Some formats need existing plural metadata or a specific variant, and cannot create new plural strings unless that is natively supported by the format.

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.

Multivalue formats

Multivalue formats, such as Wielowartościowy plik CSV and Format TermBase eXchange, store independent source and target alternatives within one string. These alternatives have no one-to-one pairing, and their counts do not follow grammatical plural rules.

Source checks inspect every source alternative. Target checks compare each target alternative with the source alternatives. A target passes when it matches any source alternative, independently of their order or the languages» grammatical plural forms. The Unchanged translation check instead reports targets identical to any source alternative, subject to its usual exemptions. Automatic fixes are applied only when all source alternatives produce the same correction.

Machine translation suggestions translate each source alternative independently. Automatic machine translation supports strings with one source alternative and at most one target alternative; it skips strings with multiple alternatives to preserve them. Translation service glossaries can use all alternatives. Automatic Pamięć tłumaczeniowa contributions skip strings with multiple alternatives.

LLM translation services use only strings with one source alternative and one target alternative as examples of previous translations. They omit existing translation context for strings with multiple alternatives.

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.

Removing obsolete strings

Some file formats can store obsolete strings. Weblate can remove these obsolete strings from formats that support this operation.

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, 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.

For supported XML formats, xml_utf8_bom controls the UTF-8 byte order mark: preserve keeps the input file’s BOM, include always writes it, and omit removes it. The default is preserve; new files without a template omit the BOM. Other encodings are unchanged.

The xml_encoding_case parameter selects uppercase or lowercase encoding names in the XML declaration, such as UTF-8 or utf-8. The default, default, uses the format’s native casing.

The xml_final_newline parameter controls the newline after the complete XML document, including any trailing comments or processing instructions. Choose include for exactly one final line ending, or omit for none. The default, default, leaves the format’s behavior unchanged. Explicit inclusion uses the serializer’s line-ending style, falling back to LF when the output contains no line endings. Translation-content whitespace is unchanged.

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_escape_formulas

  • csv

  • csv-multi

  • csv-simple

Uwalnianie formuł arkusza kalkulacyjnego

Podczas zapisywania plików CSV do wartości, które wyglądają jak formuły arkusza kalkulacyjnego, dodawaj apostrof.

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

dos_eol

All file formats

Zakończenia linii DOS

W ciągach znaków należy używać zakończeń linii DOS (rn) zamiast zakończeń linii UNIX (n).

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

Dostępne opcje:

none

Nie sortuj

case_sensitive

Sortowanie uwzględniające wielkość liter

case_insensitive

Sortowanie bez uwzględniania wielkości liter

json_use_compact_separators

  • json

  • json-nested

  • webextension

  • i18next

  • i18nextv4

  • arb

  • go-i18n-json

  • go-i18n-json-v2

  • formatjs

  • gotext

Unikaj spacji po separatorach

line_max_length

  • markdown

  • mdx

Maksymalna długość linii

Maksymalna liczba znaków dla każdej linii w pliku wyjściowym.

md_extract_code_blocks

  • markdown

  • mdx

Wyodrębnij bloki kodu

Czy wyodrębniać treść możliwą do przetłumaczenia z bloków kodu w plikach Markdown i MDX.

md_extract_frontmatter

  • markdown

  • mdx

Wyodrębnij część wstępną

Czy wyodrębniać i tłumaczyć bloki części wstępnej YAML w plikach Markdown i MDX.

md_frontmatter_translate_values

  • markdown

  • mdx

Przetłumacz wartości przedniej części

Analizuj przednią część YAML i tłumacz tylko wartości skalarne. Klucze, struktura, komentarze i formatowanie są zachowywane, gdy jest to możliwe.

md_no_placeholders

  • markdown

  • mdx

Wyłącz symbole zastępcze

Wyłącza wykrywanie i przetwarzanie symboli zastępczych w plikach Markdown i MDX.

merge_duplicates

  • markdown

  • mdx

  • html

  • txt

  • dokuwiki

  • mediawiki

  • asciidoc

Usuń zduplikowane identyczne ciągi

Łączy identyczne ciągi źródłowe w jedną jednostkę tłumaczeniową. Zapobiega utracie tłumaczeń podczas restrukturyzacji pliku lub zmiany kolejności tabel przez usunięcie kontekstu zależnego od pozycji.

po_contributor_comments

  • po

  • po-mono

Komentarze współautora

Dodaj imiona i nazwiska współtwórców oraz lata do komentarzy w nagłówku. Narzędzie SPDX konwertuje również istniejące, rozpoznane komentarze dotyczące współtwórców na wpisy typu SPDX-FileCopyrightText.

Dostępne opcje:

none

Wyłączono

gettext

Gettext

spdx

SPDX

po_fuzzy_matching

  • po

Użyj dopasowania rozmytego

po_keep_previous

  • po

Zachowaj poprzednie msgids przetłumaczonych ciągów

Kontroluje poprzednie komentarze msgid dla ciągów rozmytych.

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

po_remove_obsolete

  • po

  • po-mono

Usuń przestarzałe ciągi

Usuń przestarzałe wpisy z plików PO podczas zapisywania zmian w tłumaczeniu lub aktualizacji z pliku POT.

po_report_msgid_bugs_to

  • po

  • po-mono

Zgłoś błędy msgid do

Pozwala Weblate zaktualizować nagłówek pliku „Report-Msgid-Bugs-To”, jeśli ustawiono adres zgłaszania błędów w ciągu źródłowym.

po_set_language_team

  • po

  • po-mono

Zaktualizuj nagłówek zespołu tłumaczy

Pozwala Weblate zaktualizować nagłówek pliku „Language-Team”.

po_set_last_translator

  • po

  • po-mono

Zaktualizuj nagłówek ostatniego tłumacza

Pozwala Weblate zaktualizować nagłówek pliku „Last-Translator”.

po_set_x_generator

  • po

  • po-mono

Zaktualizuj nagłówek X-Generator

Pozwala Weblate zaktualizować nagłówek pliku „X-Generator”.

properties_encoding

  • 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-8

UTF-8

utf-16

UTF-16

xliff_placeables

  • xliff

  • xliff2

Obsługa obiektów do umieszczenia

Określa, czy elementy XML wbudowane w ciągi XLIFF są zachowywane jako obiekty do umieszczenia. W przypadku opcji „zwykły tekst” znaczniki XML są jedynie maskowane, a zawartość traktowana jest jak zwykły tekst. Gdy obsługa obiektów do umieszczenia jest włączona, znaczniki takie jak <x id=”name” =””> czy </x>

Dostępne opcje:

plain

Tylko zwykły tekst

placeables

Obsługuj obiekty do umieszczenia

xml_closing_tags

  • ts

  • xliff

  • xliff2

  • poxliff

  • apple-xliff

  • resx

  • aresource

  • moko-resource

  • cmp-resource

  • tbx

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

xml_encoding_case

  • ts

  • xliff

  • xliff2

  • poxliff

  • apple-xliff

  • resx

  • aresource

  • moko-resource

  • cmp-resource

  • tbx

Wielkość liter w kodowaniu deklaracji XML

Określa nazwy kodowania w deklaracji XML, na przykład „UTF-8” lub „utf-8”.

Dostępne opcje:

default

Format domyślny

uppercase

Wielkie litery

lowercase

Małe litery

xml_final_newline

  • ts

  • xliff

  • xliff2

  • poxliff

  • apple-xliff

  • resx

  • aresource

  • moko-resource

  • cmp-resource

  • tbx

Końcowy znak nowej linii w XML

Określa znak nowego wiersza na końcu pliku z wykorzystaniem formatu zakończeń linii.

Dostępne opcje:

default

Format domyślny

include

Zawsze uwzględniaj

omit

Zawsze pomijaj

xml_utf8_bom

  • ts

  • xliff

  • xliff2

  • poxliff

  • apple-xliff

  • resx

  • aresource

  • moko-resource

  • cmp-resource

  • tbx

Znak kolejności bajtów UTF-8

Określa znaczniki kolejności bajtów (BOM) dla kodowania UTF-8. W przypadku innych kodowań pozostaje on bez zmian. W nowych plikach tworzonych bez użycia szablonu znacznik ten jest pomijany, jeśli zachowywana jest zawartość wejściowa.

Dostępne opcje:

preserve

Zachowaj dane wejściowe

include

Zawsze uwzględniaj

omit

Zawsze pomijaj

xml_whitespace_handling

  • xliff

  • poxliff

  • apple-xliff

  • xliff2

Obsługa białych znaków

Określa sposób obsługi białych znaków w formacie XLIFF. Opcja „Przestrzegaj xml:space” uwzględnia atrybuty zawarte w pliku. Opcja „Zawsze zachowuj” zachowuje wszystkie białe znaki. Opcja „Zawsze normalizuj” scala białe znaki, nawet jeśli ustawiono atrybut xml:space=”preserve”.

Dostępne opcje:

standard

Przestrzegaj xml:space

preserve

Zawsze zachowuj

normalize

Zawsze normalizuj

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