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.
Vedi anche
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.
Vedi anche
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 |
|
Codifica file |
Codifica usata per i file CSV Scelte disponibili:
|
csv_escape_formulas |
|
Escape spreadsheet formulas |
Prefix values that look like spreadsheet formulas with an apostrophe when saving CSV files. |
csv_simple_encoding |
|
Codifica file |
Codifica usata per i file CSV semplici Scelte disponibili:
|
dos_eol |
All file formats |
Fine riga DOS |
Use DOS line endings (rn) instead of UNIX line endings (n) in strings. |
flatxml_key_name |
|
Nome chiave FlatXML |
|
flatxml_root_name |
|
Nome radice FlatXML |
|
flatxml_value_name |
|
Nome valore FlatXML |
|
gwt_encoding |
|
Codifica file |
Codifica usata per i file GWT Properties Scelte disponibili:
|
json_indent |
|
Indentazione JSON |
|
json_indent_style |
|
Stile indentazione JSON |
Scelte disponibili:
|
json_sort_keys |
|
Ordina le chiavi JSON |
|
json_use_compact_separators |
|
Evita gli spazi dopo i separatori |
|
line_max_length |
|
Maximum line length |
The maximum number of characters for each line in the output file. |
md_extract_code_blocks |
|
Extract code blocks |
Whether to extract translatable content from code blocks in Markdown and MDX files. |
md_extract_frontmatter |
|
Extract front matter |
Whether to extract and translate YAML front matter blocks in Markdown and MDX files. |
md_frontmatter_translate_values |
|
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 |
|
Disable placeholders |
Disables detection and processing of placeholders in Markdown and MDX files. |
merge_duplicates |
|
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 |
|
Usa corrispondenza parziale |
|
po_keep_previous |
|
Conserva i precedenti msgid delle stringhe tradotte |
Controls previous msgid comments for fuzzy strings. |
po_line_wrap |
|
Righe lunghe a capo |
Per impostazione predefinita, gettext manda a capo le righe a 77 caratteri e a capo. Con il parametro Scelte disponibili:
|
po_no_location |
|
Non includere informazioni sulla posizione nel file |
|
po_remove_obsolete |
|
Remove obsolete strings |
Remove obsolete entries from PO files when saving translation changes or updating from a POT file. |
po_report_msgid_bugs_to |
|
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 |
|
Update language team header |
Lets Weblate update the «Language-Team» file header. |
po_set_last_translator |
|
Update last translator header |
Lets Weblate update the «Last-Translator» file header. |
po_set_x_generator |
|
Update X-Generator header |
Lets Weblate update the «X-Generator» file header. |
properties_encoding |
|
Codifica file |
Codifica usata per i file Java Properties Scelte disponibili:
|
strings_encoding |
|
Codifica file |
Codifica usata per i file di stringhe iOS Scelte disponibili:
|
xml_closing_tags |
|
Includi tag di chiusura per tag XML vuoti |
|
yaml_indent |
|
Indentazione YAML |
|
yaml_line_break |
|
Interruzioni linea |
Scelte disponibili:
|
yaml_line_wrap |
|
Righe lunghe a capo |
Scelte disponibili:
|