go-i18n JSON 檔案

在 4.1 版被加入.

在 4.16 版的變更: Support for v2 variant of this format was added.

Go-i18n翻譯是單向的,因此建議使用(最常見的)英語字串指定基本文件。

備註

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

範例檔案

範例檔案 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": ""
  }
]

範例檔案 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": ""
  }
}
支援的功能

副檔名

.toml

語言能力

單語言

支援複數

Yes

支援描述

No

支援解釋

No

Supports context

No

Supports location

No

Supports flags

No

API 識別碼

go-i18n-toml

支援唯讀字串

No

支援的功能

副檔名

.json

語言能力

單語言和雙語言

支援複數

Yes

支援描述

Yes

支援解釋

No

Supports context

No

Supports location

No

Supports flags

No

API 識別碼

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

支援唯讀字串

No

Weblate 配置

v1 的典型 Weblate 組件配置

檔案遮罩

langs/*.json

單語言基底語言檔案

langs/en.json

新翻譯的範本

空白

檔案格式

go-i18n v1 JSON 檔案

Typical Weblate 組件配置 for v2

檔案遮罩

langs/*.json

單語言基底語言檔案

langs/en.json

新翻譯的範本

空白

檔案格式

go-i18n v2 JSON 檔案