Internationalization
Adds internationalization through (react-intl-redux)[https://github.com/ratson/react-intl-redux].
Usage
Run the following command in the plugin directoy:
Installation
Then in your boot function, pass the plugin like this:
Loading Locale Data Sets
In your configs object, add locale data sets like this:
Then boot with the configs:
Change locale in app
Make sure you have access to the BlueRain context. Then do this:
Components
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
Filters
bluerain.intl.messages
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.
API
IntlPluginConfigs
This is the default configuration set that is used at boot time.
Properties
locale
Array [default: "en"] Tries to detect automatically, falls back to 'en'.localeData
Array An array of localData files.
InternationalizationPlugin
Extends Plugin
react-intl plugin to add internationalization to BlueRain Apps
Properties
setLocale
Change app's locale
Parameters
locale
string The locale idctx
BlueRain The BlueRain Context
withIntl
Higher Order component in inject intl
prop in Component
Parameters
Component
Component
Returns Component
injectIntl
react-intl
's higher order component
Parameters
Component
Component
Returns Component
add
Integrations
Last updated