Internationalization
Last updated
Last updated
Adds internationalization through (react-intl-redux)[].
Run the following command in the plugin directoy:
Then in your boot function, pass the plugin like this:
In your configs object, add locale data sets like this:
Then boot with the configs:
Make sure you have access to the BlueRain context. Then do this:
This plugin registers following components in the Component registry, so they can be reused later by other apps and plugins:
FormattedMessage
FormattedNumber
FormattedPlural
FormattedDate
FormattedTime
FormattedRelative
This hook gives the ability to add custom intl messages.
Parameters:
Name
Type
Description
messages
Object
The messages db
Returns:
Name
Type
Description
messages
Object
The messages db
Example:
This example registers custom english and urdu messages to the system.
This is the default configuration set that is used at boot time.
Properties
Extends Plugin
react-intl plugin to add internationalization to BlueRain Apps
Properties
Change app's locale
Parameters
ctx
BlueRain The BlueRain Context
Higher Order component in inject intl
prop in Component
Parameters
Component
Component
Returns Component
react-intl
's higher order component
Parameters
Component
Component
Returns Component
Integrations
locale
[default: "en"] Tries to detect automatically, falls back to 'en'.
localeData
An array of localData files.
pluginName
"InternationalizationPlugin"
slug
"intl"
locale
The locale id