-
How can I get the user's selected locale (language) for Mu from a user program? Same for the mode selected? The reason I am asking is that I would like to configure friendly/friendly-traceback so that it would automatically set both its mode and its default language (only English and French so far) to correspond to the user's preference. |
Beta Was this translation helpful? Give feedback.
Answered by
aroberge
Dec 29, 2021
Replies: 1 comment
-
I found the answer to my own question. import json
import os
import appdirs
DATA_DIR = appdirs.user_data_dir(appname="mu", appauthor="python")
try:
with open(os.path.join(DATA_DIR, "session.json")) as fp:
settings = json.load(fp)
except FileNotFoundError:
settings = {}
if 'theme' in settings:
print(settings['theme'])
if 'locale' in settings:
print(settings['locale']) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
aroberge
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I found the answer to my own question.