So, I want the user to be able to use my program in English. They should be able to switch to their language via a dropdown-menu. My program has only four pages and a few labels on each, translating them with a toolkit would be unnecessary.
This is, what I got this so far:
# Language Settings
def display_selected(choice):
choice = variable.get()
if choice == "Deutsch":
languagelabel.config(text=str('Sprache:'))
Page1(self).label_search.config(text=str('Suche'))
else:
languagelabel.config(text=str('Language:'))
Page1(self).label_search.config(text=str('search'))
# Dropdown Menu for Languages
languages = ['Deutsch', 'English']
variable = StringVar()
variable.set(languages[0])
dropdown = OptionMenu(self, variable, *languages, command=display_selected)
The languagelabel in the same class changes, but the search_label in the class 'Page1' doesn't. Nothing happens, am I missing something?
I'm a bit of a novice, so any guidance and/or other solutions would be appreciated!