Locale Switcher plugin

The locale-switcher plugin provides a popover that allows to switch to other locale. The user interface then is updated instantly based on the selected locale.

Install

npm install '@react-pdf-viewer/locale-switcher';

Usage

1. Import the plugin
import { localeSwitcherPlugin } from '@react-pdf-viewer/locale-switcher';
2. Create the plugin instance
const localeSwitcherPluginInstance = localeSwitcherPlugin();
The plugin instance localeSwitcherPluginInstance provides the following property:
PropertyTypeDescriptionFrom
LocalePopoverReactElementThe default popover lists available locales2.0.0
3. Register the plugin
Register the locale-switcher plugin instance:
<Viewer plugins={[localeSwitcherPluginInstance]} />

Properties

The locale-switcher plugin provides other useful property as following:
import { LocaleIcon } from '@react-pdf-viewer/locale-switcher';
PropertyTypeDescriptionFrom
LocaleIconReactElementThe icon used in the LocalePopover component2.0.0

See also

Changelog

v2.7.2
  • The LocalePopover component doesn't update the localization
v2.0.0
  • First release