支持文件类型 (Strings)

.ARB - Application Resource Bundle (Strings)

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

文件扩展名 

.arb

API 扩展 

arb

导入 

导出 

复数形式支持 

描述支持 

格式选项 

ARB-Application Resource Bundle 是基于 JSON 进行本地化的文件格式,资源条目编码为 JSON 对象。每个对象由一个具有可选属性的资源键组成。ARB 文件用于本地化使用名为 Flutter 的谷歌移动应用程序软件开发工具包构建的应用程序。

复数和占位符

使用 ICU 占位符和复数风格以实现兼容性。

.ARB(应用程序资源包)文件中的复数有几个重要的考虑因素。复数消息中的计数占位符总是类型“int”。当指定复数类别时,请使用=%=0=""而不是=%zero, Orchestrator=1=""而不是 Orchestratorone, and Orchestrator=2=""而不是=%two。 Flutter 不支持复数消息格式的偏移量

代码示例

{
  "@@locale": "en_US",  "title_bar":"我的主页"
  "@title_bar": {
    "type": "text",
    "description":"页面标题"
  },  "MSG_OK":“一切正常”,“FOO_123”:"您的待处理成本为 {COST}",
  "@FOO_123": {
    "type": "text",
    “说明”:“余额表。”
  },
  “selectedRowCountTitle”:“{selectedRowCount, plural, =0{No items selected} =1{1 items selected} other{{selectedRowCount} items selected}}”,
  "@selectedRowCountTitle": {
    "description":"显示所选行数的消息",
    "placeholders": {
      “selectedRowCount”:{
        "type": "int",
        "example":"2"
      }
    }
  }
}
这篇文章有帮助吗?

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.