From f5fdc7fe5e5fad2d1fbd27d7beb1a206e0da109f Mon Sep 17 00:00:00 2001 From: NandeMD Date: Sat, 14 Dec 2024 13:18:25 +0300 Subject: [PATCH 1/3] changed from tkinterdnd2-universal -> tkinterdnd2 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 147a587..ecc05f7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,6 @@ darkdetect[macos-listener] == 0.8.*; sys_platform == 'darwin' notify-py == 0.3.*; sys_platform != 'darwin' pillow >= 10.0.1, < 11.0.0 # https://github.com/TransparentLC/realesrgan-gui/issues/18#issuecomment-1477203041 -tkinterdnd2-universal >= 1.7.3, < 2.0.0 +tkinterdnd2 >= 0.4.2 # For locale names babel >= 2.14.0, < 3.0.0 \ No newline at end of file From 3346cd9cc93d3ec4cb6ec29b9e7d6e915eab2e38 Mon Sep 17 00:00:00 2001 From: NandeMD Date: Sat, 14 Dec 2024 13:27:13 +0300 Subject: [PATCH 2/3] changed getdefaultlocale() -> getlocale(), initial one is deprecated --- i18n.py | 3 ++- main.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/i18n.py b/i18n.py index f15b267..96e9215 100644 --- a/i18n.py +++ b/i18n.py @@ -35,9 +35,10 @@ current_language = None +# 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15 def set_current_language(lang_in_conf: str): global current_language - locale_lang = locale.getdefaultlocale()[0] + locale_lang = locale.getlocale()[0] if lang_in_conf in all_locales: current_language = lang_in_conf diff --git a/main.py b/main.py index 85c4228..e65e62c 100644 --- a/main.py +++ b/main.py @@ -718,7 +718,7 @@ def init_config_and_model_paths() -> tuple[configparser.ConfigParser, list[str]] 'IgnoreError': False, 'Preupscale': False, 'CustomCommand': '', - 'AppLanguage': locale.getdefaultlocale()[0], + 'AppLanguage': locale.getlocale()[0], }) config['Config'] = {} config.read(define.APP_CONFIG_PATH) From 060df3258af76dbc149e9d7e0f1e15d6ef02633e Mon Sep 17 00:00:00 2001 From: NandeMD Date: Sat, 14 Dec 2024 13:14:46 +0300 Subject: [PATCH 3/3] Revert "changed getdefaultlocale() -> getlocale(), initial one is deprecated" This reverts commit 3346cd9cc93d3ec4cb6ec29b9e7d6e915eab2e38. --- i18n.py | 3 +-- main.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/i18n.py b/i18n.py index 96e9215..f15b267 100644 --- a/i18n.py +++ b/i18n.py @@ -35,10 +35,9 @@ current_language = None -# 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15 def set_current_language(lang_in_conf: str): global current_language - locale_lang = locale.getlocale()[0] + locale_lang = locale.getdefaultlocale()[0] if lang_in_conf in all_locales: current_language = lang_in_conf diff --git a/main.py b/main.py index e65e62c..85c4228 100644 --- a/main.py +++ b/main.py @@ -718,7 +718,7 @@ def init_config_and_model_paths() -> tuple[configparser.ConfigParser, list[str]] 'IgnoreError': False, 'Preupscale': False, 'CustomCommand': '', - 'AppLanguage': locale.getlocale()[0], + 'AppLanguage': locale.getdefaultlocale()[0], }) config['Config'] = {} config.read(define.APP_CONFIG_PATH)