支持文件类型 (Strings)

.JSON - go-i18n (Strings)

文本由 Phrase Language AI 从英语机器翻译而得。

文件扩展名

.json

API 扩展

go_i18n

导入

导出

复数形式支持

描述支持

Go-i18n 是一个专为 Go 设计的国际化库,支持的本地化文件格式有 .JSON、.YAML、.TOML 等。Go-i18n 使用的 JSON 文件与其他本地化/国际化平台的文件不同,因为 Go-i18n JSON 通常作为一个 JSON 数组存在,由一系列 JSON 对象组成。每个 JSON 对象代表需要翻译的字符串,由 ID 等键表示。

AI 聊天机器人可以非常有效地从 .JSON 文件生成键列表。

GitHub 上的 Go-i18n 相关内容

代码示例

[
  {
    "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":“这个键嵌套在一个命名空间中。”
  },
  {
    "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)"
  }
]
这篇文章有帮助吗?

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.