Formati dei file di localizzazione

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

Suggerimento

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.

Rilevamento automatico

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 Formato file 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.

Bilingual and monolingual formats

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 e 1.2 or Stringhe 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 Risorse stringa Android). 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 File di lingua a base monolingue within Weblate, though the naming might vary in your paradigm.

Additionally this workflow can be extended by utilizing File di lingua intermedio to include strings provided by developers, but not to be used as is in the final strings.

Stati di stringa

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

Descrizione stringa sorgente

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 e 1.2, GNU gettext PO (Portable Object), Estensione Web JSON, File CSV, Open XML di Excel, Linguista Qt .ts, File JSON go-i18n, File JSON gotext, File ARB, File di risorse .NET (RESX, RESW)). Many other formats extract closest comment as source string description.

Spiegazione

The Spiegazione on strings can be stored and parsed from a few file formats.

Attualmente supportato solo in Formato TermBase eXchange.

Posizione stringa sorgente

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 Linguista Qt .ts.

Flag traduzione

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 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 Specifying translation flags.

Contesto

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.

Stringhe pluralizzate

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.

Suggerimento

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

Stringhe sola lettura

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 e 1.2 and Risorse stringa Android), 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.

Supporta altri formati

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 del formato file

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.

Elenco dei parametri del formato file

Nome del parametro

Formati file

Etichetta

Testo di aiuto

csv_encoding

  • csv

  • csv-multi

Codifica file

Codifica usata per i file CSV

Scelte disponibili:

auto

Rilevamento automatico

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

Codifica file

Codifica usata per i file CSV semplici

Scelte disponibili:

auto

Rilevamento automatico

utf-8

UTF-8

iso-8859-1

ISO-8859-1

dos_eol

All file formats

Fine riga DOS

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

flatxml_key_name

  • flatxml

Nome chiave FlatXML

flatxml_root_name

  • flatxml

Nome radice FlatXML

flatxml_value_name

  • flatxml

Nome valore FlatXML

gwt_encoding

  • gwt

Codifica file

Codifica usata per i file GWT Properties

Scelte disponibili:

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

Indentazione JSON

json_indent_style

  • json

  • json-nested

  • webextension

  • i18next

  • i18nextv4

  • arb

  • go-i18n-json

  • go-i18n-json-v2

  • formatjs

  • gotext

Stile indentazione JSON

Scelte disponibili:

spaces

Spazi

tabs

Tabulazioni

json_sort_keys

  • json

  • json-nested

  • webextension

  • i18next

  • i18nextv4

  • arb

  • go-i18n-json

  • go-i18n-json-v2

  • formatjs

  • gotext

Ordina le chiavi JSON

json_use_compact_separators

  • json

  • json-nested

  • webextension

  • i18next

  • i18nextv4

  • arb

  • go-i18n-json

  • go-i18n-json-v2

  • formatjs

  • gotext

Evita gli spazi dopo i separatori

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

Deduplica stringhe identiche

Consolida stringhe sorgente identiche in un’unica unità di traduzione. Previene la perdita di traduzione durante la ristrutturazione dei file o il riordino delle tabelle rimuovendo il contesto dipendente dalla posizione.

po_fuzzy_matching

  • po

Usa corrispondenza parziale

po_keep_previous

  • po

Conserva i precedenti msgid delle stringhe tradotte

Controls previous msgid comments for fuzzy strings.

po_line_wrap

  • po

  • po-mono

Righe lunghe a capo

Per impostazione predefinita, gettext manda a capo le righe a 77 caratteri e a capo. Con il parametro --no-wrap, il ritorno a capo viene eseguito solo sui ritorni a capo.

Scelte disponibili:

77

A capo automatico dopo 77 caratteri e alle nuove righe (impostazione predefinita xgettext)

65535

Vai a capo solo nelle righe di ritorno a capo (come xgettext --no-wrap)

-1

Nessun ritorno a capo

po_no_location

  • po

Non includere informazioni sulla posizione nel file

po_remove_obsolete

  • po

  • po-mono

Remove obsolete strings

Remove obsolete entries from PO files when saving translation changes or updating from a POT file.

po_report_msgid_bugs_to

  • po

  • po-mono

Report msgid bugs to

Lets Weblate update the «Report-Msgid-Bugs-To» file header if Source string bug reporting address is set.

po_set_language_team

  • po

  • po-mono

Update language team header

Lets Weblate update the «Language-Team» file header.

po_set_last_translator

  • po

  • po-mono

Update last translator header

Lets Weblate update the «Last-Translator» file header.

po_set_x_generator

  • po

  • po-mono

Update X-Generator header

Lets Weblate update the «X-Generator» file header.

properties_encoding

  • properties

Codifica file

Codifica usata per i file Java Properties

Scelte disponibili:

iso-8859-1

ISO-8859-1

utf-8

UTF-8

utf-16

UTF-16

strings_encoding

  • strings

Codifica file

Codifica usata per i file di stringhe iOS

Scelte disponibili:

utf-8

UTF-8

utf-16

UTF-16

xml_closing_tags

  • ts

  • plainxliff

  • xliff

  • xliff2

  • xliff2-placeables

  • poxliff

  • apple-xliff

  • resx

  • aresource

  • moko-resource

  • cmp-resource

  • tbx

Includi tag di chiusura per tag XML vuoti

yaml_indent

  • yaml

  • ruby-yaml

Indentazione YAML

yaml_line_break

  • yaml

  • ruby-yaml

Interruzioni linea

Scelte disponibili:

dos

DOS (\r\n)

unix

UNIX (\n)

mac

MAC (\r)

yaml_line_wrap

  • yaml

  • ruby-yaml

Righe lunghe a capo

Scelte disponibili:

80

A capo automatico dopo 80 caratteri

100

A capo automatico dopo 100 caratteri

120

A capo automatico dopo 120 caratteri

180

A capo automatico dopo 180 caratteri

65535

Nessun ritorno a capo