@ttoss/react-i18n 1.19.8 → 1.20.0
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 +24 -0
- package/dist/index.d.ts +1 -1
- package/package.json +5 -5
- package/src/index.ts +6 -1
package/README.md
CHANGED
|
@@ -81,3 +81,27 @@ const App = () => {
|
|
|
81
81
|
|
|
82
82
|
export default App;
|
|
83
83
|
```
|
|
84
|
+
|
|
85
|
+
### Configuring Vite
|
|
86
|
+
|
|
87
|
+
In order to inject the i18n id's properly on the code, configure the `plugins` section of `vite.config.ts` according to this:
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
import { babelConfig } from '@ttoss/config';
|
|
91
|
+
|
|
92
|
+
export default defineConfig(async () => {
|
|
93
|
+
return {
|
|
94
|
+
// ...
|
|
95
|
+
|
|
96
|
+
plugins: [
|
|
97
|
+
react({
|
|
98
|
+
babel: {
|
|
99
|
+
plugins: babelConfig().plugins,
|
|
100
|
+
},
|
|
101
|
+
}),
|
|
102
|
+
],
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
// ...
|
|
106
|
+
});
|
|
107
|
+
```
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_intl from 'react-intl';
|
|
2
|
-
export { FormattedMessage, defineMessage, defineMessages } from 'react-intl';
|
|
2
|
+
export { FormattedMessage, IntlShape, defineMessage, defineMessages } from 'react-intl';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
|
|
5
5
|
type MessagesType = any;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/react-i18n",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": "ttoss",
|
|
6
6
|
"contributors": [
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@formatjs/cli": "^6.0.4",
|
|
36
|
-
"@ttoss/config": "^1.29.
|
|
37
|
-
"@ttoss/i18n-cli": "^0.4.
|
|
38
|
-
"@ttoss/test-utils": "^1.21.
|
|
36
|
+
"@ttoss/config": "^1.29.5",
|
|
37
|
+
"@ttoss/i18n-cli": "^0.4.6",
|
|
38
|
+
"@ttoss/test-utils": "^1.21.5",
|
|
39
39
|
"@types/react": "^18.0.37",
|
|
40
40
|
"jest": "^29.5.0",
|
|
41
41
|
"tsup": "^6.7.0"
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "746081bbad4d1accbf638d6ccf555a359ff8e9f1"
|
|
52
52
|
}
|