ローカライズされたテキストを指定する
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 Reservations Waitlists integration to provide users with a personalized experience in their preferred language."],["Localizable fields, such as service names and descriptions, can be customized using the `Text` message format, specifying both a default `value` and `localized_value` for each supported language."],["When a user interacts with the integration, the system will display the `localized_value` corresponding to their browser's language settings, falling back to the default `value` if their locale is not supported."],["If localization is not implemented, it is crucial to provide both `value` and `localized_value` with the supported language and locale to ensure proper functionality and user experience."]]],["Localization is recommended for the Actions Center Reservations Waitlists integration, enabling a tailored user experience based on language settings. Utilize the `Text` message in feeds to provide `localized_value` for each supported language, alongside a default `value`. The system will prioritize `localized_value` according to the user's locale; otherwise, it falls back to `value`, or the first `localized_value` if the default is missing. If localization is unsupported, a single language in `localized_value` with a default `value` should be provided.\n"]]