@adminforth/i18n 2.0.13 → 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 +11 -7
- package/index.ts +13 -13
- package/package.json +3 -3
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,17 @@ 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
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
462
|
+
const resp = yield this.options.completeAdapter.complete({
|
|
463
|
+
content: prompt,
|
|
464
|
+
maxTokens: prompt.length * 2,
|
|
465
|
+
outputSchema: {
|
|
466
|
+
name: "translation_response",
|
|
467
|
+
schema: {
|
|
468
|
+
type: "object",
|
|
469
|
+
properties: jsonSchemaProperties,
|
|
470
|
+
required: dedupRequired,
|
|
471
|
+
additionalProperties: false,
|
|
472
|
+
},
|
|
469
473
|
},
|
|
470
474
|
});
|
|
471
475
|
process.env.HEAVY_DEBUG && console.log(`🪲🔪LLM resp >> ${prompt.length}, <<${resp.content.length} :\n\n`, JSON.stringify(resp));
|
package/index.ts
CHANGED
|
@@ -536,19 +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
|
-
prompt.length * 2,
|
|
542
|
-
{
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
}
|
|
551
|
-
);
|
|
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,
|
|
549
|
+
},
|
|
550
|
+
},
|
|
551
|
+
});
|
|
552
552
|
|
|
553
553
|
process.env.HEAVY_DEBUG && console.log(`🪲🔪LLM resp >> ${prompt.length}, <<${resp.content.length} :\n\n`, JSON.stringify(resp));
|
|
554
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,11 +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.
|
|
45
|
+
"adminforth": "^2.42.0",
|
|
46
46
|
"i18n-iso-countries": "^7.13.0",
|
|
47
47
|
"semantic-release": "^24.2.1",
|
|
48
48
|
"semantic-release-slack-bot": "^4.0.2",
|