Skip to content

Commit

Permalink
onefile not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
furjac committed May 15, 2024
1 parent e7711ad commit 1f30b95
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand All @@ -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"):
Expand Down

0 comments on commit 1f30b95

Please sign in to comment.