Localization of user interface elements

Certain content that the Basic Zoom Viewer displays is subject to localization, including zoom buttons and a full screen button.

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, and also may 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 in 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 an object contains the list of supported locales, SYMBOL text values for each locale, and the default locale.

An example of such localization object:

{ 
"en":{ 
"CloseButton.TOOLTIP":"Close", 
"ZoomInButton.TOOLTIP":"Zoom In" 
 }, 
 "fr":{ 
"CloseButton.TOOLTIP":"Fermer", 
"ZoomInButton.TOOLTIP":"Agrandir" 
}, 
defaultLocale:"en" 
}

In the example above, 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 setLocalizedTexts(localizationInfo) method.

The following SYMBOLs are supported:

SYMBOL

Tooltip for the...

Container.LABEL

ARIA label for the top-level viewer element.

ZoomView.ROLE_DESCRIPTION

ARIA role description for the main view component.

ZoomView.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.

FullScreenButton.TOOLTIP_SELECTED

Full screen button in normal state.

FullScreenButton.TOOLTIP_UNSELECTED

Full screen button in full screen state.

On this page

Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free
Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now