kotori 3.1.0 → 3.1.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 +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -63,7 +63,7 @@ npm i kotori
|
|
|
63
63
|
```ts
|
|
64
64
|
import { kotori } from 'kotori'
|
|
65
65
|
|
|
66
|
-
export const { useT, dict, setLanguage } = kotori({
|
|
66
|
+
export const { useT, dict, setLanguage, t } = kotori({
|
|
67
67
|
primaryLanguageTag: 'en',
|
|
68
68
|
secondaryLanguageTags: ['zh', 'ja', 'ms'],
|
|
69
69
|
})
|
|
@@ -72,7 +72,7 @@ export const { useT, dict, setLanguage } = kotori({
|
|
|
72
72
|
**page1.tsx**
|
|
73
73
|
|
|
74
74
|
```tsx
|
|
75
|
-
import { useT, dict } from './utils'
|
|
75
|
+
import { useT, dict, setLanguage, t } from './utils'
|
|
76
76
|
|
|
77
77
|
const intro = dict({
|
|
78
78
|
en: 'my name is {{name}}, I am {{age}} years old.',
|
|
@@ -90,7 +90,7 @@ const time = dict({
|
|
|
90
90
|
})<{ time: `${number}:${number}:${number}` }>
|
|
91
91
|
|
|
92
92
|
export const Page1 = () => {
|
|
93
|
-
const {
|
|
93
|
+
const { language } = useT()
|
|
94
94
|
return (
|
|
95
95
|
<>
|
|
96
96
|
<select
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kotori",
|
|
3
3
|
"description": "Strongly-typed and composable internationalization library for React",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.1",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"setup": "rm -rf node_modules && npm i && git init && husky",
|
|
7
7
|
"prepublishOnly": "npm i && npx tsc && npm run build",
|