Skip to content

Setup: Translators

dante di domenico edited this page Dec 1, 2023 · 1 revision

Edit configuration

BEdita Manager provides a configuration to setup translation engines (aka translators) for automatic translation of text fields.

Set Translators in config/app_local.php (or in config/projects/<projectName>.php if you use multi project configuration).

Example for php file:

'Translators' => [
    'aws' => [
        'name' => 'AWS',
        'class' => '\BEdita\I18n\Aws\Core\Translator',
        'options' => [
            'auth_key' => '**************',
        ],
    ],
    'deepl' => [
        'name' => 'DeepL',
        'class' => '\BEdita\I18n\Deepl\Core\Translator',
        'options' => [
           'auth_key' => '**************',
        ],
    ],
    'google' => [
        'name' => 'Google',
        'class' => '\BEdita\I18n\Google\Core\Translator',
        'options' => [
            'auth_key' => '**************',
        ],
    ],
    'microsoft' => [
        'name' => 'Microsoft',
        'class' => '\BEdita\I18n\Microsoft\Core\Translator',
        'options' => [
            'auth_key' => '**************',
        ],
    ],
],

In the example above you can see the configuration for four different translators: AWS, DeepL, Google and Microsoft (respectively from the following plugins: https://github.com/bedita/i18n-aws, https://github.com/bedita/i18n-deepl, https://github.com/bedita/i18n-google and https://github.com/bedita/i18n-microsoft). You can add as many translators as you want, but you must provide a unique name for each one. Note that the class option must be a valid class name, and the class must implement the \BEdita\I18n\TranslatorInterface interface.

Clone this wiki locally