nubae | alkisg u around? | 08:13 |
---|---|---|
alkisg | Heya nubae, what's up? | 08:13 |
* alkisg is trying google apps for my domain...:) | 08:13 | |
nubae | in my python code i'm running into ¡a reocurring peoblwm when using gettext (the internationalisation module) | 08:14 |
nubae | i keeo getting back global variabke "_" not defned | 08:15 |
alkisg | Urm, I haven't done any internationalized apps in python, but feel free to describe the problem... | 08:15 |
* alkisg also thinks nubae needs to change his keyboard layout :) | 08:16 | |
alkisg | stgraber has put this to italc-launcher: | 08:16 |
alkisg | # gettext | 08:16 |
alkisg | gettext.textdomain('italc') | 08:16 |
alkisg | _ = gettext.gettext | 08:16 |
nubae | yeah this keyboard sukcs quite badly | 08:16 |
alkisg | Doesn't that mean that "_" needs to be assigned to gettext.gettext? | 08:17 |
nubae | the problem I get is everything launches fine, but after -iget udeclared _ which is the translation delimiter | 08:18 |
nubae | gonna see if itsnot just a suse thing | 08:18 |
alkisg | nubae: see here: http://docs.python.org/library/gettext.html | 08:20 |
alkisg | It says that you have to ***define*** "_" yourself, like stgraber did | 08:20 |
alkisg | Here’s an example of typical usage for this API: | 08:20 |
alkisg | import gettext | 08:20 |
alkisg | gettext.bindtextdomain('myapplication', '/path/to/my/language/directory') | 08:20 |
alkisg | gettext.textdomain('myapplication') | 08:20 |
alkisg | _ = gettext.gettext | 08:20 |
alkisg | # ... | 08:20 |
alkisg | print _('This is a translatable string.') | 08:20 |
alkisg | So if you didn't do: _=gettext.gettext, you need to do it. | 08:21 |
nubae | yep mine is done exactly like that | 08:21 |
nubae | i fear there is a missing tool somewjere | 08:22 |
alkisg | That only applies to the current module, so if you have a lot of modules, you need to do it for each one of them | 08:24 |
nubae | yeah I know... that part is done right | 08:24 |
nubae | whats not done right is this globall declaration thing... I wasnt getting htat always b4 | 08:25 |
alkisg | Want to send me the code to see if it runs OK in my ubuntu? | 08:25 |
nubae | oh sre | 08:26 |
nubae | im making a vifgial macine anwyway though | 08:27 |
nubae | virtual even | 08:27 |
phant0m_ | umm any idea how to get to efnet from here pls?? | 13:09 |
=== ogra__ is now known as ogra | ||
sbalneav | Morning all | 14:59 |
researcher | its night in India dear | 15:06 |
researcher | but gud morning to everybody there | 15:07 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!