Re: A new component/module for the nice translators worldwide to pick up



On Fri, 2004-06-18 at 17:48 +0200, Danilo Šegan wrote:

> Basically, in Python instead of:
> 
> -			self.wrongdialog = gtk.MessageDialog(self.widget, gtk.DIALOG_MODAL|gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, _("This is an invalid record! The problem could be at the ") + y + _(" field. Reason: ")+ z)
> 
> you'd do something like:
> 
> +			self.wrongdialog = gtk.MessageDialog(self.widget, gtk.DIALOG_MODAL|gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, _("This is an invalid record! The problem could be at the %s field. Reason: %s") % (y, z))
> 


Thanks, that does work (and I fixed it using this technique in CVS). If
you people find other such cases, feel free to or contact me or if you
feel brave, fix it in the python code yourself. It's not very hard (just
follow the example of Danilo).

Just a little sidenote for the translators. I will change this for it
might not be a clean programming practise (I know).

Some of the translatable strings are being checked in the code. Like
this:

if type==_("minute"):
  if num > 59 or num < 0:
	raise Exception('steps', type, _("must be between 59 and 0"))

So there is probably a place that puts another translatable string in
the 'type'-variable. Now if the two are not the same anymore
(untranslated or translated to another word), then it means that the
check will just not happen. Thats not good.

I am going to avoid these cases, because I see a problem with it: in one
context, "minute" will be translated to x and in another one it might
get translated to another word.

But at this moment at some places it's still coded like this. So make
sure that you don't do any context-driven translations yet :). Always
translate for example 'minute' to the same word, until I fixed this
rather hard to debug issue.

But again, I understand that this is bad programming practise. I Just
noticed it in the code and this is making me feel uncomfortable.
Especially now that I know people are starting to translate this
application.


-- 
Philip Van Hoof, Software Developer @ Cronos
home: me at freax dot org
work: Philip dot VanHoof at cronos dot be
http://www.freax.be, http://www.freax.eu.org



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]