Pliki JSON go-i18n

Dodane w wersji 4.1.

Zmienione w wersji 4.16: Support for v2 variant of this format was added.

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

Informacja

Weblate supports the go-i18n JSON v1 and v2 variants. Please choose correct file format matching your environment.

Przykładowe pliki

Example file v1:

[
  {
    "id": "hello",
    "description": "Description",
    "translation": "Ahoj světe!\n"
  },
  {
    "id": "orangutan",
    "description": "Description",
    "translation": {
      "one": "Orangutan has {{.Count}} banana.\n",
      "other": "Orangutan has {{.Count}} bananas.\n"
    }
  },
  {
    "id": "try",
    "description": "Description",
    "translation": ""
  },
  {
    "id": "thanks",
    "description": "Description",
    "translation": ""
  }
]

Example file v2:

{
  "hello": "Ahoj světe!\n",
  "orangutan": {
    "description": "Description",
    "one": "Orangutan has {{.Count}} banana.\n",
    "other": "Orangutan has {{.Count}} bananas.\n"
  },
  "try": {
    "description": "Description",
    "other": ""
  },
  "thanks": {
    "description": "Description",
    "other": ""
  }
}
Supported features

File extensions

.toml

Linguality

Monolingual

Supports plural

Yes

Supports descriptions

No

Supports explanation

No

Supports context

No

Supports location

No

Supports flags

No

API identifier

go-i18n-toml

Supports read-only strings

No

Supported features

File extensions

.json

Linguality

Both monolingual and bilingual

Supports plural

Yes

Supports descriptions

Yes

Supports explanation

No

Supports context

No

Supports location

No

Supports flags

No

API identifier

go-i18n-json, go-i18n-json-v2

Supports read-only strings

No

Konfiguracja Weblate

Typical Weblate Konfiguracja komponentu for v1

Maska pliku

langs/*.json

Jednojęzyczny bazowy plik języka

langs/en.json

Szablon dla nowych tłumaczeń

Puste

Format pliku

go-i18n v1 JSON file

Typical Weblate Konfiguracja komponentu for v2

Maska pliku

langs/*.json

Jednojęzyczny bazowy plik języka

langs/en.json

Szablon dla nowych tłumaczeń

Puste

Format pliku

go-i18n v2 JSON file