Changelog History
Page 1
-
v2.4.0
August 20, 2020When run
intl.get
orintl.getHTML
, the intlGetHook will be called.intl.init({intlGetHook: (key, currentLocale)=\> {}})
-
v2.3.1
July 18, 2020โก๏ธ Update [email protected] for Number Skeletons.
-
v2.2.1
October 14, 20190๏ธโฃ
react-intl-universal
is singleton by default. However, if you would like to have multiplereact-intl-universal
instance, you could instantiate it on demand.import intl from 'react-intl-universal'; // singleton instance
It's equalivent to:
import { ReactIntlUniversal } from 'react-intl-universal';const intl = new ReactIntlUniversal();
-
v2.1.0
June 29, 2019If there's a item
lang=en-US
in localStorage, you could determinecurrentLocale
as the following code.intl.determineLocale( {localStorageLocaleKey: 'lang'} );
-
v1.13.1
September 12, 2018In ICU standard, brace in message is treated as variable. An object is supposed to be passed as second parameter in the
intl.get("key", object)
function. Otherwise,react-intl-universal
could not format the message, resulting in returning empty string.// en-US.jsmodule.exports = ({ "BRACE": "The format is {var}", });intl.get("BRACE"); // Before this release, it return empty string ""
๐ However, in some case, brace is just a part of the sentence. It's better to be return the original message instead of empty string. This release fixes this issue. Here is the result:
intl.get("BRACE"); // "The format is {var}" intl.get("BRACE", {var: "x.y.z"}); // "The format is x.y.z"
-
v1.12.0
August 05, 2018๐ The Common Locale Data is now hosted in
//g.alicdn.com
, however some users in private network may not able to access the internet. This release make the common locale data URL optional. #76, #68, #63, #71intl.init({ // ... commonLocaleDataUrls: { en: "https://g.alicdn.com/react-intl-universal/locale-data/1.0.0/en.js", zh: "https://g.alicdn.com/react-intl-universal/locale-data/1.0.0/zh.js", } });
๐ Moreover, if you encounter the following error, this options make supporting more languages possible. #51
Language "${lang}" is not supported.
-
v1.11.1
May 13, 2018โ Whenever a default message is missing or having error for formatting a message,
react-intl-universal
will log warning message like thisreact-intl-universal key "not-exist-key" not defined in en-US
.โ If you would like to log these messages using third party services or even turn off the message, here is a chance to add custom warning handler in
init
function.const locales = {...};const currentLocale = "en-US";const warningHandler = (message, detail) =\> {...}; // Define your custom warning handlerintl.init({ locales, currentLocale, warningHandler })