Localization of user interface elements localization-of-user-interface-elements

Certain content that the Smart Crop Video Viewer displays is subject to localization. This content includes user interface element tool tips and an error message that is displayed when the video cannot be played.

Every textual content in the viewer that can be localized is represented by a special Viewer SDK identifier called SYMBOL. Any SYMBOL has a default-associated text value for the English locale ( "en") supplied with the out-of-the-box viewer. It may also have user-defined values set for as many locales as needed.

When the viewer starts, it checks the current locale to see if there is a user-defined value for each supported SYMBOL for the locale. If there is, it uses the user-defined value; otherwise, it falls back to the out-of-the-box default text.

User-defined localization data can be passed to the viewer as a localization JSON object. Such object contains the list of supported locales, SYMBOL text values for each locale, and the default locale.

An example of such a localization object is the following:

{
"en":{
"SmartCropVideoPlayer.ERROR":"Your Browser does not support HTML5 Video tag or the video cannot be played.",
"PlayPauseButton.TOOLTIP_SELECTED":"Play"
 },
 "fr":{
"SmartCropVideoPlayer.ERROR":"Votre navigateur ne prend pas en charge la vidéo HTML5 tag ou la vidéo ne peuvent pas être lus.",
"PlayPauseButton.TOOLTIP_SELECTED":"Jouer"
},
defaultLocale:"en"
}

In the above example, the localization object defines two locales ( "en" and "fr") and provides localization for two user interface elements in each locale.

The web page code should pass such localization object to the viewer constructor as a value of localizedTexts field of the configuration object. An alternative option is to pass the localization object by calling the setLocalizedTexts(localizationInfo) method.

The following SYMBOLs are supported:

SYMBOL
Description
Container.LABEL
ARIA label for top-level viewer element.
PlayPauseButton.TOOLTIP_SELECTED
Tool tip for the selected play pause button state.
PlayPauseButton.TOOLTIP_UNSELECTED
Tool tip for the deselected play pause button state.
PlayPauseButton.TOOLTIP_REPLAY
Tool tip for the play pause button state.
VideoScrubber.TOOLTIP
Tool tip for the video scrubber.
VideoTime.TOOLTIP
Tool tip for the video time on control bar.
MutableVolume.TOOLTIP_SELECTED
Tool tip for the selected mutable volume state.
MutableVolume.TOOLTIP_UNSELECTED
Tool tip for the deselected mutable volume.
MutableVolume.TOOLTIP_VOLUME
Volume slider knob label exposed by way of the ARIA aria-valuetext attribute.
FullScreenButton.TOOLTIP_SELECTED
Tool tip for the selected full-screen button state.
FullScreenButton.TOOLTIP_UNSELECTED
Tool tip for the deselected full-screen button state.
ClosedCaptionButton.TOOLTIP_SELECTED
Tool tip for the selected closed caption button state.
ClosedCaptionButton.TOOLTIP_UNSELECTED
Tool tip for the deselected closed caption button state.
SocialShare.TOOLTIP
Tool tip for the social share tool.
EmailShare.TOOLTIP
Tool tip for the email share button.
EmailShare.HEADER
Tool tip for the email dialog header.
EmailShare.TOOLTIP_HEADER_CLOSE
Tool tip for the email dialog box upper-right close button.
EmailShare.INVALID_ADDRESSS
Tool tip for the error message displayed in case email address is malformed.
EmailShare.TO
Label for the "To" input field.
EmailShare.TOOLTIP_ADD
Tool tip for the "Add Another Email Address" button.
EmailShare.ADD
Caption for "Add Another Email Address" button.
EmailShare.FROM
Label for the "From" input field.
EmailShare.MESSAGE
Label for the "Message" input field.
EmailShare.TOOLTIP_REMOVE
Tool tip for the "Remove Email Address" button.
EmailShare.CANCEL
Caption for the "Cancel" button.
EmailShare.TOOLTIP_CANCEL
Tool tip for the "Cancel" button.
EmailShare.CLOSE
Caption for the close button displayed in the bottom of dialog after form submission.
EmailShare.TOOLTIP_CLOSE
Tool tip for the close button displayed in the bottom of dialog after form submission.
EmailShare.ACTION
Caption for the form submission button.
EmailShare.TOOLTIP_ACTION
Tool tip for the form submission button.
EmailShare.SEND_SUCCESS
Confirmation message displayed when email was sent successfully.
EmailShare.SEND_FAILURE
Error message that is displayed when email was not sent successfully.
EmbedShare.TOOLTIP
Tool tip for the embed share button.
EmbedShare.HEADER
Tool tip for the embed dialog box header.
EmbedShare.TOOLTIP_HEADER_CLOSE
Tool tip for the embed dialog box upper-right close button.
EmbedShare.DESCRIPTION
Description of the embed code text.
EmbedShare.EMBED_SIZE
Label for the embed size combo box.
EmbedShare.CANCEL
Caption for the "Cancel" button.
EmbedShare.TOOLTIP_CANCEL
Tool tip for the "Cancel" button.
EmbedShare.ACTION
Caption for "Select All" button.
EmbedShare.TOOLTIP ACTION
Tooltip for "Select All" button.
EmbedShare.CUSTOM_SIZE
Text for the last "custom size" entry in the embed size combo box.
LinkShare.TOOLTIP
Tool tip for the link share button.
LinkShare.HEADER
Tool tip for the link dialog box header.
LinkShare.TOOLTIP_HEADER_CLOSE
Tool tip for the link dialog box upper-right close button.
LinkShare.DESCRIPTION
Description of the share link.
LinkShare.CANCEL
Caption for the "Cancel" button.
LinkShare.TOOLTIP_CANCEL
Tool tip for the "Cancel" button.
LinkShare.ACTION
Caption for "Select All" button.
LinkShare.TOOLTIP ACTION
Tooltip for "Select All" button.
FacebookShare.TOOLTIP
Tool tip for the Facebook share button.
TwitterShare.TOOLTIP
Tool tip for the Twitter share button.
SmartCropVideoPlayer.ERROR
Tool tip for the error message that appears when no video playback is possible.
recommendation-more-help
b7426f53-aad9-4c00-83fc-664f30f681e8