10.8.8 • Published 2 months ago

directus-extension-auto-translation v10.8.8

Weekly downloads
-
License
-
Repository
-
Last release
2 months ago

About

This extension automatically translates Directus collections translation fields. This will be achieved by DeepL integration.

With a free DeepL account you can translate 500.000 words per month free.

Requirements

Installation

  1. Backup your database!
  2. Install the extension
    • Normal project
      cd <directus-project-folder>
      npm install directus-extension-auto-translation
    • Docker-Compose In your docker-compose.yml modify your container:
      directus:
          image: directus/directus:9.16.1
          command: >
              sh -c "
              npm install directus-extension-auto-translation && 
              npx directus bootstrap && echo 'Node' && 
              node node_modules/directus/dist/start.js
              "
          ...
      ...
  3. Recommended

    • Disable saving API key into database.
    • a)
      • Add the env Variable: AUTO_TRANSLATE_API_KEY_SAVING_PATH which holds a path
      • Since saving an API key in the database is never a good idea. This allows us, to save the Key into a File.
      • This allows your customers to dynamically change the API key.
      • setup:
        • volumes:
          • - ./secrets:/directus/secrets
        • env section:
          • AUTO_TRANSLATE_API_KEY_SAVING_PATH: "/directus/secrets/api-key-in-file.txt"
    • b)
      • Add the env Variable: AUTO_TRANSLATE_API_KEY which holds the api key
      • This does not allow dynamically changing the API key as in option a)
  4. Follow the instructions in your Directus App add the new created table (auto_translation_settings)

Usage

This example shows how to use the extension for a collection wikis

  1. Add a translation type field to your collection
  2. Directus automatically creates a wikis_translations and languages collection
  3. In this translation collection (wikis_translations)
    • Add a be_source_for_translations field (default: true)
      • This field is used to determine if the translation is the source of the translation
    • Add a let_be_translated field (default: true)
      • This field is used to determine if the record should be translated

If you now create or update a record in the wikis collection with a translation it will be automatically translated.

Contributors

The FireboltCasters

10.8.8

2 months ago

10.8.4

4 months ago

1.1.4

8 months ago

1.1.3

8 months ago

1.1.2

9 months ago

1.1.1

1 year ago

1.0.51

2 years ago

1.0.41

2 years ago

1.0.46

2 years ago

1.0.56

2 years ago

1.0.36

2 years ago

1.0.30

2 years ago

1.0.29

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago