I want to have a textfile with all the text in it,which is represented in the program, to make it easy to translate my program into another language. I could use a normal list but then it would be very hard to see which text would be represented when looking into the code.
text file:
here is the text represented in the running program
inside the code you cant say whats written right here
code:
language_file = open("file.txt", "r", encoding="utf-8")
language_list = storage_file.readlines()
print(language_list[1])
I hope you can understand my problem with that ^ Instead of using a list, I want to use a dictionary. And the file then should look something like this:
"some_shortcut_to_remind_me_whats_happening": "Text in another language"
"another_shortcut": "Now I know whats written right here"
the code then could look like this:
print(language_dict["another_shortcut"])
But I dont know how to get a dictionary out of a textfile