anylang-dev 0.1.2 → 0.1.3
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 +5 -4
- package/package.json +1 -1
- package/src/config.js +1 -1
- package/src/pipeline.js +1 -1
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ anylang translate
|
|
|
86
86
|
"exclude": ["node_modules", ".git", "dist", "build", ".next"],
|
|
87
87
|
"outDir": "locales",
|
|
88
88
|
"runtime": {
|
|
89
|
-
"output": "anylang.ts",
|
|
89
|
+
"output": "src/anylang.ts",
|
|
90
90
|
"importFrom": "anylang-dev/runtime"
|
|
91
91
|
},
|
|
92
92
|
"functionName": "$tr",
|
|
@@ -151,7 +151,8 @@ locales/
|
|
|
151
151
|
en.json
|
|
152
152
|
hi.json
|
|
153
153
|
anylang.lock.json
|
|
154
|
-
|
|
154
|
+
src/
|
|
155
|
+
anylang.ts
|
|
155
156
|
```
|
|
156
157
|
|
|
157
158
|
The lock file stores SHA-256 fingerprints so unchanged strings are skipped on later runs.
|
|
@@ -171,7 +172,7 @@ anylang scan
|
|
|
171
172
|
```
|
|
172
173
|
|
|
173
174
|
This writes keyed source entries to `locales/en.json` and creates placeholder entries in each target locale.
|
|
174
|
-
It also generates `anylang.ts`, which imports all locale JSON files and exports runtime helpers.
|
|
175
|
+
It also generates `src/anylang.ts`, which imports all locale JSON files and exports runtime helpers.
|
|
175
176
|
|
|
176
177
|
3. Translate with Gemini:
|
|
177
178
|
|
|
@@ -220,7 +221,7 @@ import {
|
|
|
220
221
|
useLanguage,
|
|
221
222
|
useTr,
|
|
222
223
|
type LanguageCode
|
|
223
|
-
} from "
|
|
224
|
+
} from "@/anylang";
|
|
224
225
|
```
|
|
225
226
|
|
|
226
227
|
You do not manually import `en.json`, `hi.json`, `ja.json`, etc. The generated file does that for you based on `sourceLocale` and `targetLocales`.
|
package/package.json
CHANGED
package/src/config.js
CHANGED
package/src/pipeline.js
CHANGED
|
@@ -131,7 +131,7 @@ function normalizeTargetEntry(entry) {
|
|
|
131
131
|
async function writeGeneratedRuntime(config) {
|
|
132
132
|
if (config.runtime === false) return;
|
|
133
133
|
|
|
134
|
-
const output = path.resolve(config.runtime?.output || "anylang.ts");
|
|
134
|
+
const output = path.resolve(config.runtime?.output || "src/anylang.ts");
|
|
135
135
|
const outDir = path.resolve(config.outDir);
|
|
136
136
|
const locales = [config.sourceLocale, ...config.targetLocales.filter((locale) => locale !== config.sourceLocale)];
|
|
137
137
|
const importFrom = config.runtime?.importFrom || "anylang-dev/runtime";
|