datocms-plugin-ai-translations 0.1.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/README.md +47 -0
- package/dist/assets/index-BRpHaheI.js +111 -0
- package/dist/assets/index-CW5xMxcB.css +1 -0
- package/dist/index.html +16 -0
- package/dist/robots.txt +3 -0
- package/docs/.gitkeep +0 -0
- package/docs/cover-1200x800.png +0 -0
- package/package.json +52 -0
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# AI Translations
|
|
2
|
+
|
|
3
|
+
This plugin integrates with the OpenAI API and provides on-demand AI-powered translations for your fields. You can also optionally translate entire records.
|
|
4
|
+
|
|
5
|
+
## Configuration
|
|
6
|
+
|
|
7
|
+
On the plugin’s Settings screen:
|
|
8
|
+
|
|
9
|
+
1. **OpenAI API Key**: Paste a valid OpenAI API key. The plugin uses this key for translation requests.
|
|
10
|
+
2. **GPT Model**: Select one of the available GPT-based models. Using gpt-4o-mini is recomended.
|
|
11
|
+
3. **Translatable Field Types**: Pick which field editor types (single_line, markdown, structured_text, etc.) can be translated.
|
|
12
|
+
4. **Translate Whole Record**: Decide if you want the sidebar feature that allows users to translate every localized field in the record at once.
|
|
13
|
+
5. **Prompt Template**: Customize how translations are requested. The plugin uses placeholders like `{fieldValue}`, `{fromLocale}`, `{toLocale}`.
|
|
14
|
+
|
|
15
|
+
Save your changes. The plugin is now ready.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
### Field-Level Translations
|
|
20
|
+
|
|
21
|
+
For each translatable field:
|
|
22
|
+
|
|
23
|
+
1. Click on the field’s dropdown menu in the DatoCMS record editor (on the top right of the field)
|
|
24
|
+
2. Select “Translate to” -> Choose a target locale or “All locales.”
|
|
25
|
+
3. The plugin uses your OpenAI settings to generate a translation.
|
|
26
|
+
4. The field updates automatically.
|
|
27
|
+
|
|
28
|
+
You can also pull content from a different locale by choosing “Translate from” to copy and translate that locale’s content into your current locale.
|
|
29
|
+
|
|
30
|
+
### Whole-Record Translations
|
|
31
|
+
|
|
32
|
+
If enabled:
|
|
33
|
+
|
|
34
|
+
1. Open a record that has multiple locales.
|
|
35
|
+
2. The “DatoGPT Translate” panel appears in the sidebar.
|
|
36
|
+
3. Select source and target locales, then click “Translate Entire Record.”
|
|
37
|
+
4. All translatable fields get updated with AI translations.
|
|
38
|
+
|
|
39
|
+
## Excluding Models or Roles
|
|
40
|
+
|
|
41
|
+
- **Models to Exclude**: You can specify model API keys that shouldn’t be affected by translations.
|
|
42
|
+
- **Roles to Exclude**: Certain roles can be restricted from using or seeing the plugin features.
|
|
43
|
+
|
|
44
|
+
## Troubleshooting
|
|
45
|
+
|
|
46
|
+
- **Invalid API Key**: Ensure your OpenAI API key is correct and has sufficient usage limits.
|
|
47
|
+
- **Localization**: Make sure your project has at least two locales, otherwise translation actions won’t appear.
|