<a id="json"></a>

# Plik JSON

<a id="index-0"></a>

#### Versionchanged
Zmienione w wersji 4.3: The structure of JSON file is properly preserved even for complex
situations which were broken in prior releases.

JSON format is used mostly for translating applications implemented in
JavaScript.

Weblate currently supports several variants of JSON translations:

* Simple key / value files, used for example by vue-i18n or react-intl.
* Pliki z zagnieżdżonymi kluczami.
* [Pliki JSON i18next](https://docs.weblate.org/pl/weblate-2026.11/formats/i18next.md#js-i18next)
* [Pliki JSON go-i18n](https://docs.weblate.org/pl/weblate-2026.11/formats/go-i18n.md#go-i18n-json)
* [Pliki JSON gotext](https://docs.weblate.org/pl/weblate-2026.11/formats/gotext.md#gotext-json)
* [JSON WebExtension](https://docs.weblate.org/pl/weblate-2026.11/formats/webextension.md#webex)
* [Plik ARB](https://docs.weblate.org/pl/weblate-2026.11/formats/arb.md#arb)
* [JavaScript Resource Files (RESJSON)](https://docs.weblate.org/pl/weblate-2026.11/formats/resjson.md)
* [Nextcloud Apps JSON files](https://docs.weblate.org/pl/weblate-2026.11/formats/nextcloud-json.md)

JSON translations are usually monolingual, so it is recommended to specify a base
file with (what is most often the) English strings.

#### HINT
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:

```json
{
   "app": {
      "name": "Weblate"
   }
}
```

#### SEE ALSO
* [JSON](https://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/json.html)
* [Updating target-language files](https://docs.weblate.org/pl/weblate-2026.11/devel/integration.md#updating-target-files)
* [Parametry formatu pliku](https://docs.weblate.org/pl/weblate-2026.11/formats.md#file-format-params)
* [Wyczyść pliki tłumaczenia](https://docs.weblate.org/pl/weblate-2026.11/admin/addons.md#addon-weblate-cleanup-generic)

## Przykładowe pliki

Przykładowy plik:

```json
{
  "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:

```json
{
  "weblate": {
    "hello": "Ahoj světe!\n",
    "orangutan": "",
    "try": "",
    "thanks": ""
  }
}
```

<!-- AUTOGENERATED START: format-features json -->
<!-- This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. -->

#### Supported features

| File extensions                                                                                      | `.json`                        |
|------------------------------------------------------------------------------------------------------|--------------------------------|
| Linguality [ⓘ](https://docs.weblate.org/pl/weblate-2026.11/formats.md#bimono)                                   | Both monolingual and bilingual |
| Supports plural [ⓘ](https://docs.weblate.org/pl/weblate-2026.11/formats.md#format-plurals)                      | `No`                           |
| Supports descriptions [ⓘ](https://docs.weblate.org/pl/weblate-2026.11/formats.md#format-description)            | `No`                           |
| Supports explanation [ⓘ](https://docs.weblate.org/pl/weblate-2026.11/formats.md#format-explanation)             | `No`                           |
| Supports context [ⓘ](https://docs.weblate.org/pl/weblate-2026.11/formats.md#format-context)                     | `No`                           |
| Supports location [ⓘ](https://docs.weblate.org/pl/weblate-2026.11/formats.md#format-location)                   | `No`                           |
| Supports flags [ⓘ](https://docs.weblate.org/pl/weblate-2026.11/formats.md#format-flags)                         | `No`                           |
| API identifier                                                                                       | `json`, `json-nested`          |
| Supports read-only strings [ⓘ](https://docs.weblate.org/pl/weblate-2026.11/formats.md#read-only-strings)        | `No`                           |
| Supports removing obsolete strings [ⓘ](https://docs.weblate.org/pl/weblate-2026.11/formats.md#obsolete-strings) | `No`                           |
<!-- AUTOGENERATED END: format-features json -->

## Konfiguracja Weblate

|                                  | Typowy Weblate [Konfiguracja komponentu](https://docs.weblate.org/pl/weblate-2026.11/admin/projects.md#component)   |
|----------------------------------|---------------------------------------------------------------------------------------------------|
| Maska pliku                      | `langs/translation-*.json`                                                                        |
| Jednojęzyczny bazowy plik języka | `langs/translation-en.json`                                                                       |
| Szablon dla nowych tłumaczeń     | Puste                                                                                             |
| Format pliku                     | JSON nested structure file                                                                        |

## Parametry formatu pliku

[Parametry formatu pliku](https://docs.weblate.org/pl/weblate-2026.11/formats.md#file-format-params) with the pattern json_\* can be used to configure the behavior of the JSON format.
