diff options
author | DjLegolas <djlegolas@protonmail.com> | 2024-05-02 00:23:51 +0200 |
---|---|---|
committer | Calum Lind <calumlind+deluge@gmail.com> | 2024-08-24 14:42:13 +0200 |
commit | 18fa028d2d6b3aa9abff66b1ab9ea7979f31d670 (patch) | |
tree | f95c88a86c63b9b135b97f594f1cbf925157283b | |
parent | [Build] Prevent usage of twisted>=23 on Windows (diff) | |
download | deluge-18fa028d2d6b3aa9abff66b1ab9ea7979f31d670.tar.xz deluge-18fa028d2d6b3aa9abff66b1ab9ea7979f31d670.zip |
[3635][WebUI] fix language change to system default
When setting a language, we set 2 environment variables at run time.
Setting the language back to `System Default`, we don't clean those env
variables.
In the WebUI, the page only reloads, and we still use the env variables
to set the language back to the previous one.
This does not affect GTK.
Closes: https://dev.deluge-torrent.org/ticket/3635
Closes: https://github.com/deluge-torrent/deluge/pull/450
-rw-r--r-- | deluge/i18n/util.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/deluge/i18n/util.py b/deluge/i18n/util.py index f6920fbb3..f553dc8fb 100644 --- a/deluge/i18n/util.py +++ b/deluge/i18n/util.py @@ -66,6 +66,9 @@ def set_language(lang): :type lang: str """ if not lang: + for lang_env_var in ['LANGUAGE', 'LANG']: + if lang_env_var in os.environ: + del os.environ[lang_env_var] return # Necessary to set these environment variables for GtkBuilder |