サポートするファイル形式(Strings)

.ARB - Application Resource Bundle (Strings)

本コンテンツはPhrase Language AIの機械翻訳により、英語から翻訳されています。

ファイル拡張子 

.arb

API拡張 

arb

インポート 

はい

エクスポート 

はい

複数形のサポート 

はい

説明のサポート 

はい

フォーマットオプション 

ファイルがアップロードおよび/またはダウンロードされる際に指定できるオプションです。アップロード/ダウンロード方法(API、CLI、Repo sync など)に応じて、クエリパラメータ アップロードダウンロード、または phrase.yml ファイル形式設定ファイルで指定できます。

いいえ

ARB - Application Resource Bundle は、リソースエントリが JSON オブジェクトとしてエンコードされた、JSON ベースのローカリゼーション用ファイル形式です。各オブジェクトは、オプションの属性を持つリソースキーで構成されます。ARB ファイルは、Flutter と呼ばれる Google モバイル App SDK で構築されたアプリのローカリゼーションに使用されます。

複数形とプレースホルダー

互換性のために ICU プレースホルダーと複数形スタイルを使用してください。

.ARB (Application Resource Bundle) ファイルにおける複数形には、いくつかの重要な考慮事項があります。複数形メッセージ内のカウントプレースホルダーは、常に int 型です。複数形のカテゴリを指定する場合は、zero の代わりに =0 を、one の代わりに =1 を、two の代わりに =2 を使用してください。Flutter は、複数形メッセージのファイル形式における offset をサポートしていません。

コードサンプル

{
  "@@locale": "en_US",  "title_bar": "My Cool Home",
  "@title_bar": {
    "type": "text",
    "description": "Page title."
  },  "MSG_OK": "Everything works fine.",  "FOO_123": "Your pending cost is {COST}","translation_16:
  "@FOO_123": {
    "type": "text",
    "description": "balance statement."
  },
  "selectedRowCountTitle": "{selectedRowCount, plural, =0{No items selected} =1{1 item selected} other{{selectedRowCount} items selected}}","translation_17:
  "@selectedRowCountTitle": {
    "description": "Message that shows the number of selected rows",
    "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.