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

# Fișiere JSON

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

#### Versionchanged
Schimbat în versiunea 4.3: Structura fișierului JSON este păstrată în mod corespunzător chiar și în cazul situațiilor complexe, care erau afectate în versiunile anterioare.

Formatul JSON este utilizat în principal pentru traducerea aplicațiilor implementate în JavaScript.

Weblate acceptă în prezent mai multe variante de traduceri JSON:

* Fișiere simple de chei / valori, utilizate, de exemplu, de vue-i18n sau react-intl.
* Fișiere cu chei imbricate.
* [Fișiere i18next JSON](https://docs.weblate.org/ro/latest/formats/i18next.md#js-i18next)
* [fișiere JSON go-i18n](https://docs.weblate.org/ro/latest/formats/go-i18n.md#go-i18n-json)
* [Fișiere gotext JSON](https://docs.weblate.org/ro/latest/formats/gotext.md#gotext-json)
* [JSON WebExtension](https://docs.weblate.org/ro/latest/formats/webextension.md#webex)
* [Fișier ARB](https://docs.weblate.org/ro/latest/formats/arb.md#arb)
* [JavaScript Resource Files (RESJSON)](https://docs.weblate.org/ro/latest/formats/resjson.md)
* [Nextcloud Apps JSON files](https://docs.weblate.org/ro/latest/formats/nextcloud-json.md)

Traducerile JSON sunt, de obicei, monolingve, astfel încât se recomandă să specificați un fișier de bază cu (ceea ce este cel mai adesea) șiruri de caractere în limba engleză.

#### HINT
JSON file și JSON nested structure file pot gestiona același tip de fișiere. Ambele păstrează structura JSON existentă în timpul traducerii.

Singura diferență între ele este atunci când se adaugă șiruri noi folosind Weblate. Formatul structurii imbricate analizează cheia nou adăugată și introduce noul șir în structura corespunzătoare. De exemplu, cheia `app.name` este inserată ca:

```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/ro/latest/devel/integration.md#updating-target-files)
* [File format parameters](https://docs.weblate.org/ro/latest/formats.md#file-format-params)
* [Curăță fișierele de traducere](https://docs.weblate.org/ro/latest/admin/addons.md#addon-weblate-cleanup-generic)

## Example files

Exemplu de fișier:

```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.": ""
}
```

Fișierele imbricate sunt, de asemenea, acceptate (a se vedea mai sus pentru cerințe), un astfel de fișier poate arăta ca:

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

## Configurație Weblate

|                                    | Tipic Weblate [Configurația componentei](https://docs.weblate.org/ro/latest/admin/projects.md#component)   |
|------------------------------------|---------------------------------------------------------------------------------------------------|
| Mască de fișier                    | `langs/translation-*.json`                                                                        |
| Fișier de limbă de bază monolingvă | `langs/translation-en.json`                                                                       |
| Șablon pentru traduceri noi        | Gol                                                                                               |
| Format fișier                      | Fisier cu structură imbricata JSON                                                                |

## File format parameters

[File format parameters](https://docs.weblate.org/ro/latest/formats.md#file-format-params) with the pattern json_\* can be used to configure the behavior of the JSON format.
