On a game server, programmed in python, I want to be able to select language specific expression, according to the user's preference. Provided a 'name tag' and a 'language identifier' I want a function to return the appropriate text for the specified tag in the given language, for example
> print(foo("turn left","de")) Bitte nach links abbiegen > print(foo("turn left","en")) Turn left please
I hope you get the point.
Is there something available for python which can provide a solution? I am not looking for
gettext or something which uses the computer's locale setting for the language! I am looking for a solution which might work similar, but works as given in the example.
Or is it better to code something like this by oneself? How then to store the language phrases in a best way? Just in a big text file? A data base? ...?