Localization of user interface elements

Certain content that is displayed by the viewer is subject to localization. This includes user interface element tool tips and an error message displayed when the video cannot play.

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":{ 
"Video360Player.ERROR":"Your Browser does not support HTML5 Video tag or the video cannot be played.", 
"PlayPauseButton.TOOLTIP_SELECTED":"Play" 
 }, 
 "fr":{ 
"Video360Player.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 the localization object to the viewer constructor as a value of the 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

Tool tip for...

Container.LABEL

ARIA label for top level viewer element.

PlayPauseButton.TOOLTIP_SELECTED

Selected play pause button state.

PlayPauseButton.TOOLTIP_UNSELECTED

Deselected play pause button state.

PlayPauseButton.TOOLTIP_REPLAY

Play pause button state.

VideoScrubber.TOOLTIP

Video scrubber.

VideoTime.TOOLTIP

Video time on control bar.

MutableVolume.TOOLTIP_SELECTED

Selected mutable volume state.

MutableVolume.TOOLTIP_UNSELECTED

Deselected mutable volume.

MutableVolume.TOOLTIP_VOLUME

Volume slider knob label exposed by way of ARIA aria-valuetext attribute.

FullScreenButton.TOOLTIP_SELECTED

Full screen button in normal state.

FullScreenButton.TOOLTIP_UNSELECTED

Full screen button in full screen state.

SocialShare.TOOLTIP

Social share tool.

EmbedShare.TOOLTIP

The embed share button.

EmbedShare.HEADER

The embed dialog box header.

EmbedShare.TOOLTIP_HEADER_CLOSE

The embed dialog box upper-right close button.

EmbedShare.DESCRIPTION

The embed code text.

EmbedShare.EMBED_SIZE

The embed size combo box.

EmbedShare.CANCEL

The "Cancel" button.

EmbedShare.TOOLTIP_CANCEL

The "Cancel" button.

EmbedShare.ACTION

The "Select All" button.

EmbedShare.TOOLTIP ACTION

The "Select All" button.

EmbedShare.CUSTOM_SIZE

The last "custom size" entry in the embed size combo box.

LinkShare.TOOLTIP

The link share button.

LinkShare.HEADER

The link dialog box header.

LinkShare.TOOLTIP_HEADER_CLOSE

The link dialog box upper-right close button.

LinkShare.DESCRIPTION

The share link.

LinkShare.CANCEL

The "Cancel" button.

LinkShare.TOOLTIP_CANCEL

The "Cancel" button.

LinkShare.ACTION

The "Select All" button.

LinkShare.TOOLTIP ACTION

The "Select All" button.

FacebookShare.TOOLTIP

The Facebook share button.

TwitterShare.TOOLTIP

The Twitter share button.

Video360Player.ERROR

The error message that appears when no video playback is possible.

On this page