ローカライズされたテキストを指定する
Actions Center の予約のエンドツーエンド統合では、ローカライズをサポートすることを強くおすすめします。ユーザーには、言語設定に基づいてローカライズされたエクスペリエンスが表示されます。ローカライズが設定されていない場合、デフォルトのテキストがユーザーに表示されることがあります。統合の多くのフィールド(サービス名や説明など)にローカライズされたテキストを指定できます。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 Appointments End-to-End integration to provide users with a personalized experience based on their language settings."],["You can provide localized text for various fields like service names and descriptions using the `Text` message format, ensuring both a default `value` and locale-specific `localized_value` are provided."],["If localization is not supported, set `localized_value` and `locale` with your supported language and `value` as a default, promoting a consistent user experience."],["The system prioritizes displaying the `localized_value` based on the user's browser language settings, using the default `value` if the locale isn't supported or if `localized_value` is missing for the given locale."]]],["Localization is recommended in the Actions Center Appointments integration, allowing users to see content in their preferred language. Fields using the `Text` message can be localized by providing a `localized_value` for each supported language. Both `value` (default text) and `localized_value` (locale-specific text) are required. The `localized_value` displays based on the user's locale; `value` acts as a fallback. If localization is unsupported, a single language can be set for both `localized_value` and `value`.\n"]]