@adminforth/i18n 2.0.12 → 2.0.14
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 +26 -2
- package/build.log +1 -1
- package/dist/index.js +5 -2
- package/index.ts +12 -14
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,7 +1,31 @@
|
|
|
1
1
|
# AdminForth i18n Plugin
|
|
2
2
|
|
|
3
|
-
<img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT" /> <img src="https://woodpecker.devforth.io/api/badges/3848/status.svg" alt="Build Status" /> <a href="https://www.npmjs.com/package/@adminforth/i18n"
|
|
3
|
+
<img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="License: MIT" /> <img src="https://woodpecker.devforth.io/api/badges/3848/status.svg" alt="Build Status" /> <a href="https://www.npmjs.com/package/@adminforth/i18n"><img src="https://img.shields.io/npm/dm/@adminforth/i18n" alt="npm downloads" /></a> <a href="https://www.npmjs.com/package/@adminforth/i18n"><img src="https://img.shields.io/npm/v/@adminforth/i18n" alt="npm version" /></a>
|
|
4
|
+
|
|
5
|
+
[](https://tluma.ai/ask-ai/devforth/adminforth)
|
|
4
6
|
|
|
5
7
|
Allows to store all translation strings in an adminforth application in a single resource.
|
|
6
8
|
|
|
7
|
-
##
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- Store translation strings in a single AdminForth resource.
|
|
12
|
+
- Support multilingual admin experiences across the app.
|
|
13
|
+
- Keep localization management inside your back office.
|
|
14
|
+
- Centralize translation editing for faster updates.
|
|
15
|
+
|
|
16
|
+
## Documentation
|
|
17
|
+
|
|
18
|
+
Full setup and configuration guide:
|
|
19
|
+
|
|
20
|
+
[AdminForth i18n Documentation](https://adminforth.dev/docs/tutorial/Plugins/i18n/)
|
|
21
|
+
|
|
22
|
+
## About AdminForth
|
|
23
|
+
|
|
24
|
+
AdminForth is an open-source, agent-first admin framework for building robust admin panels and back-office applications faster.
|
|
25
|
+
|
|
26
|
+
## Related links
|
|
27
|
+
|
|
28
|
+
- [AdminForth website](https://adminforth.dev)
|
|
29
|
+
- [npm package](https://www.npmjs.com/package/@adminforth/i18n)
|
|
30
|
+
- [More AdminForth plugins](https://adminforth.dev/docs/tutorial/ListOfPlugins/)
|
|
31
|
+
- [Built by DevForth](https://devforth.io)
|
package/build.log
CHANGED
package/dist/index.js
CHANGED
|
@@ -459,13 +459,16 @@ export default class I18nPlugin extends AdminForthPlugin {
|
|
|
459
459
|
const jsonSchemaRequired = strings.map(s => s.en_string);
|
|
460
460
|
const dedupRequired = Array.from(new Set(jsonSchemaRequired));
|
|
461
461
|
// call OpenAI
|
|
462
|
-
const resp = yield this.options.completeAdapter.complete(
|
|
463
|
-
|
|
462
|
+
const resp = yield this.options.completeAdapter.complete({
|
|
463
|
+
content: prompt,
|
|
464
|
+
maxTokens: prompt.length * 2,
|
|
465
|
+
outputSchema: {
|
|
464
466
|
name: "translation_response",
|
|
465
467
|
schema: {
|
|
466
468
|
type: "object",
|
|
467
469
|
properties: jsonSchemaProperties,
|
|
468
470
|
required: dedupRequired,
|
|
471
|
+
additionalProperties: false,
|
|
469
472
|
},
|
|
470
473
|
},
|
|
471
474
|
});
|
package/index.ts
CHANGED
|
@@ -536,21 +536,19 @@ export default class I18nPlugin extends AdminForthPlugin {
|
|
|
536
536
|
const jsonSchemaRequired = strings.map(s => s.en_string);
|
|
537
537
|
const dedupRequired = Array.from(new Set(jsonSchemaRequired));
|
|
538
538
|
// call OpenAI
|
|
539
|
-
const resp = await this.options.completeAdapter.complete(
|
|
540
|
-
prompt,
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
required: dedupRequired,
|
|
550
|
-
},
|
|
539
|
+
const resp = await this.options.completeAdapter.complete({
|
|
540
|
+
content: prompt,
|
|
541
|
+
maxTokens: prompt.length * 2,
|
|
542
|
+
outputSchema: {
|
|
543
|
+
name: "translation_response",
|
|
544
|
+
schema: {
|
|
545
|
+
type: "object",
|
|
546
|
+
properties: jsonSchemaProperties,
|
|
547
|
+
required: dedupRequired,
|
|
548
|
+
additionalProperties: false,
|
|
551
549
|
},
|
|
552
|
-
}
|
|
553
|
-
);
|
|
550
|
+
},
|
|
551
|
+
});
|
|
554
552
|
|
|
555
553
|
process.env.HEAVY_DEBUG && console.log(`🪲🔪LLM resp >> ${prompt.length}, <<${resp.content.length} :\n\n`, JSON.stringify(resp));
|
|
556
554
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adminforth/i18n",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.14",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -38,10 +38,11 @@
|
|
|
38
38
|
"p-limit": "^7.3.0"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"adminforth": "^2.
|
|
41
|
+
"adminforth": "^2.42.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/node": "^22.10.7",
|
|
45
|
+
"adminforth": "^2.42.0",
|
|
45
46
|
"i18n-iso-countries": "^7.13.0",
|
|
46
47
|
"semantic-release": "^24.2.1",
|
|
47
48
|
"semantic-release-slack-bot": "^4.0.2",
|