sheet-i18n 1.4.0-canary.5 β 1.4.0-canary.6
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 +11 -11
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -268,20 +268,20 @@ The `I18nStore` manages type-safe translation states, ensuring consistency acros
|
|
|
268
268
|
- **`supportedLocales`**: Array of supported locale strings.
|
|
269
269
|
- **`defaultLocale`**: The default locale, included in `supportedLocales`.
|
|
270
270
|
- **`localeSet`**: An object where keys match `supportedLocales`, and values are translation sets.
|
|
271
|
-
- **`typeSafe(optional, default =
|
|
271
|
+
- **`typeSafe(optional, default = false)`**: An optional boolean indicating whether to use type-safe translations.
|
|
272
272
|
|
|
273
273
|
> π‘ **typeSafe?** <br/>
|
|
274
|
-
> I18nStore
|
|
274
|
+
> I18nStore doesn't enforce adherence to your locale JSON definitions by default. This means that you can add translation data even if it isnβt pre-defined in your locale JSON files. However, if you prefer to enforce strict type-safety, you can manually enable the typeSafe option which allows you to notice the auto-completed list in translation data.
|
|
275
275
|
>
|
|
276
276
|
> ```tsx
|
|
277
|
-
> // typeSafe:
|
|
277
|
+
> // typeSafe: true
|
|
278
278
|
> const YourComponent = () => {
|
|
279
|
-
> // useTranslation
|
|
279
|
+
> // "useTranslation" shows the autocompletion suggestions
|
|
280
280
|
> const { t } = useTranslation('header');
|
|
281
281
|
>
|
|
282
282
|
> return (
|
|
283
283
|
> <div>
|
|
284
|
-
> {/* t
|
|
284
|
+
> {/* "t" function shows the autocompletion suggestions */}
|
|
285
285
|
> <button>{t('login')}</button>
|
|
286
286
|
> </div>
|
|
287
287
|
> );
|
|
@@ -637,17 +637,17 @@ export const i18nStore = new I18nStore({
|
|
|
637
637
|
```
|
|
638
638
|
|
|
639
639
|
> π‘ **typeSafe?** <br/>
|
|
640
|
-
> I18nStore
|
|
640
|
+
> I18nStore doesn't enforce adherence to your locale JSON definitions by default. This means that you can add translation data even if it isnβt pre-defined in your locale JSON files. However, if you prefer to enforce strict type-safety, you can manually enable the typeSafe option which allows you to notice the auto-completed list in translation data.
|
|
641
641
|
>
|
|
642
642
|
> ```tsx
|
|
643
|
-
> // typeSafe:
|
|
643
|
+
> // typeSafe: true
|
|
644
644
|
> const YourComponent = () => {
|
|
645
|
-
> //
|
|
645
|
+
> // "useTranslation" shows the autocompletion suggestions
|
|
646
646
|
> const { t } = useTranslation('header');
|
|
647
647
|
>
|
|
648
648
|
> return (
|
|
649
649
|
> <div>
|
|
650
|
-
> {/* "t" function
|
|
650
|
+
> {/* "t" function shows the autocompletion suggestions */}
|
|
651
651
|
> <button>{t('login')}</button>
|
|
652
652
|
> </div>
|
|
653
653
|
> );
|
|
@@ -877,10 +877,10 @@ sheet-i18n register --scope total
|
|
|
877
877
|
|
|
878
878
|
</br>
|
|
879
879
|
|
|
880
|
-
### π
|
|
880
|
+
### π import
|
|
881
881
|
|
|
882
882
|
```shell
|
|
883
|
-
npx sheet-i18n
|
|
883
|
+
npx sheet-i18n import
|
|
884
884
|
```
|
|
885
885
|
|
|
886
886
|
Exports translation data from Google Sheets to local export directory.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sheet-i18n",
|
|
3
|
-
"version": "1.4.0-canary.
|
|
3
|
+
"version": "1.4.0-canary.6",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/chltjdrhd777/sheet-i18n"
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
},
|
|
37
37
|
"license": "ISC",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@sheet-i18n/
|
|
40
|
-
"@sheet-i18n/
|
|
39
|
+
"@sheet-i18n/react": "1.1.0-canary.6",
|
|
40
|
+
"@sheet-i18n/importer": "1.4.0-canary.4"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"tsup": "^6.0.0",
|
|
44
44
|
"typescript": "^5.0.0",
|
|
45
|
-
"@sheet-i18n/typescript-config": "1.4.0-canary.
|
|
45
|
+
"@sheet-i18n/typescript-config": "1.4.0-canary.4"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
48
|
"build": "tsup",
|