From 18fa028d2d6b3aa9abff66b1ab9ea7979f31d670 Mon Sep 17 00:00:00 2001 From: DjLegolas Date: Thu, 2 May 2024 01:23:51 +0300 Subject: [PATCH] [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 --- deluge/i18n/util.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/deluge/i18n/util.py b/deluge/i18n/util.py index f6920fbb38..f553dc8fb1 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