WebExtension JSON

在翻譯Mozilla Firefox或Google Chromium的擴充時使用的文件格式。

備註

While this format is called JSON, its specification allows including "//"-style comments. Weblate does strip these comments while parsing the files and discards them when saving.

範例檔案:

{
  "hello": {
    "message": "Ahoj světe!\n",
    "description": "Description",
    "placeholders": {
      "url": {
        "content": "$1",
        "example": "https://developer.mozilla.org"
      }
    }
  },
  "orangutan": {
    "message": "Orangutan has $coUnT$ bananas",
    "description": "Description",
    "placeholders": {
      "count": {
        "content": "$1",
        "example": "5"
      }
    }
  },
  "try": {
    "message": "",
    "description": "Description"
  },
  "thanks": {
    "message": "",
    "description": "Description"
  }
}
支持的功能

檔案擴充

.json

Linguality

單語言

Supports plural

Yes

支援描述

Yes

支援解釋

No

Supports context

No

Supports location

No

Supports flags

No

API 識別碼

webextension

Supports read-only strings

No

Weblate 配置

典型的 Weblate 組件配置

檔案遮罩

_locales/*/messages.json

單語的基底語言檔

_locales/en/messages.json

新翻譯的範本

檔案格式

WebExtension JSON 檔