JSON datoteke¶
Promijenjeno u verziji 4.3: The structure of JSON file is properly preserved even for complex situations which were broken in prior releases.
JSON format se uglavnom koristi za prevođenje aplikacija implementiranih u JavaScriptu.
Weblate trenutačno podržava nekoliko varijanti JSON prijevoda:
Simple key / value files, used for example by vue-i18n or react-intl.
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.
Savjet
The JSON file and JSON nested structure file can both handle same type of files. Both preserve existing JSON structure when translating.
The only difference between them is when adding new strings using Weblate.
The nested structure format parses the newly added key and inserts the new
string into the matching structure. For example app.name key is inserted as:
{
"app": {
"name": "Weblate"
}
}
Više informacija
Example files¶
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": ""
}
}
Datotečni sufiks |
|
|---|---|
Jezičnost ⓘ |
Jednojezične i dvojezične |
Podržava množinu ⓘ |
|
Podržava opise ⓘ |
|
Podržava objašnjenja ⓘ |
|
Podržava kontekst ⓘ |
|
Podržava mjesto ⓘ |
|
Podržava oznake ⓘ |
|
Identifikator API-ja |
|
Podržava izraze koji su samo-za-čitanje ⓘ |
|
Supports removing obsolete strings ⓘ |
|
Weblate konfiguracija¶
Typical Weblate Konfiguracija komponente |
|
|---|---|
Maska datoteke |
|
Jednojezična datoteka osnovnog jezika |
|
Predložak za nove prijevode |
Empty |
Format datoteke |
JSON nested structure file |
Parametri formata datoteke¶
Parametri formata datoteke with the pattern json_* can be used to configure the behavior of the JSON format.