Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more options to the DeepL settings (Fixes #831) #835

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alexkiro
Copy link

@alexkiro alexkiro commented Oct 28, 2024

  • Add the ability to configure glossaries by (source, target) language pairs.
  • Add the ability to configure the timeout instead of having it hardcoded to 30.
  • Add tests for the new glossary options.
  • Update docs for the new options.

Fixes #831


I've also extracted constructing the parameters into a separate method. This way if anyone else needs even more advanced customizations of the parameters it's easier to extend:

from wagtail_localize.machine_translators.deepl import DeepLTranslator


class CustomDeepLTranslator(DeepLTranslator):
    def get_parameters(self, source_locale, target_locale, strings):
        parameters = super().get_parameters(source_locale, target_locale, strings)
        parameters["another_option"] = "My custom value"
        return parameters

- Add the ability to configure glossaries by (source, target)
  language pairs.
- Add the ability to configure the timeout instead of having it
  hardcoded to 30.
- Add tests for the new glossary options.
- Update docs for the new options.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow the use of Glossaries when using DeepL
1 participant