Localization file formats

Weblate supports a wide range of translation formats. Each format is slightly different and provides a different set of capabilities.

Savjet

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.

Automatsko otkrivanje

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 datoteke is correct before creating the component.

Translation types capabilities

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

Dvojezični i jednojezični formati

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 Apple iOS izrazi). 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 Resursi Android izraza). 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 Jednojezična datoteka osnovnog jezika within Weblate, though the naming might vary in your paradigm.

Additionally this workflow can be extended by utilizing Datoteka posrednog jezika to include strings provided by developers, but not to be used as is in the final strings.

Stanja izraza

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 izvornog izraza

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), WebExtension JSON, CSV datoteke, Excel Open XML, Qt Linguist .ts, go-i18n JSON datoteke, gotext JSON datoteke, ARB datoteka, .NET datoteke resursa (RESX, RESW)). Many other formats extract closest comment as source string description.

Objašnjenje

The Objašnjenje on strings can be stored and parsed from a few file formats.

Currently supported only in TermBase eXchange format.

Mjesto izvornog izraza

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.

Prevodilačke oznake

Prevodilačke oznake omogućuju prilagođavanje ponašanja Weblatea. Neki formati podržavaju njihovo definiranje u prevodilačkoj datoteci (mogu se bilo kada definirati u Weblate sučelju, pogledaj Customizing behavior using flags).

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 Specificiranje prevodilačkih oznaka.

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.

Savjet

Pluralizing strings need proper support from the application framework as well. Choose native format of your platform such as GNU gettext PO (Portable Object), Resursi Android izraza or Stringsdict format.

Multivalue formats

Multivalue formats, such as CSV datoteka s više vrijednosti and TermBase eXchange format, 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 Prevodilačka memorija 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.

Izrazi samo-za-čitanje

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 Resursi Android izraza), but can be emulated in others by adding a read-only flag, see Customizing behavior using flags.

Removing obsolete strings

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

Podrška za druge datotečne formate

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.

Parametri formata datoteke

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

Kodiranje datoteke

Kodiranje za CSV datoteke

Dostupne mogućnosti:

auto

Automatski otrkij

utf-8

UTF-8

csv_escape_formulas

  • csv

  • csv-multi

  • csv-simple

Escape spreadsheet formulas

Prefix values that look like spreadsheet formulas with an apostrophe when saving CSV files.

csv_simple_encoding

  • csv-simple

Kodiranje datoteke

Kodiranje za jednostavne CSV datoteke

Dostupne mogućnosti:

auto

Automatski otrkij

utf-8

UTF-8

iso-8859-1

ISO-8859-1

dos_eol

All file formats

Kraj redaka u DOS-u

Use DOS line endings (rn) instead of UNIX line endings (n) in strings.

flatxml_key_name

  • flatxml

Ime ključa u FlatXML-u

flatxml_root_name

  • flatxml

Ime korijena u FlatXML-u

flatxml_value_name

  • flatxml

Ime vrijednosti u FlatXML-u

gwt_encoding

  • gwt

Kodiranje datoteke

Kodiranje za GWT datoteke svojstava

Dostupne mogućnosti:

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

JSON uvlačenje

json_indent_style

  • json

  • json-nested

  • webextension

  • i18next

  • i18nextv4

  • arb

  • go-i18n-json

  • go-i18n-json-v2

  • formatjs

  • gotext

Stil JSON uvlačenja

Dostupne mogućnosti:

spaces

Razmaci

tabs

Tabulatori

json_sort_keys

  • json

  • json-nested

  • webextension

  • i18next

  • i18nextv4

  • arb

  • go-i18n-json

  • go-i18n-json-v2

  • formatjs

  • gotext

Razvrstaj JSON ključeve

Dostupne mogućnosti:

none

Do not sort

case_sensitive

Case-sensitive sort

case_insensitive

Case-insensitive sort

json_use_compact_separators

  • json

  • json-nested

  • webextension

  • i18next

  • i18nextv4

  • arb

  • go-i18n-json

  • go-i18n-json-v2

  • formatjs

  • gotext

Izbjegavaj razmake nakon znakova razdvajanja

line_max_length

  • markdown

  • mdx

Maximum line length

The maximum number of characters for each line in the output file.

md_extract_code_blocks

  • markdown

  • mdx

Extract code blocks

Whether to extract translatable content from code blocks in Markdown and MDX files.

md_extract_frontmatter

  • markdown

  • mdx

Extract front matter

Whether to extract and translate YAML front matter blocks in Markdown and MDX files.

md_frontmatter_translate_values

  • markdown

  • mdx

Translate front matter values

Parse YAML front matter and translate only scalar string values. Keys, structure, comments, and formatting are preserved when possible.

md_no_placeholders

  • markdown

  • mdx

Disable placeholders

Disables detection and processing of placeholders in Markdown and MDX files.

merge_duplicates

  • markdown

  • mdx

  • html

  • txt

  • dokuwiki

  • mediawiki

  • asciidoc

Ukloni dupikate jednakih izraza

Konsolidira identične izvorne izraze u jednu jedinicu prijevoda. Sprečava gubitak prijevoda tijekom restrukturiranja datoteka ili promjene redoslijeda tablica uklanjanjem konteksta ovisno o položaju.

po_contributor_comments

  • po

  • po-mono

Contributor comments

Add contributor names and years to header comments. SPDX also converts existing recognized contributor comments to SPDX-FileCopyrightText entries.

Dostupne mogućnosti:

none

Deaktivirano

gettext

