The Odoo DeepL Translation module integrates the DeepL translation service with Odoo to provide automatic translation of fields such as text, product descriptions, and other content. This module allows for translating content from one language to another using the DeepL API within Odoo models.
Clone the repository into your Odoo custom add-ons directory:
git clone https://github.com/euroblaze/odoo_deepl.git
Install the module using Odoo's user interface or via command line:
./odoo-bin -d <your-database-name> -i odoo_deepl
Once installed, navigate to Settings -> General Settings and find the DeepL section to configure your API key.
API Key Setup:
Language Configuration:
Model Configuration:
Once the module is installed and configured:
You can extend the module to enable translation for custom models or fields. Below is an example of how to add DeepL translations to a custom model:
Inherit the deepl.translation.mixin
class in your custom model:
from odoo import models
class YourCustomModel(models.Model):
_inherit = 'deepl.translation.mixin'
# Define translatable fields
_translatable_fields = ['name', 'description']
Define the fields you want to be translated using the _translatable_fields
attribute in your custom model.
The module communicates with the DeepL API to perform translations. Here's a breakdown of the interaction:
translate
endpoint to send source text and receive the translated output.The translation logic is implemented in the deepl_translation.py
file, where the API request to DeepL is made using Odoo's HTTP client.
This module is designed to be easily extensible:
deepl.translation.mixin
class to integrate translation capabilities into custom models.feature/my-new-feature
).git commit -am 'Add some feature'
).git push origin feature/my-new-feature
).This module is licensed under the MIT License.
For issues, suggestions, or contributions, feel free to open an issue on the GitHub repository or contact the repository maintainers.
Developed and maintained by Simplify-ERP.
This README provides a detailed guide to understanding, installing, and customizing the Odoo DeepL module for developers and technical users.