ローカライズされたテキストの指定
Actions Center の Retail Ordering Business Link 統合でローカライズをサポートすることを強くおすすめします。ユーザーには、言語設定に基づいてローカライズされたエクスペリエンスが表示されます。ローカライズが設定されていない場合、デフォルトのテキストがユーザーに表示されることがあります。統合の多くのフィールド(サービス名や説明など)にローカライズされたテキストを指定できます。Text
メッセージを使用してローカライズできるフィールドの一覧については、フィード仕様をご覧ください。
ローカライズの実装
// A possibly-localized text payload. Some Text fields may contain marked-up
// content.
message Text {
// Required. Text value in an unknown locale, which will be displayed if
// `localized_value` for the user locale is empty or missing. The locale for
// this value may depend on the partner or service provider, and it should not
// be assumed to be any specific language.
string value = 1;
// Per-locale text values. Required.
repeated LocalizedString localized_value = 2;
}
Text
メッセージを使用しているフィードのフィールドは、サポートされている言語ごとに localized_value
を指定してローカライズできます。
value
と localized_value
の両方を指定する必要があります。
localized_value
は、ユーザーのロケール(ユーザーの言語ブラウザ設定で設定)に基づいて表示されます。
- ユーザーのロケールがサポートされているローカライズのリストにない場合、この値がデフォルトとして使用されます。
- 値を定義しておらず、ユーザーのロケールがサポートされているローカライズのリストにない場合は、localized_value に存在する最初の値が使用されます。このフォールバックは使用できますが、デフォルト値を明示的に指定することを強くおすすめします。
システムでローカライズをサポートしていない場合は、localized_value
を設定し、サポートする言語のみを locale
に設定してください。デフォルトとして使用できる value
も設定します。
サービス フィードのスニペットの例
"localized_service_name": {
"value": "Chocolate Tasting",
"localized_value": [
{
"locale": "en",
"value": "Chocolate Tasting"
},
{
"locale": "fr",
"value": "Dégustation de chocolats"
}
]
}
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-11-26 UTC。
[null,null,["最終更新日 2024-11-26 UTC。"],[[["Localization is highly recommended for the Actions Center Retail Ordering Business Link integration to provide users with a personalized experience in their preferred language."],["You can localize many fields like service names and descriptions using the `Text` message format specified in the feed specification."],["Both `value` (default text) and `localized_value` (language-specific text) are required for localization to function correctly, ensuring content is displayed even if a user's locale isn't explicitly supported."],["If localization isn't supported by your system, provide a single `localized_value` with your supported language and locale, along with a default `value`."]]],["Localization is strongly recommended for the Actions Center Retail Ordering Business Link integration. You can localize fields like service names and descriptions by using the `Text` message within the feed. Each localized field requires a default `value` and `localized_value` entries for each supported language. The `localized_value` is displayed based on the user's language settings, and the `value` is used as a default. If localization is not supported, set the `localized_value` with your single supported language and set the default `value`.\n"]]