Skip to content

Commit

Permalink
[3635][WebUI] fix language change to system default
Browse files Browse the repository at this point in the history
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
  • Loading branch information
DjLegolas committed May 1, 2024
1 parent 7f3f7f6 commit 2953b1c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions deluge/i18n/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2953b1c

Please sign in to comment.