You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But in fact we can (also prefer to) define the keys and values each of the language folder (src/i18n) with object type, which will be more readable.
39
+
But in fact we can (also prefer to) define the keys and values in each of the language folder (src/i18n) with object type, which will be more readable.
40
40
41
41
```javascript
42
42
// src/i18n/en
@@ -59,6 +59,7 @@ export const student = {
59
59
Using flat, we can flatten the keys in language object automatically, and convert into a correct format for react-intl
60
60
61
61
```javascript
62
+
importflattenfrom"flat";
62
63
63
64
constmessages= {
64
65
en:flatten(en),
@@ -69,7 +70,7 @@ const messages = {
69
70
### Centralizing the place for retrieving locale keys
70
71
We can centralize the locale keys to avoid the typo.
0 commit comments