From: Rafael G. P. <raf...@gm...> - 2012-02-05 09:55:47
|
Daniele Forsi <dforsi <at> gmail.com> writes: > > 2012/2/4 Rafael Godinez Perez: > > > The new variable 'language' can contain any value shown by the output of > > $ espeak --voices > > > > Default is "en" or "en-US", but I've chosen my own language "es-ES" or simply > > "es" . > > instead of hardcoding the value you could use the LANG environment > variable if available > > something like this: > try: > language = os.environ["LANG"].split("_")[0] > except: > language = "en" > Hi Daniele, that of yours is a much more elegant solution. Thanks for sharing, I didn't know how to use an environment variable in the python script. I'm wondering how difficult could it be implement this feature as a gtkpod plugin... I'll give it a try, reading other plugins structure and trying to adapt this script into it. Rafa. |