@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 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"> <img src="https://img.shields.io/npm/dt/@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> <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
+ [![Ask AI](https://tluma.ai/badge)](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
- ## For ussage, see [AdminForth i18n Documentation](https://adminforth.dev/docs/tutorial/Plugins/i18n/)
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
@@ -20,5 +20,5 @@ custom/package.json
20
20
  custom/pnpm-lock.yaml
21
21
  custom/tsconfig.json
22
22
 
23
- sent 44,921 bytes received 305 bytes 90,452.00 bytes/sec
23
+ sent 44,905 bytes received 305 bytes 90,420.00 bytes/sec
24
24
  total size is 43,758 speedup is 0.97
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(prompt, prompt.length * 2, {
463
- name: "translation_response",
464
- schema: {
465
- type: "object",
466
- properties: jsonSchemaProperties,
467
- required: dedupRequired,
468
- additionalProperties: false,
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
- name: "translation_response",
544
- schema: {
545
- type: "object",
546
- properties: jsonSchemaProperties,
547
- required: dedupRequired,
548
- additionalProperties: false,
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.13",
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.35.0"
41
+ "adminforth": "^2.42.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/node": "^22.10.7",
45
- "adminforth": "^2.35.0",
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",