From 1f30b95d499800c3c81729faf133a7ce14036ab8 Mon Sep 17 00:00:00 2001 From: Furjack <81816200+furjac@users.noreply.github.com> Date: Wed, 15 May 2024 12:07:00 +0530 Subject: [PATCH] onefile not needed --- src/main.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/src/main.py b/src/main.py index 0c8faa5..c1acea6 100644 --- a/src/main.py +++ b/src/main.py @@ -51,8 +51,7 @@ def __init__(self, language): def load_translations(self): try: - translation_file = resource_path(f"locales/{self.language}/{self.language}.json") - with open(translation_file, "r", encoding="utf-8") as file: + with open(f"locales/{self.language}/{self.language}.json", "r", encoding="utf-8") as file: return json.load(file) except FileNotFoundError: print(f"Translation file not found for language: {self.language}") @@ -64,16 +63,6 @@ def load_translations(self): def translate(self, key): return self.translations.get(key, key) -def resource_path(relative_path): - """ Get absolute path to resource, works for dev and for PyInstaller """ - try: - # PyInstaller creates a temp folder and stores path in _MEIPASS - base_path = sys._MEIPASS - except Exception: - base_path = os.path.abspath(".") - - return os.path.join(base_path, relative_path) - class Movies: def __init__(self, language="en"):