kotori 5.0.10 → 5.0.12
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 +10 -5
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -3,16 +3,21 @@
|
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
6
|
-
<a href="https://www.npmjs.com/package/kotori"><img src="https://img.shields.io/npm/v/kotori?color=
|
|
7
|
-
<img src="https://img.shields.io/
|
|
8
|
-
<a href="https://github.com/tylim88/Kotori/blob/main/LICENSE"><img src="https://img.shields.io/github/license/tylim88/Kotori?color=blue" alt="License"></a>
|
|
6
|
+
<a href="https://www.npmjs.com/package/kotori"><img src="https://img.shields.io/npm/v/kotori?color=blue" alt="NPM Version"></a>
|
|
7
|
+
<a href="https://codecov.io/gh/tylim88/Kotori"><img src="https://img.shields.io/codecov/c/github/tylim88/Kotori?branch=main" alt="Coverage"></a>
|
|
9
8
|
<img src="https://img.shields.io/badge/bundle%20size-0.28kB-emerald" alt="Bundle Size">
|
|
9
|
+
<a href="https://github.com/tylim88/Kotori/blob/main/LICENSE"><img src="https://img.shields.io/github/license/tylim88/Kotori?color=blue" alt="License"></a>
|
|
10
|
+
<img src="https://img.shields.io/badge/dependencies-0-success" alt="Dependencies">
|
|
10
11
|
</p>
|
|
11
12
|
|
|
12
13
|
<p align="center">
|
|
13
14
|
🕊️ Kotori is a zero-config, fully type-safe, and modular internationalization library for React that compiles down to just 0.28kB. No JSON, no external CLI tools, no codegen—just live type inference from your strings.
|
|
14
15
|
</p>
|
|
15
16
|
|
|
17
|
+
## Note
|
|
18
|
+
|
|
19
|
+
⚠️ Doesn't work with React Compiler!!
|
|
20
|
+
|
|
16
21
|
```ts
|
|
17
22
|
const { dict, t } = kotori({
|
|
18
23
|
primaryLanguageTag: 'en',
|
|
@@ -226,8 +231,8 @@ kotori uses [BCP 47](https://www.iana.org/assignments/language-subtag-registry/l
|
|
|
226
231
|
|
|
227
232
|
## Tips
|
|
228
233
|
|
|
229
|
-
- If you plan to add new languages frequently, consider colocating all your dicts in a single file. It is easier to copy the entire file and hand it to an AI to translate.
|
|
230
|
-
- If your supported languages are fixed, consider splitting dicts by page or component. Translations stay close to the code that uses them and are easier to maintain.
|
|
234
|
+
- If you plan to add new languages frequently, consider colocating all your dicts in a single file or multiple files in one folder. It is easier to copy the entire file and hand it to an AI to translate.
|
|
235
|
+
- If your supported languages are fixed, consider splitting dicts by page or component. Translations stay close to the code that uses them and are easier to maintain.
|
|
231
236
|
- Both approaches are tree-shakeable — only the dicts imported by the current page are included in its bundle.
|
|
232
237
|
|
|
233
238
|
## Roadmap
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kotori",
|
|
3
3
|
"description": "0.28kB Strongly-typed and tree-shakeable internationalization library for React",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.12",
|
|
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",
|
|
@@ -45,11 +45,13 @@
|
|
|
45
45
|
],
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@biomejs/biome": "^2.4.12",
|
|
48
|
+
"@testing-library/react": "^16.3.2",
|
|
48
49
|
"@types/react": "^19.2.14",
|
|
49
50
|
"@types/react-dom": "^19.2.3",
|
|
50
51
|
"@vitejs/plugin-react": "^6.0.1",
|
|
51
52
|
"@vitest/coverage-v8": "^4.1.5",
|
|
52
53
|
"bcp47-language-tags": "^1.1.0",
|
|
54
|
+
"happy-dom": "^20.9.0",
|
|
53
55
|
"husky": "^9.1.7",
|
|
54
56
|
"lint-staged": "^16.4.0",
|
|
55
57
|
"react": "^19.2.5",
|