支持文件类型 (Strings)

.ARB - 应用程序资源包 (Strings)

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

文件扩展名 

.arb

API 扩展 

arb

导入 

导出 

复数形式支持 

描述支持 

格式选项 

这些选项可以在上传和/或下载文件时指定。根据上传/下载方法(API、CLI、Repo 同步等),它们可以在查询参数 上传下载phrase.yml 配置文件中指定。

ARB - 应用程序资源包 是一种基于 JSON 的本地化文件格式,资源条目编码为 JSON 对象。每个对象由一个资源键和可选属性组成。ARB 文件用于本地化使用 Google 移动应用 SDK(称为 Flutter)构建的应用程序。

复数形式和占位符

使用 ICU 占位符和复数形式以保持兼容性。

.ARB (应用程序资源包) 文件中的复数形式有几个重要的注意事项。复数消息中的计数占位符类型始终为 int。指定复数类别时,请使用 =0 代替 zero,使用 =1 代替 one,并使用 =2 代替 two。Flutter 不支持复数消息格式中的 offset

代码示例

{
  "@@locale": "en_US",  "title_bar": "My Cool Home",
  "@title_bar": {
    "type": "text",
    "description": "页面标题。"
  },  "MSG_OK": "一切运行正常。",  "FOO_123": "您的待处理费用为 {COST}",
  "@FOO_123": {
    "type": "text",
    "description": "balance statement."
  },
  "selectedRowCountTitle": "{selectedRowCount, plural, =0{未选择条目} =1{已选择 1 个条目} 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.