pyqt  

Re: [PyQt] Issues with PyKDE4 and i18n API

Chusslove Illich
Sun, 20 Apr 2008 14:15:51 -0700

> [: Chusslove Illich :]
> [...] but one could provide same i18n* calls in pure Python: [...]

It cannot work exactly as I've put it before, as ki18n* calls are also by
suffixes. The (hopefully) corrected version:

  def i18n_helper (ki18nx, base_args, subs_args):
      kstr = ki18nx(*base_args)
      for arg in subs_args:
          kstr = kstr.subs(arg)
      return kstr.toString()

  def i18n (*args):
      return i18n_helper(ki18n, args[:1], args[1:])

  def i18nc (*args):
      return i18n_helper(ki18nc, args[:2], args[2:])

  def i18np (*args):
      return i18n_helper(ki18np, args[:2], args[2:])

  def i18ncp (*args):
      return i18n_helper(ki18ncp, args[:3], args[3:])

-- 
Chusslove Illich (Часлав Илић)

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt