Skip to content

Commit

Permalink
mac fix macOs load conf *
Browse files Browse the repository at this point in the history
  • Loading branch information
Furtif committed May 1, 2024
1 parent 698b2a3 commit d0ef2fe
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions options.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,19 @@ def save_config():


def create_new_config():
# print("configuration not found or not ok. Create one new")
# print("Possible translations:")
# codes = ''
# for i in lang_list:
# print(i + " code: " + lang_list[i])
# codes += lang_list[i] + " "
configuration["lang"] = get_translator_lang()
configuration["dark"] = False
# print("\nEdit it only if it not ok for you country language.")
# print(f'Edit the `ddt4all_data/config.json`\nConfiguration however you want this to be translated.\nThe self-assigned code is: {lang}')
# print(f'Close and edit the configuration for list: \n\t{codes.strip()} \nAnd reopen the application.')
save_config()


def load_configuration():
try:
f = open("ddt4all_data/config.json", "r", encoding="UTF-8")
configuration = json.loads(f.read())
os.environ['LANG'] = configuration["lang"]
config = json.loads(f.read())
# load config as multiplatform (mac fix macOs load conf)
configuration["lang"] = config["lang"]
configuration["dark"] = config["dark"]
os.environ['LANG'] = config["lang"]
f.close()
except:
create_new_config()
Expand Down

0 comments on commit d0ef2fe

Please sign in to comment.