Releases: alibaba/react-intl-universal
2.12.0
2.11.1
Removing dependency: intl
Add Debugger Mode
When developing a website with multiple languages (i18n), translators are usually responsible for translating the content instead of the web developer. However, translators often struggle to find the specific message they need to edit on the webpage because they don't know its key. This leads to them having to ask the developer for the key, resulting in a lot of time wasted on communication.
To solve this issue, a solution is proposed: When the debugger mode in react-intl-universal
is enabled, each message on the webpage will be wrapped in a special span element with the key "data-i18n-key". This way, translators can easily see the key of the message and make the necessary edits themselves using some message management system, without needing to ask the developer.
Enabling debugger mode:
intl.init({
// ...
debug: true
})
Message will be wrapped in a span element with the key "data-i18n-key":
2.8.0
Improve type hints
- Improve type hints (#226)
Performance Improvement
- Performance Improvement for
get
function (#224)
Support ECMAScript module format
Support ECMAScript module format used by Vite.
Fix security vulnerabilities
- Fix security vulnerabilities.
- Remove
console-polyfill
dependency.
Add hooks in get and getHTML methods
When run intl.get
or intl.getHTML
, the intlGetHook will be called.
intl.init({
intlGetHook: (key, currentLocale)=> {}
})