anylang-dev 0.1.1 → 0.1.2
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 +4 -5
- 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": "
|
|
89
|
+
"output": "anylang.ts",
|
|
90
90
|
"importFrom": "anylang-dev/runtime"
|
|
91
91
|
},
|
|
92
92
|
"functionName": "$tr",
|
|
@@ -151,8 +151,7 @@ locales/
|
|
|
151
151
|
en.json
|
|
152
152
|
hi.json
|
|
153
153
|
anylang.lock.json
|
|
154
|
-
|
|
155
|
-
anylang.generated.ts
|
|
154
|
+
anylang.ts
|
|
156
155
|
```
|
|
157
156
|
|
|
158
157
|
The lock file stores SHA-256 fingerprints so unchanged strings are skipped on later runs.
|
|
@@ -172,7 +171,7 @@ anylang scan
|
|
|
172
171
|
```
|
|
173
172
|
|
|
174
173
|
This writes keyed source entries to `locales/en.json` and creates placeholder entries in each target locale.
|
|
175
|
-
It also generates `
|
|
174
|
+
It also generates `anylang.ts`, which imports all locale JSON files and exports runtime helpers.
|
|
176
175
|
|
|
177
176
|
3. Translate with Gemini:
|
|
178
177
|
|
|
@@ -221,7 +220,7 @@ import {
|
|
|
221
220
|
useLanguage,
|
|
222
221
|
useTr,
|
|
223
222
|
type LanguageCode
|
|
224
|
-
} from "./anylang
|
|
223
|
+
} from "./anylang";
|
|
225
224
|
```
|
|
226
225
|
|
|
227
226
|
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 || "
|
|
134
|
+
const output = path.resolve(config.runtime?.output || "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";
|