All Versions
10
Latest Version
Avg Release Cycle
62 days
Latest Release
173 days ago

Changelog History

  • v2.2.1

    October 14, 2019

    0️⃣ react-intl-universal is singleton by default. However, if you would like to have multiple react-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, 2019

    If there's a item lang=en-US in localStorage, you could determine currentLocale as the following code.

    intl.determineLocale( {localStorageLocaleKey: 'lang'} );
    
  • v2.0.3

    May 23, 2019

    🚀 In this release, common locale data will not be loaded from CDN anymore. #84
    Please require the locale data like this:

    require('intl/locale-data/jsonp/en.js');
    require('intl/locale-data/jsonp/zh.js');
    

    👀 See the example.

  • v1.15.0

    October 30, 2018

    👌 Support fallbackLocale option to use if a key is not found in the currentLocale. #91

  • v1.14.3

    October 23, 2018

    0️⃣ To prevent XSS attack, escaping Html is enabled by default.
    However, if you would like to disable escaping Html in some cases, use escapeHtml option.
    👀 See the test case for example.

  • v1.13.1

    September 12, 2018

    In 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, #71

    intl.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 this react-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 })
    

    🚀 This release fixes #44 and #45.

  • v1.10.1

    April 21, 2018

    Electron environment is treated as Node.js environment now.
    In Electron, react-intl-universal will not fetch locale files via CDN. You can bundle locale files on demand.
    🚀 This release fixes #56.

  • v1.9.2

    April 03, 2018

    ➕ Add load function to support loading multiple locale data.
    ✅ An example is shown in the test file.

    🚀 This release fixes #46.