Preston Landers <mithy at my-deja.com> wrote: > Is there an easy way to use translatable strings in your Python program > a la GNU gettext? The os.localize module doesn't seem to do what I need > to do. can anyone point me to some documentation or examples? how about: # Translate.py messages = {} # ... check environment variable to figure out what file # to load, and load it using marshal, fp.readlines, pickle, ... # do it by hand, for now... message["hello, world"] = "tjaba" def T(message): return table.get(messages, messages) and: # main from Translate import T print T("hello, world") </F>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4