I have made a program/app using PyQt5. I made the gui in QtDesigner and using the info here (How to change languages(translations) dynamically on PyQt5?), I was able to set it up to switch the language from English to Japanese. Thank you stackoverflow for that.
my current issue is related. I would like to be able to get the untranslated text for a widget label regardless of the language it is displayed it.
For example, I have a QTreeWidget. I made a function that finds all the parts of the tree that are checked. something like this: filters.get(tree.topLevelItem(1).text(0), 'selected])
the output is a list of strings of the selected items in the top level item. for example: [categoryA, categoryB, categoryF]
then I use these selected values as keys to filter a dictionary with those entries. so if I have a dict of categoryA thru Z, this with select only the three entries selected by the tree.
But, this doesn't work if the language of the text displayed in the tree isn't what is used for the dictionary entries. and i don't want to make separate dictionaries for every language.
So, how can I grab the untranslated version of a QLabel's text? or, how can I use the ts file dicitonary to translate on the fly within the code?