Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
18 changes: 18 additions & 0 deletions doc/FEATURES.md
Original file line number Diff line number Diff line change
@@ -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`
26 changes: 26 additions & 0 deletions doc/INSTALL.md
Original file line number Diff line number Diff line change
@@ -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
<?php

return [
...
Ibexa\Bundle\AutomatedTranslation\IbexaAutomatedTranslationBundle::class => ['all' => true],
Ibexa\Bundle\AdminUi\IbexaAdminUiBundle::class => ['all' => true],
...
];
```

20 changes: 20 additions & 0 deletions doc/USAGE.md
Original file line number Diff line number Diff line change
@@ -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=...
```