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

react-intl-universal

Package Overview
Dependencies
Maintainers
0
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.11.5 to 2.12.0

22

es/index.js

@@ -307,2 +307,21 @@ /*

/**
* Change current locale
* @param {string} newLocale Current locale such as 'en-US'
*/
}, {
key: "changeCurrentLocale",
value: function changeCurrentLocale(newLocale) {
if (!this.options.locales || !this.options.locales[newLocale]) {
var errorMsg = "react-intl-universal locales data \"" + newLocale + "\" not exists.";
if (!this.options.locales) {
errorMsg += 'You should call init function first.';
}
this.options.warningHandler(errorMsg);
return;
}
this.options.currentLocale = newLocale;
}
/**
* Initialize properties and load CLDR locale data according to currentLocale

@@ -451,2 +470,3 @@ * @param {Object} options

var determineLocale = defaultInstance.determineLocale.bind(defaultInstance);
var changeCurrentLocale = defaultInstance.changeCurrentLocale.bind(defaultInstance);
var init = defaultInstance.init.bind(defaultInstance);

@@ -461,2 +481,2 @@ var getInitOptions = defaultInstance.getInitOptions.bind(defaultInstance);

export { ReactIntlUniversal, get, getHTML, formatMessage, formatHTMLMessage, determineLocale, init, getInitOptions, load, getLocaleFromCookie, getLocaleFromLocalStorage, getLocaleFromURL, getDescendantProp, getLocaleFromBrowser };export default defaultInstance;
export { ReactIntlUniversal, get, getHTML, formatMessage, formatHTMLMessage, determineLocale, changeCurrentLocale, init, getInitOptions, load, getLocaleFromCookie, getLocaleFromLocalStorage, getLocaleFromURL, getDescendantProp, getLocaleFromBrowser };export default defaultInstance;

@@ -313,2 +313,21 @@ /*

/**
* Change current locale
* @param {string} newLocale Current locale such as 'en-US'
*/
}, {
key: "changeCurrentLocale",
value: function changeCurrentLocale(newLocale) {
if (!this.options.locales || !this.options.locales[newLocale]) {
var errorMsg = "react-intl-universal locales data \"" + newLocale + "\" not exists.";
if (!this.options.locales) {
errorMsg += 'You should call init function first.';
}
this.options.warningHandler(errorMsg);
return;
}
this.options.currentLocale = newLocale;
}
/**
* Initialize properties and load CLDR locale data according to currentLocale

@@ -457,2 +476,3 @@ * @param {Object} options

var determineLocale = defaultInstance.determineLocale.bind(defaultInstance);
var changeCurrentLocale = defaultInstance.changeCurrentLocale.bind(defaultInstance);
var init = defaultInstance.init.bind(defaultInstance);

@@ -473,2 +493,3 @@ var getInitOptions = defaultInstance.getInitOptions.bind(defaultInstance);

exports.determineLocale = determineLocale;
exports.changeCurrentLocale = changeCurrentLocale;
exports.init = init;

@@ -475,0 +496,0 @@ exports.getInitOptions = getInitOptions;

2

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

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

@@ -291,2 +291,8 @@ # react-intl-universal

/**
* Change current locale
* @param {string} newLocale Current locale such as 'en-US'
*/
changeCurrentLocale(newLocale)
/**
* Get the inital options

@@ -293,0 +299,0 @@ * @returns {Object} options includes currentLocale and locales

declare module "react-intl-universal" {
/**
* Change current locale
* @param {string} newLocale Current locale such as 'en-US'
*/
export function changeCurrentLocale(newLocale: string): void;
/**
* Helper: determine user's locale via URL, cookie, and browser's language.

@@ -4,0 +10,0 @@ * You may not need this API, if you have other rules to determine user's locale.

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