Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-intl-universal

Package Overview
Dependencies
Maintainers
1
Versions
138
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-intl-universal - npm Package Compare versions

Comparing version 2.1.3 to 2.1.4

2

package.json
{
"name": "react-intl-universal",
"version": "2.1.3",
"version": "2.1.4",
"description": "Internationalize React apps. Not only for React.Component but also for Vanilla JS.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -260,21 +260,9 @@ # react-intl-universal

### Common Locale Data
For browser rendering, the common locale data such as date, currency, and number format are automatically loaded from CDN on demand.
For server-side rendering, they should be added in your application as shown in the [example](https://github.com/alibaba/react-intl-universal/blob/master/examples/node-js-example/src/App.js#L11-L16).
```js
// For Node.js
import IntlPolyfill from "intl";
global.Intl = IntlPolyfill;
require('intl/locale-data/jsonp/en.js');
require('intl/locale-data/jsonp/zh.js');
require('intl/locale-data/jsonp/fr.js');
require('intl/locale-data/jsonp/ja.js');
```
### Helper
[react-intl-universal](https://www.npmjs.com/package/react-intl-universal) provides a utility helping developer determine the user's `currentLocale`. As the running examples, when user select a new locale, it redirect user new location like `http://localhost:3000?lang=en-US`. Then, we can use `intl.determineLocale` to get the locale from URL. It can also support determine user's locale via cookie, localStorage, and browser default language. Refer to the APIs section for more detail.
## App Examples
- [Browser rendering](https://github.com/alibaba/react-intl-universal/blob/master/examples/browser-example/src/App.js)
- [Server-side rendering](https://github.com/alibaba/react-intl-universal/blob/master/examples/node-js-example/src/App.js)
## APIs Definition

@@ -402,21 +390,2 @@

## Running Examples Locally
```sh
git clone git@github.com:alibaba/react-intl-universal.git
```
For browser rendering,
```sh
cd react-intl-universal/examples/browser-example
npm install
npm start
```
For server-side rendering,
```sh
cd react-intl-universal/examples/node-js-example
npm install
npm start
```
## Tools

@@ -423,0 +392,0 @@ - [react-intl-universal-pseudo-converter](https://github.com/ceszare/react-intl-universal-pseudo-converter): A [pseudo-localization](https://en.wikipedia.org/wiki/Pseudolocalization) tool for testing internationalization.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc