Module for auto translation using Google Cloud Translation for Silverstripe with Fluent.
- Requirements
- Installation
- Setup Google Cloud Translation API
- Setup OpenAI API
- Maintainer
- Disable extension for specific field types
- Silverstripe ^4 || ^5
- Fluent >=4
- PHP >= 7.1
- ext-json
composer require level51/silverstripe-fluent-autotranslate
Define the API key for the Google Cloud Translation API like this:
Level51\Autotranslate\AutotranslateFieldExtension:
translation_provider: 'google' # 'google' or 'openai' (default: google)
google_cloud_translation_api_key: 'YOUR_API_KEY'
See https://cloud.google.com/translate/docs/setup for setup instructions.
Define the API key for the OpenAI API like this:
Level51\Autotranslate\AutotranslateFieldExtension:
translation_provider: 'openai' # 'google' or 'openai' (default: google)
openai_translation_api_key: 'YOUR_API_KEY'
For Open AI you can specify terms to avoid translation by adding them to the openai_translation_blacklist
in the backend admin settings.
If you want to use this feature you have to add the BlackListExtension to the SiteConfig class.
SilverStripe\SiteConfig\SiteConfig:
extensions:
- Level51\Autotranslate\BlackListExtension
- Level51 hallo@lvl51.de
Level51\Autotranslate\AutotranslateFieldExtension:
class_blacklist:
- SilverStripe\Forms\HTMLEditor\HTMLEditorField