use-intl 2.3.0 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -14
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,25 +6,15 @@
|
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
|
-
- 🌟
|
|
10
|
-
- 📅 Built-in
|
|
11
|
-
- 💡
|
|
12
|
-
- ⚔️
|
|
9
|
+
- 🌟 **Proven [ICU syntax](https://formatjs.io/docs/core-concepts/icu-syntax)**: This covers interpolation, plurals, ordinal pluralization, label selection based on enums and rich text. I18n is an essential part of the user experience, therefore this library doesn't compromise on flexibility and never leaves you behind when you need to fine tune a translation.
|
|
10
|
+
- 📅 **Built-in date, time and number formatting**: You can use global formats for a consistent look & feel of your app and integrate them with translations.
|
|
11
|
+
- 💡 **Hooks-only API**: This ensures that you can use the same API for `children` as well as for attributes which expect strings.
|
|
12
|
+
- ⚔️ **Battle-tested building blocks**: This library is a minimal wrapper around built-in browser APIs and supplemental lower-level APIs from [Format.JS](https://formatjs.io/) (used by `react-intl`).
|
|
13
13
|
|
|
14
14
|
## What does it look like?
|
|
15
15
|
|
|
16
16
|
This library is based on the premise that messages can be grouped by namespaces (typically a component name).
|
|
17
17
|
|
|
18
|
-
```js
|
|
19
|
-
// en.json
|
|
20
|
-
{
|
|
21
|
-
"LatestFollower": {
|
|
22
|
-
"latestFollower": "{username} started following you",
|
|
23
|
-
"followBack": "Follow back"
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
```
|
|
27
|
-
|
|
28
18
|
```jsx
|
|
29
19
|
// LatestFollower.js
|
|
30
20
|
function LatestFollower({user}) {
|
|
@@ -39,6 +29,16 @@ function LatestFollower({user}) {
|
|
|
39
29
|
}
|
|
40
30
|
```
|
|
41
31
|
|
|
32
|
+
```js
|
|
33
|
+
// en.json
|
|
34
|
+
{
|
|
35
|
+
"LatestFollower": {
|
|
36
|
+
"latestFollower": "{username} started following you",
|
|
37
|
+
"followBack": "Follow back"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
42
|
## Installation
|
|
43
43
|
|
|
44
44
|
1. Install `use-intl` in your project
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "use-intl",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.1",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"author": "Jan Amann <jan@amann.me>",
|
|
6
6
|
"description": "Minimal, but complete solution for managing internationalization in React apps.",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"engines": {
|
|
56
56
|
"node": ">=10"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "3e080f29f06ba501597158c94905b70dbfc7476f"
|
|
59
59
|
}
|