Gettext

spdx

SPDX

po_fuzzy_matching

  • po

Koristi netočno poklapanje

po_keep_previous

  • po

Zadrži prijašnje „msgids” (ID-ovi poruka) prevedenih izraza

Kontrolira prethodne msgid komentare za netočne izraze.

po_line_wrap

  • po

  • po-mono

Prelamanje dugačkih redaka

Gettext standardno prelama retke nakon 77 znakova i nakon oznake za novi redak. Pomoću parametra --no-wrap redci se prelamaju samo nakon oznake za novi redak.

Dostupne mogućnosti:

77

Prelomi retke nakon 77 znakova i nakon oznake za novi redak (xgettext standard)

65535

Prelomi retke samo nakon oznake za novi redak (kao xgettext --no-wrap)

-1

Bez prelamanja redaka

po_no_location

  • po

Ne uključuj podatke o lokaciji u datoteku

po_remove_obsolete

  • po

  • po-mono

Ukloni zastarjele izraze

Ukloni zastarjele unose iz PO datoteka prilikom spremanja promjena prijevoda ili aktualiziranja pomoću POT datoteke.

po_report_msgid_bugs_to

  • po

  • po-mono

Prijavi msgid greške na

Omogućuje Weblateu aktualizirati podatak za „Report-Msgid-Bugs-To” (Prijavi msgid greške na) u zaglavlju datoteke, ako je postavljena adresa za prijavu grešaka izvornih izraza.

po_set_language_team

  • po

  • po-mono

Aktualiziraj podatak za jezični tim u zaglavlju

Omogućuje Weblateu aktualizirati podatak za „Language-Team” (jezični tim) u zaglavlju datoteke.

po_set_last_translator

  • po

  • po-mono

Aktualiziraj podatak za zadnjeg prevoditelja u zaglavlju

Omogućuje Weblateu aktualizirati podatak za „Last-Translator” (zadnji prevoditelj) u zaglavlju datoteke.

po_set_x_generator

  • po

  • po-mono

Aktualiziraj podatak za X-Generator u zaglavlju

Omogućuje Weblateu aktualizirati podatak za „X-Generator” u zaglavlju datoteke.

properties_encoding

  • properties

Kodiranje datoteke

Kodiranje korišteno za datoteke Java svojstava

Dostupne mogućnosti:

iso-8859-1

ISO-8859-1

utf-8

UTF-8

utf-16

UTF-16

strings_encoding

  • strings

Kodiranje datoteke

Kodiranje za iOS datoteke izraza

Dostupne mogućnosti:

utf-8

UTF-8

utf-16

UTF-16

xliff_placeables

  • xliff

  • xliff2

Placeables support

Controls whether inline XML elements inside XLIFF strings are preserved as editable placeables. Plain text only escapes XML markup and treats the content as text. With placeables supported, tags such as <x id=”name”/> or <g> stay in the string and appear as placeholders in the editor

Dostupne mogućnosti:

plain

Samo običan tekst

placeables

Support placeables

xml_closing_tags

  • ts

  • xliff

  • xliff2

  • poxliff

  • apple-xliff

  • resx

  • aresource

  • moko-resource

  • cmp-resource

  • tbx

Uključi završnu oznaku za prazne XML oznake

xml_encoding_case

  • ts

  • xliff

  • xliff2

  • poxliff

  • apple-xliff

  • resx

  • aresource

  • moko-resource

  • cmp-resource

  • tbx

XML declaration encoding case

Controls encoding names in the XML declaration, for example „UTF-8” or „utf-8”.

Dostupne mogućnosti:

default

Format default

uppercase

Uppercase

lowercase

Lowercase

xml_final_newline

  • ts

  • xliff

  • xliff2

  • poxliff

  • apple-xliff

  • resx

  • aresource

  • moko-resource

  • cmp-resource

  • tbx

XML final newline

Controls the newline at the end of the file, using the format’s line endings.

Dostupne mogućnosti:

default

Format default

include

Always include

omit

Always omit

xml_utf8_bom

  • ts

  • xliff

  • xliff2

  • poxliff

  • apple-xliff

  • resx

  • aresource

  • moko-resource

  • cmp-resource

  • tbx

UTF-8 byte order mark

Controls the UTF-8 byte order mark. Other encodings are unchanged. New files without a template omit the mark when preserving input.

Dostupne mogućnosti:

preserve

Preserve input

include

Always include

omit

Always omit

xml_whitespace_handling

  • xliff

  • poxliff

  • apple-xliff

  • xliff2

Baratanje razmacima

Controls how XLIFF whitespace is handled. Follow xml:space honors attributes in the file. Always preserve keeps all whitespace. Always normalize collapses whitespace even when xml:space=”preserve” is set.

Dostupne mogućnosti:

standard

Slijedi xml:space

preserve

Uvijek zadrži

normalize

Uvijek normaliziraj

yaml_indent

  • yaml

  • ruby-yaml

YAML uvlake

yaml_line_break

  • yaml

  • ruby-yaml

Prijelomi redaka

Dostupne mogućnosti:

dos

DOS (\r\n)

unix

UNIX (\n)

mac

MAC (\r)

yaml_line_wrap

  • yaml

  • ruby-yaml

Prelamanje dugačkih redaka

Dostupne mogućnosti:

80

Prelomi retke nakon 80 znakova

100

Prelomi retke nakon 100 znakova

120

Prelomi retke nakon 120 znakova

180

Prelomi retke nakon 180 znakova

65535

Bez prelamanja redaka