Localization of user interface elements

Last update: 2023-11-03
  • Created for:
  • Developer
    User

Certain content that the Mixed Media Viewer displays is subject to localization. This guideline includes zoom buttons, spin buttons, video controls, close button, full-screen button, and swatch scroll buttons.

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":{
"CloseButton.TOOLTIP":"Close",
"ZoomInButton.TOOLTIP":"Zoom In"
 },
 "fr":{
"CloseButton.TOOLTIP":"Fermer",
"ZoomInButton.TOOLTIP":"Agrandir"
},
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.

ZoomView.ROLE_DESCRIPTION

ARIA role description for main view component.

ZoomView.USAGE_HINT

ARIA usage hints for keyboard users.

SpinView.ROLE_DESCRIPTION

ARIA role description for main view component.

SpinView.USAGE_HINT

ARIA usage hints for keyboard users.

FlyoutZoomView.ROLE_DESCRIPTION

ARIA role description for main view component.

FlyoutZoomView.USAGE_HINT

ARIA usage hints for keyboard users.

CloseButton.TOOLTIP

Close button.

ZoomInButton.TOOLTIP

Zoom in button.

ZoomOutButton.TOOLTIP

Zoom out button.

ZoomResetButton.TOOLTIP

Zoom reset button.

FlyoutZoomView.TIP_BUBBLE_OVER

Desktop systems in inline zoom mode.

FlyoutZoomView.TIP_BUBBLE_TAP

Touch devices in inline zoom mode.

FullScreenButton.TOOLTIP_SELECTED

full-screen button in normal state.

FullScreenButton.TOOLTIP_UNSELECTED

full-screen button in full-screen state.

ClosedCaptionButton.TOOLTIP_SELECTED

Selected close caption button state.

ClosedCaptionButton.TOOLTIP_UNSELECTED

Unselected closed caption button state.

ScrollLeftButton.TOOLTIP

Scroll left button.

ScrollRightButton.TOOLTIP

Scroll right button.

ScrollUpButton.TOOLTIP

Scroll up button.

ScrollDownButton.TOOLTIP

Scroll down button.

PanLeftButton.TOOLTIP

Spin left button.

PanRightButton.TOOLTIP

Spin right button.

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.

VideoPlayer.ERROR

Error message that appears when no video playback is possible.

On this page