1.5.0 • Published 6 months ago
datocms-plugin-ai-translations v1.5.0
AI Translations
This plugin integrates with the OpenAI API and provides on-demand AI-powered translations for your fields. You can also optionally translate entire records.
Configuration
On the plugin’s Settings screen:
- OpenAI API Key: Paste a valid OpenAI API key. The plugin uses this key for translation requests.
- GPT Model: Select one of the available GPT-based models. Using gpt-4o-mini is recomended.
- Translatable Field Types: Pick which field editor types (single_line, markdown, structured_text, etc.) can be translated.
- Translate Whole Record: Decide if you want the sidebar feature that allows users to translate every localized field in the record at once.
- Prompt Template: Customize how translations are requested. The plugin uses placeholders like
{fieldValue}
,{fromLocale}
,{toLocale}
.
Save your changes. The plugin is now ready.
Usage
Field-Level Translations
For each translatable field:
- Click on the field’s dropdown menu in the DatoCMS record editor (on the top right of the field)
- Select “Translate to” -> Choose a target locale or “All locales.”
- The plugin uses your OpenAI settings to generate a translation.
- The field updates automatically.
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.
Whole-Record Translations
If enabled:
- Open a record that has multiple locales.
- The “DatoGPT Translate” panel appears in the sidebar.
- Select source and target locales, then click “Translate Entire Record.”
- All translatable fields get updated with AI translations.
Excluding Models or Roles
- Models to Exclude: You can specify model API keys that shouldn’t be affected by translations.
- Roles to Exclude: Certain roles can be restricted from using or seeing the plugin features.
Troubleshooting
- Invalid API Key: Ensure your OpenAI API key is correct and has sufficient usage limits.
- Localization: Make sure your project has at least two locales, otherwise translation actions won’t appear.