Formatos de ficheiros suportados¶
Weblate supports most translation format understood by translate-toolkit, however each format being slightly different, some issues with formats that are not well tested can arise.
Veja também
Nota
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.
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, XLIFF or Apple iOS strings). 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 Android string resources). 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 Ficheiro de idioma base monolingue within Weblate, though the naming might vary in your paradigm.
Additionally this workflow can be extended by utilizing Ficheiro de idioma intermédio to include strings provided by developers, but not to be used as is in the final strings.
Deteção automática¶
Weblate can automatically detect several widespread file formats, but this detection can harm your performance and will limit features specific to given file format (for example automatic addition of new translations).
Translation types capabilities¶
Capabilities of all supported formats:
Format |
Linguality 1 |
Plurals 2 |
Comments 3 |
Context 4 |
Location 5 |
Flags 8 |
Additional states 6 |
---|---|---|---|---|---|---|---|
bilingual |
yes |
yes |
yes |
yes |
yes 9 |
needs editing |
|
mono |
yes |
yes |
yes |
yes |
yes 9 |
needs editing |
|
both |
yes |
yes |
yes |
yes |
yes 10 |
needs editing, approved |
|
both |
no |
yes |
no |
no |
no |
||
mono |
yes |
yes |
no |
no |
no |
||
mono |
no |
yes |
no |
yes |
no |
||
both |
yes |
yes |
no |
yes |
yes 10 |
needs editing |
|
mono |
yes |
yes 7 |
no |
no |
yes 10 |
||
bilingual |
no |
yes |
no |
no |
no |
||
mono |
no 11 |
yes |
no |
no |
no |
||
mono |
no |
no |
no |
no |
no |
||
mono |
yes |
no |
no |
no |
no |
||
mono |
yes |
no |
no |
no |
no |
||
mono |
yes |
yes |
no |
no |
no |
||
mono |
yes |
yes |
no |
no |
no |
||
mono |
no |
yes |
no |
no |
yes 10 |
||
mono |
no |
yes |
yes |
yes |
no |
needs editing |
|
mono |
no |
yes |
no |
no |
no |
||
mono |
yes |
yes |
no |
no |
no |
||
mono |
no |
no |
no |
no |
no |
||
mono |
no |
no |
no |
no |
yes 10 |
||
mono |
no |
yes |
no |
no |
no |
||
mono |
no |
yes |
yes |
yes |
no |
needs editing |
|
mono |
no |
no |
no |
no |
no |
||
mono |
no |
no |
no |
yes |
no |
||
mono |
no |
no |
no |
no |
no |
||
mono |
no |
no |
no |
no |
no |
||
mono |
no |
no |
no |
no |
no |
||
mono |
no |
no |
no |
no |
no |
||
mono |
no |
no |
no |
no |
no |
- 1
- 2
Plurals are necessary to properly localize strings with variable count.
- 3
Comments can be used to pass additional info about the string to translate.
- 4
Context is used to differentiate identical strings 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).
- 5
Location of a string in source code might help proficient translators figure out how the string is used.
- 6
Additional states supported by the file format in addition to «Not translated» and «Translated».
- 7
XML comment placed before the
<string>
element, parsed as a developer comment.- 8
- 9(1,2)
The gettext type comments are used as flags.
- 10(1,2,3,4,5)
The flags are extracted from the non-standard attribute
weblate-flags
for all XML based formats. Additionallymax-length:N
is supported through themaxwidth
attribute as defined in the XLIFF standard, see Specifying translation flags.- 11
The plurals are supported only for Laravel which uses in string syntax to define them, see Localization in Laravel.
GNU gettext¶
Most widely used format for translating libre software. This was first format supported by Weblate and still has the best support.
Contextual info stored in the file is supported by adjusting its headers or linking to corresponding source files.
The bilingual gettext PO file typically looks like this:
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "Monday"
msgstr "Pondělí"
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "Tuesday"
msgstr "Úterý"
#: weblate/accounts/avatar.py:163
msgctxt "No known user"
msgid "None"
msgstr "Žádný"
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
Empty |
Modelo para novas traduções |
|
Formato de ficheiro |
Gettext PO file |
Veja também
Translating software using GNU Gettext, Translating documentation using Sphinx, Gettext on Wikipedia, PO Files, Atualizar variável ALL_LINGUAS no ficheiro «configure», Personalizar a saída gettext, Atualizar ficheiro LINGUAS, Gerar ficheiros MO, Atualizar ficheiros PO para coincidir com POT (msgmerge)
Monolingual gettext¶
Some projects decide to use gettext as monolingual formats—they code just the IDs in their source code and the string then needs to be translated to all languages, including English. This is supported, though you have to choose this file format explicitly when importing components into Weblate.
The monolingual gettext PO file typically looks like this:
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "day-monday"
msgstr "Pondělí"
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "day-tuesday"
msgstr "Úterý"
#: weblate/accounts/avatar.py:163
msgid "none-user"
msgstr "Žádný"
While the base language file will be:
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "day-monday"
msgstr "Monday"
#: weblate/media/js/bootstrap-datepicker.js:1421
msgid "day-tuesday"
msgstr "Tuesday"
#: weblate/accounts/avatar.py:163
msgid "none-user"
msgstr "None"
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
|
Formato de ficheiro |
Gettext PO file (monolingual) |
XLIFF¶
XML-based format created to standardize translation files, but in the end it is one of many standards, in this area.
XML Localization Interchange File Format (XLIFF) is usually used as bilingual, but Weblate supports it as monolingual as well.
Veja também
XML Localization Interchange File Format (XLIFF) specification
Translation states¶
Alterado na versão 3.3: Weblate ignored the state attribute prior to the 3.3 release.
The state
attribute in the file is partially processed and mapped to the
«Needs edit» state in Weblate (the following states are used to flag the string as
needing edit if there is a target present: new
, needs-translation
,
needs-adaptation
, needs-l10n
). Should the state
attribute be
missing, a string is considered translated as soon as a <target>
element
exists.
If the translation string has approved="yes"
, it will also be imported into Weblate
as «Approved», anything else will be imported as «Waiting for review» (which matches the
XLIFF specification).
While saving, Weblate doesn’t add those attributes unless necessary:
The
state
attribute is only added in case string is marked as needing edit.The
approved
attribute is only added in case string has been reviewed.In other cases the attributes are not added, but they are updated in case they are present.
That means that when using the XLIFF format, it is strongly recommended to turn on the Weblate review process, in order to see and change the approved state of strings.
See Revisores dedicados.
Similarly upon importing such files (in the upload form), you should choose Import as translated under Processing of strings needing edit.
Whitespace and newlines in XLIFF¶
Generally types or amounts of whitespace is not differentiated between in XML formats.
If you want to keep it, you have to add the xml:space="preserve"
flag to
the string.
Por exemplo:
<trans-unit id="10" approved="yes">
<source xml:space="preserve">hello</source>
<target xml:space="preserve">Hello, world!
</target>
</trans-unit>
Specifying translation flags¶
You can specify additional translation flags (see Personalizar o comportamento) by
using the weblate-flags
attribute. Weblate also understands maxwidth
and font
attributes from the XLIFF specification:
<trans-unit id="10" maxwidth="100" size-unit="pixel" font="ubuntu;22;bold">
<source>Hello %s</source>
</trans-unit>
<trans-unit id="20" maxwidth="100" size-unit="char" weblate-flags="c-format">
<source>Hello %s</source>
</trans-unit>
The font
attribute is parsed for font family, size and weight, the above
example shows all of that, though only font family is required. Any whitespace
in the font family is converted to underscore, so Source Sans Pro
becomes
Source_Sans_Pro
, please keep that in mind when naming the font group (see
Gerir letras).
Typical Weblate Component configuration for bilingual XLIFF |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
Empty |
Modelo para novas traduções |
|
Formato de ficheiro |
XLIFF Translation File |
Typical Weblate Component configuration for monolingual XLIFF |
|
---|---|
File mask |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
|
Formato de ficheiro |
XLIFF Translation File |
Java properties¶
Native Java format for translations.
Java properties are usually used as monolingual translations.
Weblate supports ISO-8859-1, UTF-8 and UTF-16 variants of this format. All of
them support storing all Unicode characters, it is just differently encoded.
In the ISO-8859-1, the Unicode escape sequences are used (for example zkou\u0161ka
),
all others encode characters directly either in UTF-8 or UTF-16.
Nota
Loading escape sequences works in UTF-8 mode as well, so please be careful choosing the correct encoding set to match your application needs.
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
Empty |
Formato de ficheiro |
Java Properties (ISO-8859-1) |
GWT properties¶
Native GWT format for translations.
GWT properties are usually used as monolingual translations.
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
Empty |
Formato de ficheiro |
GWT Properties |
INI translations¶
Novo na versão 4.1.
INI file format for translations.
INI translations are usually used as monolingual translations.
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
Empty |
Formato de ficheiro |
INI File |
Veja também
Inno Setup INI translations¶
Novo na versão 4.1.
Inno Setup INI file format for translations.
Inno Setup INI translations are usually used as monolingual translations.
Nota
The only notable difference to INI translations is in supporting %n
and %t
placeholders for line break and tab.
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
Empty |
Formato de ficheiro |
Inno Setup INI File |
Nota
Only Unicode files (.islu
) are currently supported, ANSI variant
(.isl
) is currently not supported.
Veja também
Joomla translations¶
Novo na versão 2.12.
Native Joomla format for translations.
Joomla translations are usually used as monolingual translations.
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
Empty |
Formato de ficheiro |
Joomla Language File |
Qt Linguist .ts¶
Translation format used in Qt based applications.
Qt Linguist files are used as both bilingual and monolingual translations.
Typical Weblate Component configuration when using as bilingual |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
Empty |
Modelo para novas traduções |
|
Formato de ficheiro |
Qt Linguist Translation File |
Typical Weblate Component configuration when using as monolingual |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
|
Formato de ficheiro |
Qt Linguist Translation File |
Veja também
Qt Linguist manual, Qt .ts, Bilingual and monolingual formats
Android string resources¶
Android specific file format for translating applications.
Android string resources are monolingual, the
Monolingual base language file file is stored in a different
location from the others res/values/strings.xml
.
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
Empty |
Formato de ficheiro |
Android String Resource |
Nota
Android string-array structures are not currently supported. To work around this, you can break your string arrays apart:
<string-array name="several_strings">
<item>First string</item>
<item>Second string</item>
</string-array>
become:
<string-array name="several_strings">
<item>@string/several_strings_0</item>
<item>@string/several_strings_1</item>
</string-array>
<string name="several_strings_0">First string</string>
<string name="several_strings_1">Second string</string>
The string-array that points to the string elements should be stored in a different file, and not be made available for translation.
This script may help pre-process your existing strings.xml files and translations: https://gist.github.com/paour/11291062
Apple iOS strings¶
Apple specific file format for translating applications, used for both iOS and iPhone/iPad application translations.
Apple iOS strings are usually used as bilingual translations.
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
Empty |
Formato de ficheiro |
iOS Strings (UTF-8) |
Veja também
Cadeias de PHP¶
PHP translations are usually monolingual, so it is recommended to specify a base file with (what is most often the) English strings.
Example file:
<?php
$LANG['foo'] = 'bar';
$LANG['foo1'] = 'foo bar';
$LANG['foo2'] = 'foo bar baz';
$LANG['foo3'] = 'foo bar baz bag';
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
|
Formato de ficheiro |
PHP strings |
Cadeias de PHP Laravel¶
Alterado na versão 4.1.
The Laravel PHP localization files are supported as well with plurals:
<?php
return [
'apples' => 'There is one apple|There are many apples',
];
Veja também
JSON files¶
Novo na versão 2.0.
Alterado na versão 2.16: Since Weblate 2.16 and with translate-toolkit at-least 2.2.4, nested structure JSON files are supported as well.
JSON format is used mostly for translating applications implemented in JavaScript.
Weblate currently supports several variants of JSON translations:
Simple key / value files.
Files with nested keys.
JSON translations are usually monolingual, so it is recommended to specify a base file with (what is most often the) English strings.
Example file:
{
"Hello, world!\n": "Ahoj světe!\n",
"Orangutan has %d banana.\n": "",
"Try Weblate at https://demo.weblate.org/!\n": "",
"Thank you for using Weblate.": ""
}
Nested files are supported as well (see above for requirements), such a file can look like:
{
"weblate": {
"hello": "Ahoj světe!\n",
"orangutan": "",
"try": "",
"thanks": ""
}
}
Aviso
Weblate currently handles nested JSON by flattening the keys. This leads to
serializing issues when special chars such as .
or []
are used in
the actual keys, because Weblate thinks it is indication of nesting.
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
Empty |
Formato de ficheiro |
JSON nested structure file |
Veja também
JSON, Personalizar a saída JSON, Limpeza de ficheiros de tradução,
JSON i18next files¶
Alterado na versão 2.17: Since Weblate 2.17 and with translate-toolkit at-least 2.2.5, i18next JSON files with plurals are supported as well.
i18next is an internationalization framework written in and for JavaScript. Weblate supports its localization files with features such as plurals.
i18next translations are monolingual, so it is recommended to specify a base file with (what is most often the) English strings.
Nota
Weblate supports the i18next JSON v3 format. The v2 and v1 variants are mostly compatible, with exception of how plurals are handled.
Example file:
{
"hello": "Hello",
"apple": "I have an apple",
"apple_plural": "I have {{count}} apples",
"apple_negative": "I have no apples"
}
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
Empty |
Formato de ficheiro |
i18next JSON file |
go-i18n JSON files¶
Novo na versão 4.1.
go-i18n translations are monolingual, so it is recommended to specify a base file with (what is most often the) English strings.
Nota
Weblate supports the go-i18n JSON v2 format, it does not support flat JSON files supported in v1.
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
Empty |
Formato de ficheiro |
go-i18n JSON file |
Veja também
JSON, go-i18n, Personalizar a saída JSON, Limpeza de ficheiros de tradução,
ARB File¶
Novo na versão 4.1.
ARB translations are monolingual, so it is recommended to specify a base file with (what is most often the) English strings.
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
Empty |
Formato de ficheiro |
ARB file |
WebExtension JSON¶
Novo na versão 2.16: This is supported since Weblate 2.16 and with translate-toolkit at-least 2.2.4.
File format used when translating extensions for Mozilla Firefox or Google Chromium.
Nota
While this format is called JSON, its specification allows to include comments, which are not part of JSON specification. Weblate currently does not support file with comments.
Example file:
{
"hello": {
"message": "Ahoj světe!\n",
"description": "Description",
"placeholders": {
"url": {
"content": "$1",
"example": "https://developer.mozilla.org"
}
}
},
"orangutan": {
"message": "",
"description": "Description"
},
"try": {
"message": "",
"description": "Description"
},
"thanks": {
"message": "",
"description": "Description"
}
}
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
Empty |
Formato de ficheiro |
WebExtension JSON file |
Veja também
JSON, Google chrome.i18n, Mozilla Extensions Internationalization
.XML resource files¶
Novo na versão 2.3.
A .XML resource (.resx) file employs a monolingual XML file format used in Microsoft .NET applications. It is interchangeable with .resw, when using identical syntax to .resx.
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
Empty |
Formato de ficheiro |
.NET resource file |
Veja também
.NET Resource files (.resx), Limpeza de ficheiros de tradução,
CSV files¶
Novo na versão 2.4.
CSV files can contain a simple list of source and translation. Weblate supports the following files:
Files with header defining fields (source, translation, location, …). This is the recommended approach, as it is the least error prone.
Files with two fields—source and translation (in this order), choose Simple CSV file as file format
Files with fields as defined by translate-toolkit: location, source, target, ID, fuzzy, context, translator_comments, developer_comments
Aviso
The CSV format currently automatically detects the dialect of the CSV file. In some cases the automatic detection might fail and you will get mixed results. This is especially true for CSV files with newlines in the values. As a workaround it is recommended to omit quoting characters.
Example file:
Thank you for using Weblate.,Děkujeme za použití Weblate.
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
Empty |
Modelo para novas traduções |
|
Formato de ficheiro |
CSV file |
Veja também
YAML files¶
Novo na versão 2.9.
The plain YAML files with string keys and values. Weblate also extract strings from lists or dictionaries.
Example of a YAML file:
weblate:
hello: ""
orangutan": ""
try": ""
thanks": ""
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
Empty |
Formato de ficheiro |
YAML file |
Veja também
Ruby YAML files¶
Novo na versão 2.9.
Ruby i18n YAML files with language as root node.
Example Ruby i18n YAML file:
cs:
weblate:
hello: ""
orangutan: ""
try: ""
thanks: ""
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
Empty |
Formato de ficheiro |
Ruby YAML file |
Veja também
DTD files¶
Novo na versão 2.18.
Example DTD file:
<!ENTITY hello "">
<!ENTITY orangutan "">
<!ENTITY try "">
<!ENTITY thanks "">
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
Empty |
Formato de ficheiro |
DTD file |
Veja também
Flat XML files¶
Novo na versão 3.9.
Example of a flat XML file:
<?xml version='1.0' encoding='UTF-8'?>
<root>
<str key="hello_world">Hello World!</str>
<str key="resource_key">Translated value.</str>
</root>
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
Empty |
Formato de ficheiro |
Flat XML file |
Veja também
Windows RC files¶
Alterado na versão 4.1: Support for Windows RC files has been rewritten.
Nota
Support for this format is currently in beta, feedback from testing is welcome.
Example Windows RC file:
LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
STRINGTABLE
BEGIN
IDS_MSG1 "Hello, world!\n"
IDS_MSG2 "Orangutan has %d banana.\n"
IDS_MSG3 "Try Weblate at http://demo.weblate.org/!\n"
IDS_MSG4 "Thank you for using Weblate."
END
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
|
Formato de ficheiro |
RC file |
Veja também
Ficheiros de metadados da App Store¶
Novo na versão 3.5.
Metadata used for publishing apps in various app stores can be translated. Currently the following tools are compatible:
The metadata consists of several textfiles, which Weblate will present as separate strings to translate.
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
|
Formato de ficheiro |
App store metadata files |
Subtitle files¶
Novo na versão 3.7.
Weblate pode traduzir vários ficheiros de legenda:
SubRip subtitle file (
*.srt
)MicroDVD subtitle file (
*.sub
)Advanced Substation Alpha subtitles file (
*.ass
)Substation Alpha subtitle file (
*.ssa
)
Typical Weblate Component configuration |
|
---|---|
Máscara de ficheiro |
|
Ficheiro de idioma base monolingue |
|
Modelo para novas traduções |
|
Formato de ficheiro |
SubRip subtitle file |
Veja também
Excel Open XML¶
Novo na versão 3.2.
Excel Open XML (.xlsx) files can be imported and exported.
When uploading XLSX files for translation, be aware that only the active
worksheet is considered, and there must be at least a column called source
(which contains the source string) and a column called target
(which
contains the translation). Additionally there should be the column called context
(which contains the context path of the translation string). If you use the XLSX
download for exporting the translations into an Excel workbook, you already get
a file with the correct file format.
HTML files¶
Novo na versão 4.1.
Nota
Support for this format is currently in beta, feedback from testing is welcome.
The translatable content is extracted from the HTML files and offered for the translation.
Veja também
OpenDocument Format¶
Novo na versão 4.1.
Nota
Support for this format is currently in beta, feedback from testing is welcome.
The translatable content is extracted from the OpenDocument files and offered for the translation.
Veja também
IDML Format¶
Novo na versão 4.1.
Nota
Support for this format is currently in beta, feedback from testing is welcome.
The translatable content is extracted from the Adobe InDesign Markup Language files and offered for the translation.
Outros¶
Most formats supported by translate-toolkit which support serializing can be easily supported, but they did not (yet) receive any testing. In most cases some thin layer is needed in Weblate to hide differences in behavior of different translate-toolkit storages.
Veja também
Adding new translations¶
Alterado na versão 2.18: In versions prior to 2.18 the behaviour of adding new translations was file format specific.
Weblate can automatically start new translation for all of the file formats.
Some formats expect to start with an empty file and only translated strings to be included (for example Android string resources), while others expect to have all keys present (for example GNU gettext). In some situations this really doesn’t depend on the format, but rather on the framework you use to handle the translation (for example with JSON files).
When you specify Modelo para novas traduções in Component configuration, Weblate will use this file to start new translations. Any exiting translations will be removed from the file when doing so.
When Template for new translations is empty and the file format supports it, an empty file is created where new strings will be added once they are translated.
The Language code style allows you to customize language code used in generated filenames:
- Predefinição baseada no formato do ficheiro
Dependent on file format, for most of them POSIX is used.
- Estilo POSIX utilizando o sublinhado como um separador
Typically used by gettext and related tools, produces language codes like pt_BR.
- Estilo de POSIX utilizando o sublinhado como um separador, incluindo o código do país
POSIX style language code including the country code even when not necessary (for example “cs_CZ”).
- Estilo BCP utilizando o hífen como um separador
Typically used on web platforms, produces language codes like pt-BR.
- Estilo de BCP utilizando o hífen como um separador, incluindo o código do país
BCP style language code including the country code even when not necessary (for example “cs-CZ”).
- Estilo Android
Only used in Android apps, produces language codes like pt-rBR.
- Estilo Java
Used by Java—mostly BCP with legacy codes for Chinese.
Nota
Weblate recognizes any of these when parsing translation files, the above settings only influences how new files are created.
Cadeias somente leitura¶
Novo na versão 3.10.
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 and Android string resources), but can be emulated in others by adding a
read-only
flag, see Personalizar o comportamento.