use-intl 3.11.0 → 3.11.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 +4 -7
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
Internationalization is an essential part of the user experience
|
|
7
|
+
Internationalization (i18n) is an essential part of the user experience, therefore `use-intl` gives you all the parts you need to get language nuances right.
|
|
8
8
|
|
|
9
9
|
- 🌟 **ICU message syntax**: Localize your messages with interpolation, cardinal & ordinal plurals, enum-based label selection and rich text.
|
|
10
10
|
- 📅 **Dates, times & numbers**: Apply appropriate formatting without worrying about server/client differences like time zones.
|
|
@@ -14,11 +14,9 @@ Internationalization is an essential part of the user experience. `use-intl` giv
|
|
|
14
14
|
|
|
15
15
|
## What does it look like?
|
|
16
16
|
|
|
17
|
-
This library is based on the premise that messages can be grouped by namespaces (typically a component name).
|
|
18
|
-
|
|
19
17
|
```jsx
|
|
20
18
|
// UserProfile.tsx
|
|
21
|
-
import {useTranslations} from '
|
|
19
|
+
import {useTranslations} from 'use-intl';
|
|
22
20
|
|
|
23
21
|
export default function UserProfile({user}) {
|
|
24
22
|
const t = useTranslations('UserProfile');
|
|
@@ -52,6 +50,7 @@ export default function UserProfile({user}) {
|
|
|
52
50
|
|
|
53
51
|
1. `npm install use-intl`
|
|
54
52
|
2. Add the provider
|
|
53
|
+
3. Use internationalization in components
|
|
55
54
|
|
|
56
55
|
```jsx
|
|
57
56
|
import {IntlProvider, useTranslations} from 'use-intl';
|
|
@@ -81,6 +80,4 @@ function App({user}) {
|
|
|
81
80
|
|
|
82
81
|
Have a look at [the minimal setup example](https://github.com/amannn/next-intl/tree/main/examples/example-use-intl) to explore a working app.
|
|
83
82
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
Please refer to the [`next-intl` usage docs](https://next-intl-docs.vercel.app/docs/usage) for more advanced usage, but note that you should import from `use-intl` instead of `next-intl`.
|
|
83
|
+
### [→ Read the docs](https://next-intl-docs.vercel.app/docs/environments/core-library)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "use-intl",
|
|
3
|
-
"version": "3.11.
|
|
3
|
+
"version": "3.11.1",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"author": "Jan Amann <jan@amann.work>",
|
|
6
6
|
"description": "Minimal, but complete solution for managing internationalization in React apps.",
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"limit": "12.575 kB"
|
|
94
94
|
}
|
|
95
95
|
],
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "78f88d1493eb796498b7fb2c986536ac49cffda0"
|
|
97
97
|
}
|