Nextcloud libretranslate

Bonjour

J’ai installé libretranslate sur mon instance , j’y ai ajouter quelques langues et cela fonctionne assez bien.

Par contre pour l’intégrer dans nextcloud , je ne vois pas trop comment faire

A Nextcloud , j’ai ajouté cette application .

Dans leur documentation , ils indiquent ceci :

 ## Configure

    Configuration is done using your server's CLI. These following configuration values are available:

    - `host`: **required** URL of (your) LibreTranslate instance (without trailing `/`)
    - `port`: _optional_ Needed if you are **not** running LibreTranslate on the default http port (http 80 or https 443). E.g. if it is running on a custom port (or LT's default port 5000) (defaults to _`null`_)
    - `apikey`: _optional_ Needed if the LT instance requires an api key (defaults to _`null`_)
    - `from_lang`: _optional_ default language key you want to translate from (defaults to _en_)
    - `to_lang`: _optional_ default language key of your destination language (defaults to _de_)

    ### Example:
    ```bash
    occ config:app:set integration_libretranslate host --value="https://cloud.your-domain.tld"
    occ config:app:set integration_libretranslate port --value="5000"
    occ config:app:set integration_libretranslate apikey --value="<API_KEY>"
    occ config:app:set integration_libretranslate from_lang --value="en"
    occ config:app:set integration_libretranslate to_lang --value="de"
    ```

Mais , je vois pas trop quel fichier dois je modifier pour lui indiquer les bonnes infos .

Hello.

I installed freetranslate on my instance, I added a few languages and it works pretty well.

On the other hand, to integrate it into nextcloud, I don’t know how to do it.

To Nextcloud, I added this application.

In their documentation, they state:

Configure

Configuration is done using your server's CLI. These following configuration values are available:

- `host`: **required** URL of (your) LibreTranslate instance (without trailing `/`)
- `port`: _optional_ Needed if you are **not** running LibreTranslate on the default http port (http 80 or https 443). E.g. if it is running on a custom port (or LT's default port 5000) (defaults to _`null`_)
- `apikey`: _optional_ Needed if the LT instance requires an api key (defaults to _`null`_)
- `from_lang`: _optional_ default language key you want to translate from (defaults to _en_)
- `to_lang`: _optional_ default language key of your destination language (defaults to _de_)

### Example:
```bash
occ config:app:set integration_libretranslate host --value="https://cloud.your-domain.tld"
occ config:app:set integration_libretranslate port --value="5000"
occ config:app:set integration_libretranslate apikey --value="<API_KEY>"
occ config:app:set integration_libretranslate from_lang --value="en"
occ config:app:set integration_libretranslate to_lang --value="de"
```

But, I don’t see what file I need to edit to tell him the right info.
.

Hi stefan1,

The example is not a file, but commands to execute I think. Each line is an occ-command. More information about occ is available at Using the occ command — Nextcloud latest Administration Manual latest documentation

The end result would be something like

$ sudo su - 
# sudo -u nextcloud php8.2 /var/www/nextcloud/occ config:app:set integration.... etc
# sudo -u nextcloud ....

Maybe it is not necessary to become root first, but I don’t know the password of my nextcloud-user. After that you use PHP to run the occ-command as user nextcloud (the owner of the Nextcloud files) with the options that are needed.

I’m not very familiar with occ; for example, now that I test it myself I get an error (as I usually do the first few tries with occ):

# sudo -u nextcloud php8.2 /var/www/nextcloud/occ status
An unhandled exception has been thrown:
Doctrine\DBAL\Exception: Failed to connect to the database: An exception occurred in the driver: could not find driver in /var/www/nextcloud/lib/private/DB/Connection.php:140
Stack trace:
...
An unhandled exception has been thrown:
OCP\HintException: [0]: Memcache OC\Memcache\APCu not available for local cache (Is the matching PHP module installed and enabled?)

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.