This plugin integrates with the OpenAI API and provides on-demand AI-powered translations for your fields. You can also optionally translate entire records.
Changelog
See the CHANGELOG.md file for details about all the latest features and improvements.
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}, and {recordContext}.
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.
Contextual Translations
The plugin now supports context-aware translations through the {recordContext} placeholder:
Benefits:
Better understanding of specialized terminology
Improved consistency across related fields
More accurate translations that respect the overall content meaning
Appropriate tone and style based on context
Customizing Prompts
You can customize the translation prompt template in the plugin settings:
Use {fieldValue} to represent the content to translate
Use {fromLocale} and {toLocale} to specify languages
Use {recordContext} to include the automatically generated record context
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.
License
This project is licensed under the MIT License - see the LICENSE file for details.