Tipos de arquivos aceitos (Strings)

.JSON - go-i18n (Strings)

O conteúdo de toda a Central de Ajuda é traduzido automaticamente de inglês pelo Phrase Language AI.

Extensões de arquivo

.json

Extensão de API

go_i18n

Importar

Sim

Exportar

Sim

Suporte para formas plurais

Sim

Suporte para descrição

Não

O Go-i18n é uma biblioteca de internacionalização projetada para Go. O formatos de arquivo de localização aceitos incluem .JSON, .YAML, .TOML, etc. Os arquivos JSON usados por go-i18n são diferentes dos de outras plataformas de localização e internacionalização, pois o go-18n .JSON existe muitas vezes como um array JSON constituído por uma série de objetos JSON. Cada objeto JSON representa uma string que precisa de ID de tradução identificado por chaves como ID.

Os chatbots da IA podem ser muito efetivos na geração de uma lista de chaves a partir de um arquivo .JSON.

go-i18n no GitHub

Amostra de código

[
  {
    "id": "boolean_key",
    "translation": "--- true\n"
  },
  {
    "id": "empty_string_translation",
    "translation": ""
  },
  {
    "id": "key_with_description",
    "translation": "Check it out! This key has a description! (At least in some formats)"
  },
  {
    "id": "key_with_line-break",
    "translation": "This translations contains\na line-break."
  },
  {
    "id": "nested.deeply.key",
    "translation": "Wow, this key is nested even deeper."
  },
  {
    "id": "nested.key",
    "translation": "This key is nested inside a namespace."
  },
  {
    "id": "null_translation",
    "translation": null
  },
  {
    "id": "pluralized_key",
    "translation": {
      "one": "Only  pluralization found.",
      "other": "Wow, you have  pluralizations!",
      "zero": "You have no pluralization."
    }
  },
  {
    "id": "sample_collection",
    "translation": "---\n- first item\n- second item\n- third item\n"
  },
  {
    "id": "simple_key",
    "translation": "simple key, simple message, so simple."
  },
  {
    "id": "unverified_key",
    "translation": "This translation is not yet verified and waits for it. (In some formats we also export this status)"
  }
]
Esse artigo foi útil?

Sorry about that! In what way was it not helpful?

The article didn’t address my problem.
I couldn’t understand the article.
The feature doesn’t do what I need.
Other reason.

Note that feedback is provided anonymously so we aren't able to reply to questions.
If you'd like to ask a question, submit a request to our Support team.
Thank you for your feedback.