@goenhance/strapi-plugins-translate 0.11.0
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/LICENSE +21 -0
- package/README.md +88 -0
- package/dist/_chunks/App-DvJ8tPer.js +674 -0
- package/dist/_chunks/App-uB_CPrcd.mjs +674 -0
- package/dist/_chunks/en-BOBGCAB6.mjs +65 -0
- package/dist/_chunks/en-BaJyCZ_c.js +65 -0
- package/dist/_chunks/index-B8MBOdIV.js +276 -0
- package/dist/_chunks/index-DkZZ45sW.mjs +277 -0
- package/dist/_chunks/zh-CtGwhmjc.mjs +65 -0
- package/dist/_chunks/zh-DUCnaWvE.js +65 -0
- package/dist/_chunks/zh-Hans-CJW3RUKL.js +65 -0
- package/dist/_chunks/zh-Hans-pTiPqgIS.mjs +65 -0
- package/dist/admin/index.js +3 -0
- package/dist/admin/index.mjs +4 -0
- package/dist/admin/src/components/Initializer.d.ts +5 -0
- package/dist/admin/src/components/LLMButton.d.ts +2 -0
- package/dist/admin/src/components/PluginIcon.d.ts +18 -0
- package/dist/admin/src/index.d.ts +11 -0
- package/dist/admin/src/pages/App.d.ts +2 -0
- package/dist/admin/src/pages/BatchTranslatePage.d.ts +2 -0
- package/dist/admin/src/pages/SettingsPage.d.ts +2 -0
- package/dist/admin/src/pluginId.d.ts +1 -0
- package/dist/admin/src/utils/constants.d.ts +4 -0
- package/dist/admin/src/utils/getLocaleFromUrl.d.ts +1 -0
- package/dist/admin/src/utils/getTranslation.d.ts +2 -0
- package/dist/server/index.js +754 -0
- package/dist/server/index.mjs +755 -0
- package/dist/server/src/bootstrap.d.ts +5 -0
- package/dist/server/src/config/constants.d.ts +7 -0
- package/dist/server/src/config/index.d.ts +11 -0
- package/dist/server/src/content-types/index.d.ts +2 -0
- package/dist/server/src/controllers/admin.controller.d.ts +21 -0
- package/dist/server/src/controllers/index.d.ts +43 -0
- package/dist/server/src/destroy.d.ts +5 -0
- package/dist/server/src/index.d.ts +2 -0
- package/dist/server/src/middlewares/index.d.ts +2 -0
- package/dist/server/src/policies/index.d.ts +2 -0
- package/dist/server/src/register.d.ts +5 -0
- package/dist/server/src/routes/admin.d.ts +9 -0
- package/dist/server/src/routes/index.d.ts +14 -0
- package/dist/server/src/services/index.d.ts +2 -0
- package/dist/server/src/services/llm-service.d.ts +6 -0
- package/dist/server/src/types/controllers.d.ts +22 -0
- package/dist/server/src/types/index.d.ts +53 -0
- package/dist/server/src/utils/json-utils.d.ts +4 -0
- package/package.json +88 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Franziska Fieke (grenzbotin)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# <img alt="Strapi LLM Translator Icon" src="./docs/strapi-llm-translator-icon.png" width="50"> Strapi LLM Translator
|
|
2
|
+
|
|
3
|
+
#### AI-Powered Content Translation for Strapi
|
|
4
|
+
|
|
5
|
+
The Strapi LLM Translator plugin enhances your localization workflow by utilising LLMs to translate your content fields with a single click. Compatible with any OpenAI-compatible LLM, it preserves your original formatting while delivering fast, accurate results in seconds.
|
|
6
|
+
|
|
7
|
+
## 🚀 Key Features
|
|
8
|
+
|
|
9
|
+
- 🌍 **Multi-field Support** - Translates all text-based fields (string, text, richtext) and JSON/Blocks content, including Strapi 5 structured rich text
|
|
10
|
+
- 🔌 **LLM Agnostic** - Works with any OpenAI-compatible API (your choice of provider or local)
|
|
11
|
+
- 📝 **Format Preservation** - Maintains markdown formatting during translation
|
|
12
|
+
- 🔗 **Smart UUID Handling** - Auto-translates slugs when i18n is enabled with relative fields
|
|
13
|
+
- ⚡ **Auto-fill** - Instantly populates generated translations
|
|
14
|
+
- 🎛️ **Customizable** - Adjust system prompts and temperature for optimal results
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
<img alt="strapi-llm-translator" style="border-radius:5px" src="./docs/strapi-llm-translator.gif" width="640">
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## ✅ Tested With
|
|
23
|
+
|
|
24
|
+
- **Strapi**: v5.12.x, v5.15.x
|
|
25
|
+
- **LLM Providers**:
|
|
26
|
+
- OpenAI: `gpt-4o`
|
|
27
|
+
- Groq: `meta-llama/llama-4-scout-17b-16e-instruct`
|
|
28
|
+
- Local: `Ollama`, e.g. `phi4-mini`
|
|
29
|
+
|
|
30
|
+
## 🛠️ Installation & Setup
|
|
31
|
+
|
|
32
|
+
### Prerequisites
|
|
33
|
+
|
|
34
|
+
- Strapi project (v5+)
|
|
35
|
+
- API key for your preferred LLM provider, Base Url + Model Name
|
|
36
|
+
- Configured internationalization with at least two languages in your Strapi application
|
|
37
|
+
|
|
38
|
+
### Installation
|
|
39
|
+
|
|
40
|
+
1. Install the plugin in your Strapi project:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npm install strapi-llm-translator
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
2. Configure environment variables:
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
# Optional - Your LLM provider API key (Can be left empty if there is no API Key needed)
|
|
50
|
+
LLM_TRANSLATOR_LLM_API_KEY=
|
|
51
|
+
|
|
52
|
+
# Optional - Defaults to OpenAI's endpoint
|
|
53
|
+
STRAPI_ADMIN_LLM_TRANSLATOR_LLM_BASE_URL=
|
|
54
|
+
|
|
55
|
+
# Optional - Defaults to gpt-4o
|
|
56
|
+
STRAPI_ADMIN_LLM_TRANSLATOR_LLM_MODEL=
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
3. Rebuild your admin panel:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
npm run build
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
After installation, customize the translation behavior through the LLM Translator configuration page:
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
<img alt="Strapi LLM Translator Configuration screen" style="border-radius:5px" src="./docs/strapi-llm-translator-configuration.png" width="640">
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 💻 Plugin Development
|
|
74
|
+
|
|
75
|
+
To contribute to the plugin development:
|
|
76
|
+
|
|
77
|
+
1. Navigate to your Strapi project
|
|
78
|
+
2. Add and link the plugin: `npx yalc add strapi-llm-translator && npx yalc link strapi-llm-translator && npm install`
|
|
79
|
+
3. Start your Strapi project
|
|
80
|
+
4. In a separate terminal, watch the plugin for changes:
|
|
81
|
+
`npm run watch:link`
|
|
82
|
+
|
|
83
|
+
## About
|
|
84
|
+
|
|
85
|
+
Franziska Fieke ([grenzbotin](https://github.com/grenzbotin)) – [vulpis.dev](https://vulpis.dev)
|
|
86
|
+
|
|
87
|
+
Distributed under the MIT license.
|
|
88
|
+
See `LICENSE` for more information.
|