/srv/irclogs.ubuntu.com/2009/12/01/#edubuntu.txt

nubaealkisg u around?08:13
alkisgHeya nubae, what's up?08:13
* alkisg is trying google apps for my domain...:)08:13
nubaein my python code i'm running into  ¡a reocurring peoblwm when using gettext (the internationalisation module)08:14
nubaei keeo getting back global variabke "_" not defned08:15
alkisgUrm, 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
alkisgstgraber has put this to italc-launcher:08:16
alkisg# gettext08:16
alkisggettext.textdomain('italc')08:16
alkisg_ = gettext.gettext08:16
nubaeyeah this keyboard sukcs quite badly08:16
alkisgDoesn't that mean that "_" needs to be assigned to gettext.gettext?08:17
nubaethe problem I get is everything launches fine, but after -iget udeclared _ which is the translation delimiter08:18
nubaegonna see if itsnot just a suse thing08:18
alkisgnubae: see here: http://docs.python.org/library/gettext.html08:20
alkisgIt says that you have to ***define***  "_" yourself, like stgraber did08:20
alkisgHere’s an example of typical usage for this API:08:20
alkisgimport gettext08:20
alkisggettext.bindtextdomain('myapplication', '/path/to/my/language/directory')08:20
alkisggettext.textdomain('myapplication')08:20
alkisg_ = gettext.gettext08:20
alkisg# ...08:20
alkisgprint _('This is a translatable string.')08:20
alkisgSo if you didn't do: _=gettext.gettext, you need to do it.08:21
nubaeyep mine is done exactly like that08:21
nubaei fear there is a missing tool somewjere08:22
alkisgThat only applies to the current module, so if you have a lot of modules, you need to do it for each one of them08:24
nubaeyeah I know... that part is done right08:24
nubaewhats not done  right is this globall declaration thing... I wasnt getting htat always b408:25
alkisgWant to send me the code to see if it runs OK in my ubuntu?08:25
nubaeoh sre08:26
nubaeim making a vifgial macine anwyway though08:27
nubaevirtual even08:27
phant0m_umm any idea how to get to efnet from here pls??13:09
=== ogra__ is now known as ogra
sbalneavMorning all14:59
researcherits night in India dear15:06
researcherbut gud morning to everybody there15:07

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!