<a id="webex"></a>

# WebExtension JSON

翻译 Mozilla Firefox 或 Google Chromium 的扩展时使用的文件格式。

#### NOTE
虽然这种格式称为 JSON，但其规范允许包含“//”样式的注释。Weblate 在解析文件时会剥离这些注释，并在保存时丢弃它们。

#### SEE ALSO
* [JSON](https://docs.translatehouse.org/projects/translate-toolkit/en/latest/formats/json.html)
* [Google chrome.i18n](https://developer.chrome.com/docs/extensions/reference/api/i18n)
* [Mozilla 扩展国际化](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Internationalization)

示例文件：

```json
{
  "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"
  }
}
```

<!-- AUTOGENERATED START: format-features webextension -->
<!-- This section is automatically generated by `./manage.py list_format_features`. Do not edit manually. -->

#### 支持的功能

| 文件扩展名                                                                       | `.json`        |
|-----------------------------------------------------------------------------|----------------|
| Linguality [ⓘ](https://docs.weblate.org/zh-cn/latest/formats.md#bimono)          | 单语言            |
| 支持复数 [ⓘ](https://docs.weblate.org/zh-cn/latest/formats.md#format-plurals)        | `Yes`          |
| 支持描述 [ⓘ](https://docs.weblate.org/zh-cn/latest/formats.md#format-description)    | `Yes`          |
| 支持解释 [ⓘ](https://docs.weblate.org/zh-cn/latest/formats.md#format-explanation)    | `No`           |
| 支持上下文 [ⓘ](https://docs.weblate.org/zh-cn/latest/formats.md#format-context)       | `No`           |
| 支持位置 [ⓘ](https://docs.weblate.org/zh-cn/latest/formats.md#format-location)       | `No`           |
| 支持标记 [ⓘ](https://docs.weblate.org/zh-cn/latest/formats.md#format-flags)          | `No`           |
| API 标识符                                                                     | `webextension` |
| 支持只读字符串 [ⓘ](https://docs.weblate.org/zh-cn/latest/formats.md#read-only-strings)  | `No`           |
| 支持删除过时字符串 [ⓘ](https://docs.weblate.org/zh-cn/latest/formats.md#obsolete-strings) | `No`           |
<!-- AUTOGENERATED END: format-features webextension -->

## Weblate 配置

|             | 典型的 Weblate [部件配置](https://docs.weblate.org/zh-cn/latest/admin/projects.md#component)   |
|-------------|-----------------------------------------------------------------------------|
| 文件掩码        | `_locales/*/messages.json`                                                  |
| 单语言译文模版语言文件 | `_locales/en/messages.json`                                                 |
| 新语种的翻译模版    | 空                                                                           |
| 文件格式        | WebExtension JSON 文件                                                        |
