Skip to content

Commit

Permalink
feat(docker): allow to customize WEBLATE_MACHINERY
Browse files Browse the repository at this point in the history
Fixes #9415
  • Loading branch information
nijel committed Jun 19, 2024
1 parent 96a91b8 commit 501c57a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docs/admin/install/docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1736,8 +1736,8 @@ Localization CDN
:setting:`LOCALIZE_CDN_PATH`


Changing enabled apps, checks, add-ons or autofixes
+++++++++++++++++++++++++++++++++++++++++++++++++++
Changing enabled apps, checks, add-ons, machine translation or autofixes
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

The built-in configuration of enabled checks, add-ons or autofixes can be
adjusted by the following variables:
Expand All @@ -1750,6 +1750,13 @@ adjusted by the following variables:
.. envvar:: WEBLATE_REMOVE_AUTOFIX
.. envvar:: WEBLATE_ADD_ADDONS
.. envvar:: WEBLATE_REMOVE_ADDONS
.. envvar:: WEBLATE_ADD_MACHINERY

.. versionadded:: 5.6.1

.. envvar:: WEBLATE_REMOVE_MACHINERY

.. versionadded:: 5.6.1

**Example:**

Expand All @@ -1765,6 +1772,7 @@ adjusted by the following variables:
:setting:`AUTOFIX_LIST`,
:setting:`WEBLATE_ADDONS`,
:setting:`django:INSTALLED_APPS`
:setting:`WEBLATE_MACHINERY`

Container settings
++++++++++++++++++
Expand Down
2 changes: 2 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Not yet released.

**Improvements**

* Docker container accepts :envvar:`WEBLATE_REMOVE_ADDONS` and :envvar:`WEBLATE_ADD_MACHINERY` to customize automatic suggestion services.

**Bug fixes**

**Compatibility**
Expand Down
30 changes: 30 additions & 0 deletions weblate/settings_docker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,36 @@
]
modify_env_list(WEBLATE_ADDONS, "ADDONS")

# Machinery configuration
WEBLATE_MACHINERY = [
"weblate.machinery.apertium.ApertiumAPYTranslation",
"weblate.machinery.aws.AWSTranslation",
"weblate.machinery.alibaba.AlibabaTranslation",
"weblate.machinery.baidu.BaiduTranslation",
"weblate.machinery.deepl.DeepLTranslation",
"weblate.machinery.glosbe.GlosbeTranslation",
"weblate.machinery.google.GoogleTranslation",
"weblate.machinery.googlev3.GoogleV3Translation",
"weblate.machinery.libretranslate.LibreTranslateTranslation",
"weblate.machinery.microsoft.MicrosoftCognitiveTranslation",
"weblate.machinery.modernmt.ModernMTTranslation",
"weblate.machinery.mymemory.MyMemoryTranslation",
"weblate.machinery.netease.NeteaseSightTranslation",
"weblate.machinery.tmserver.AmagamaTranslation",
"weblate.machinery.tmserver.TMServerTranslation",
"weblate.machinery.yandex.YandexTranslation",
"weblate.machinery.yandexv2.YandexV2Translation",
"weblate.machinery.saptranslationhub.SAPTranslationHub",
"weblate.machinery.youdao.YoudaoTranslation",
"weblate.machinery.ibm.IBMTranslation",
"weblate.machinery.systran.SystranTranslation",
"weblate.machinery.openai.OpenAITranslation",
"weblate.machinery.weblatetm.WeblateTranslation",
"weblate.memory.machine.WeblateMemory",
]
modify_env_list(WEBLATE_MACHINERY, "MACHINERY")


# E-mail address that error messages come from.
SERVER_EMAIL = get_env_str("WEBLATE_SERVER_EMAIL", "weblate@example.com")

Expand Down

0 comments on commit 501c57a

Please sign in to comment.