指定本地化文字內容
強烈建議您在 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;
}
只要為每種支援的語言提供 localized_value
,即可將動態饋給中使用 Text
訊息的任何欄位本地化。
必須同時指定 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"
}
]
}
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-11-26 (世界標準時間)。
[null,null,["上次更新時間:2024-11-26 (世界標準時間)。"],[[["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"]]