react-intl-universal
Advanced tools
Comparing version 1.8.4 to 1.9.1
@@ -73,3 +73,4 @@ /* | ||
pt: "https://g.alicdn.com/react-intl-universal/locale-data/1.0.0/pt.js", | ||
it: "https://g.alicdn.com/react-intl-universal/locale-data/1.0.0/it.js" | ||
it: "https://g.alicdn.com/react-intl-universal/locale-data/1.0.0/it.js", | ||
ru: "https://g.alicdn.com/react-intl-universal/locale-data/1.0.0/ru.js" | ||
}; | ||
@@ -276,3 +277,13 @@ | ||
} | ||
/** | ||
* Load more locales after init | ||
*/ | ||
}, { | ||
key: "load", | ||
value: function load$$1(locales) { | ||
Object.assign(this.options.locales, locales); | ||
} | ||
}, { | ||
key: "getLocaleFromCookie", | ||
@@ -279,0 +290,0 @@ value: function getLocaleFromCookie(options) { |
{ | ||
"name": "react-intl-universal", | ||
"version": "1.8.4", | ||
"version": "1.9.1", | ||
"description": "Internationalize React apps. Not only for React.Component but also for Vanilla JS.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -76,3 +76,3 @@ # react-intl-universal | ||
``` | ||
Furthermore, your React.Component's properties is not inherited in subclass since component is injected by [react-intl](https://github.com/yahoo/react-intl). | ||
Furthermore, your React.Component's properties are not inherited in subclass since component is injected by [react-intl](https://github.com/yahoo/react-intl). | ||
@@ -161,3 +161,3 @@ Due to the problem above, we create [react-intl-universal](https://www.npmjs.com/package/react-intl-universal) to internationalize React app using simple but powerful API. | ||
And `getHTML` also support default message. | ||
And `getHTML` also supports default message. | ||
```js | ||
@@ -169,3 +169,3 @@ intl.getHTML('not-exist-key').d(<div>hello</div>) // React.Element with "<div>hello</div>" | ||
### Message With Variables | ||
If the message contains variables, the `{variable_name}` is substituted directly into the string. In the example below, there are two variables `{name}` and `{where}`, the second argument representing the variables in `get` method are substituted into the string. | ||
If the message contains variables the `{variable_name}` is substituted directly into the string. In the example below, there are two variables `{name}` and `{where}`, the second argument representing the variables in `get` method are substituted into the string. | ||
@@ -172,0 +172,0 @@ Locale data: |
@@ -76,2 +76,8 @@ declare module "react-intl-universal" { | ||
/** | ||
* Load more locales after init | ||
* @param {Object} locales App locale data | ||
*/ | ||
export function load(locales: { [key: string]: any }): void; | ||
export interface ReactIntlUniversalOptions { | ||
@@ -78,0 +84,0 @@ currentLocale?: string; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
480297
5239
9