Python and gettext

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Spaeleus
    New Member
    • Sep 2008
    • 1

    Python and gettext

    Hi!
    I'm really new to python.
    I've a question that involves the use of gettext in python for internationaliz ation.
    I'm followin the italian translation for enigma2 CVS, the distribuition for some statellite receiver, based on linux for the kernel an python for the application.
    I'm quite new also with this job, but Im trying to do my best...
    I've some trouble with some coding style.
    As far as I can understand, it's impossible to translate a string like:
    Code:
    return _("An unknown error occured!") + " (%s @ task %s)" % (self.__class__.__name__, task.__class__.__name__)
    unless you provide into .po file all the possible combination of the concatenated strings.

    A possible solution could be:
    Code:
    return _("An unknown error occured!: (%s @ task %s)" % (self.__class__.__name__, task.__class__.__name__)
    Am I right? Or there is some way to translate also strings with concatenations without providing into po file all the combination, that is not possible to extract with xgettext?
    Thanks!
Working...