@blueeast/bluerain-plugin-intl
A BlueRain Plugin to add Internationalization through react-intl.
Last updated 10 months ago by bjavaid .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @blueeast/bluerain-plugin-intl 
SYNC missed versions from official npm registry.

bluerain Internationalisation plugin

Adds internationalization through react-intl-redux . https://blueeast.gitbook.io/bluerain-plugin-intl

???? Web ???? Electron ???? React Native
✔️ ✔️ TBD

Screenshots

NA

Components

This plugin registers following components in the Component registry, so they can be reused later by other apps and plugins:

  • FormattedMessageWeb

  • FormattedNumber Web

  • FormattedPlural Web

  • FormattedDate Web

  • FormattedTimeWeb

  • FormattedRelativeWeb

IntlConsumer

This Component is used to provide Intl functionality as a prop

<BR.Components.IntlConsumer>
  {({ children, intl }) => {
    
  return props.intl
  }}
</BR.Components.IntlConsumer>

Hooks

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:

BR.Filters.add('bluerain.intl.messages', function eng(messages) {
    const en = require('./lang/en.ts');
    const ur = require('./lang/ur.ts');

    messages.en =  Object.assign(messages.en ? messages.en : {}, en);
    messages.ur = Object.assign(messages.ur ? messages.ur : {}, ur);

    return messages;
});

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

Plugin Properties

  • pluginName string "InternationalizationPlugin"
  • slug string "intl"

setLocale

Change app's locale

setLocale Parameters
  • locale string The locale id
  • ctx The BlueRain Context
  • localeDataArray
  • selectableobject

withIntl

Higher Order component in inject intl prop in Component

Parameters

  • Component Component

Returns Component

injectIntl

react-intl's higher order component

injectIntl Parameters

  • Component Component

Returns Component

Current Tags

  • 2.1.1                                ...           latest (10 months ago)

17 Versions

  • 2.1.1                                ...           10 months ago
  • 2.1.0                                ...           10 months ago
  • 2.0.0                                ...           10 months ago
  • 1.2.0                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
  • 0.5.3                                ...           2 years ago
  • 0.5.2                                ...           2 years ago
  • 0.5.1                                ...           2 years ago
  • 0.5.0                                ...           2 years ago
  • 0.4.8                                ...           2 years ago
  • 0.4.4                                ...           2 years ago
  • 0.4.2                                ...           2 years ago
  • 0.4.1                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.0                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (4)
Dev Dependencies (54)

Copyright 2014 - 2016 © taobao.org |