diff --git a/README.md b/README.md index e5623b1..749f7cc 100644 --- a/README.md +++ b/README.md @@ -20,3 +20,14 @@ AND B - GNU General Public License, version 2 Grants an copyleft open source license with ABSOLUTELY NO WARRANTY. For the full GPL license text, please see: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html + + +## Installation and usage instructions + +[Installation](doc/INSTALL.md) + +[Usage](doc/USAGE.md) + +## Features + +[Features](doc/FEATURES.md) \ No newline at end of file diff --git a/doc/FEATURES.md b/doc/FEATURES.md new file mode 100644 index 0000000..61c23a6 --- /dev/null +++ b/doc/FEATURES.md @@ -0,0 +1,18 @@ +# Features + +## Translation command + +A command can Translate a Content for you + +`php bin/console ibexa:automated:translate [contentId] [serviceName] --from=eng-GB --to=fre-FR` + + +## Adding your own Remote Translation Service + +This bundle enables you to provide your own Translation mechanism. + +To do so, you need to: + +- create a service that implements Ibexa\Contracts\AutomatedTranslation\Client\ClientInterface +- implements the methods +- tag this service: `ibexa.automated_translation.client` diff --git a/doc/INSTALL.md b/doc/INSTALL.md new file mode 100644 index 0000000..87df3a6 --- /dev/null +++ b/doc/INSTALL.md @@ -0,0 +1,26 @@ +# Installation + +## Requirements + +* eZ Platform 4.x +* PHP 7.4+ + +## Installation steps + +Run `composer require ibexa/automated-translation` to install the bundle and its dependencies: + +### Change bundle's position in the configuration + +The new bundle is automatically enabled in the configuration thanks to Flex. Even though, it's important and required to move `Ibexa\Bundle\AutomatedTranslation\IbexaAutomatedTranslationBundle::class => ['all' => true]` before `Ibexa\Bundle\AdminUi\IbexaAdminUiBundle::class => ['all' => true],` due to the templates loading order. + +```php + ['all' => true], + Ibexa\Bundle\AdminUi\IbexaAdminUiBundle::class => ['all' => true], + ... +]; +``` + diff --git a/doc/USAGE.md b/doc/USAGE.md new file mode 100644 index 0000000..70ba58a --- /dev/null +++ b/doc/USAGE.md @@ -0,0 +1,20 @@ +# +Add a new configuration file with below information +``` +#app/config/ibexa_automated_translation.yaml + +ibexa_automated_translation: + system: + default: + configurations: + google: + apiKey: '%env(GOOGLE_API_KEY)%' + deepl: + authKey: '%env(DEEPL_API_KEY)%' +``` +Add your API key(s) in .env file + +``` +GOOGLE_API_KEY=... +DEEPL_API_KEY=... +``` \ No newline at end of file