表示文字列(多言語対応)
ホステッドエクスペリエンスでユーザーに表示されるテキストを更新することができます。これは、ユーザーのブラウザ設定に基づいて特定の言語のエクスペリエンスを提供したり、ブランドやユーザーエクスペリエンスに合わせてテキストをカスタマイズしたりするために行うことができます。
これを行うには、languageStringsプロパティを定義し、ホステッドエクスペリエンスインターフェース内で表示されるテキストを更新します。languageStringsオブジェクトには、ISO-639-1言語(例:en、es、jaなど)に対応する値が含まれている必要があります。各言語コード値には、更新したい値のキーを含むオブジェクトを提供します。また、特定のロケール/地域(例:en-US、en-GB、de-DE、pt-BR)を指定することで、より精密な言語ターゲット設定が可能です。
ユーザーがデジタルヒューマンエクスペリエンスを読み込むと、ブラウザはユーザーの優先言語リスト(優先順の配列)を提供します。ホステッドエクスペリエンスは、ユーザーのブラウザに設定された優先言語に基づいて、提供されたlanguageStringsリストを順に検索し、キーに一致するものを見つけます。ブラウザが優先言語を検出する方法についての詳細はこちらで確認できます。
言語コードが提供されていない場合は、default値が使用されます。default設定が指定されていない場合は、ホステッドエクスペリエンスの基本値が使用されます。
以下のコードブロックは、ホステッドエクスペリエンス内でUIテキストを置き換えるために使用できるlanguageStringキーの完全なリストと、その基本値を表示しています。
const uneeqOptions = {
languageStrings: {
"default": {
callToActionText: '👋 Hey! It is so good to meet you.',
errorText: 'An error occurred.',
textInputPlaceholder: 'Type here...',
showContentToolTip: 'Show Content',
sendQuestionButtonToolTip: 'Send Message',
startRecordingButtonToolTip: 'Start Recording',
unmuteMicrophoneToolTip: 'Unmute',
muteMicrophoneToolTip: 'Mute',
microphonePermissionNotAllowedButtonToolTip: 'Microphone permission not allowed',
microphoneEnabledHintTitle: 'Microphone Enabled',
microphoneEnabledHintText: 'You can speak to me, I\'m listening.',
microphoneEnabledHintTitleOverlay: 'Mic Enabled',
microphoneNotAllowedMessage: 'Microphone permission was not allowed. Please allow access to your microphone ' +
'via your browser settings, and try again.',
recordingTapToStart: 'Tap to record, tap again to send',
recordingSpeakNowPrompt: 'Speak now',
recordingTapStopWhenDone: 'Tap stop when done',
recordingStopButtonToolTip: 'Stop Recording',
recordingRequestingMicrophonePrompt: 'Requesting Microphone',
settingsExitButton: 'Exit',
confirmExitDescription: 'Are you sure you want to exit?',
confirmExitStayButton: 'STAY',
confirmExitEndButton: 'EXIT',
hideContentButton: 'Hide Content',
hideDigitalHumanButton: 'Hide Digital Human',
sessionEndedDueToInactivity: 'Digital human conversation has ended due to inactivity.',
sessionEndedByUser: 'Digital human conversation ended.',
sessionEndedDueToConnectionLoss: 'Digital human conversation has ended due to a connection issue.',
sessionEndedUnexpectedly: 'Digital human conversation has ended unexpectedly.',
sessionTransferred: 'Digital human conversation has transitioned.',
reconnectingText: 'reconnecting...',
muteDigitalHumanToolTip: 'Mute digital human audio',
unmuteDigitalHumanToolTip: 'Unmute digital human audio',
sessionEndedDueToVideoPlaybackError: 'Digital human conversation has ended due to a video playback error.',
sessionEndedDueToPermissionsError: 'Digital human conversation has ended due to a permissions error. Please check your browser settings.',
sessionEndedDueToRendererError: 'Digital human conversation has ended due to a configuration error. Please contact a support person.',
errorDigitalHumanResponse: 'Sorry, something has gone wrong. Please try again soon. (16001)',
videoAutoplayBlockedText: 'Click to resume the digital human.',
networkUnstableText: 'Poor network connection — the video may pause. Try moving closer to your Wi-Fi router or improving your network speed.',
networkReconnectingText: 'Reconnecting — your connection dropped.',
tryAgainError: 'Something went wrong, please try again.'
}
}
}言語置換
独自の文字列を、定義した各ホステッドエクスペリエンス言語に対して提供することができます。
例えば、'es'言語のcallToActionTextを以下のように置き換えることができます:
多言語サイトへの対応例:
最終更新
