I have a large python (2.7) script that reads data from a database and generate pictures in pdf format. My pictures have strings for labels, etc...
Now I want to add a multi language support for the script, so I can generate the same pictures in different languages by passing a variable to my script.
I was thinking in having a class with all the strings and their translations in a dictionary. For example:
Strings['string1'] = {'de':'string in german', 'en': 'string in english'}
I could acces the strings with
my_needed_string = 'string1'
selected_language = 'en'
Strings[my_needed_string][selected_language]
is there a better, more professional way to do this? with "better" I mean more flexible and easier to maintain? I have at least 80 different strings in 2 or more languages.
Thanks