React SDK

Localization

We use i18next to handle localization of various parts of our @sajari/react-search-ui interfaces. We export our instance of i18next so that it is possible to provide your own localizations for your search interfaces.

By default we load the relevant localization dictionary based on the a user's browser settings.

Defaults

The default localization is as follows, broken down by the component/namespace:

Adding translations

Add resources in your app before rendering the components.

First import our version of i18n:

Then use the addResources method, noting the namespace you want to add the translations to.

Calling i18n.changeLanguage('fr') will force that language (in this case, French), rather than using the browser default.

Editable Example
Suggestions
    Powered by