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
import { localeSwitcherPlugin } from '@react-pdf-viewer/locale-switcher' ;
2. Create the plugin instance
const localeSwitcherPluginInstance = localeSwitcherPlugin ( ) ;
The plugin instance `localeSwitcherPluginInstance`
provides the following property:
Property Type Description From `LocalePopover`
`ReactElement`
The default popover lists available locales 2.0.0
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' ;
Property Type Description From `LocaleIcon`
`ReactElement`
The icon used in the `LocalePopover`
component 2.0.0
See also
Changelog
The `LocalePopover`
component doesn't update the localization