Ignore:
Timestamp:
07/07/12 08:41:37 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

Using gettext to translate strings

Location:
src/mlx/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/gui/common.py

    r264 r276  
    7171        """Convert the given text, returned by a Gtk widget, to Unicode."""
    7272        return unicode(text)
     73
     74    def text2str(text):
     75        """Convert the given text, returned by xstr to a string."""
     76        return str(text)
    7377else:
    7478    print "Using PyGObject"
     
    133137        return _utf8Decoder(str)[0]
    134138
     139    def text2str(text):
     140        """Convert the given text, returned by xstr to a string."""
     141        return _utf8Decoder(text)[0]
     142
    135143import cairo
    136144
  • src/mlx/gui/gui.py

    r264 r276  
    3737class GUI(fs.ConnectionListener):
    3838    """The main GUI class."""
    39     _authors = [ ("Váradi", "István", "prog_test"),
    40                  ("Galyassy", "Tamás", "negotiation"),
    41                  ("Petrovszki", "Gábor", "test"),
    42                  ("Zsebényi-Loksa", "Gergely", "test"),
    43                  ("Kurják", "Ákos", "test"),
    44                  ("Nagy", "Dániel", "test"),
    45                  ("Radó", "Iván", "test") ]
     39    _authors = [ (u"Váradi", u"István", "prog_test"),
     40                 (u"Galyassy", u"Tamás", "negotiation"),
     41                 (u"Petrovszki", u"Gábor", "test"),
     42                 (u"Zsebényi-Loksa", u"Gergely", "test"),
     43                 (u"Kurják", u"Ákos", "test"),
     44                 (u"Nagy", u"Dániel", "test"),
     45                 (u"Radó", u"Iván", "test") ]
    4646
    4747    def __init__(self, programDirectory, config):
     
    13281328        If it does not exist yet, it will be created."""
    13291329        if self._aboutDialog is None:
    1330             self._aboutDialog = dialog = gtk.AboutDialog()
     1330            dialog = gtk.AboutDialog()
    13311331            dialog.set_transient_for(self._mainWindow)
    13321332            dialog.set_modal(True)
     
    13451345            authors = []
    13461346            for (familyName, firstName, role) in GUI._authors:
    1347                 authors.append("%s %s (%s)" % \
    1348                                (familyName if isHungarian else firstName,
    1349                                 firstName if isHungarian else familyName,
    1350                                 xstr("about_role_" + role)))           
     1347                author = "%s %s" % \
     1348                         (familyName if isHungarian else firstName,
     1349                          firstName if isHungarian else familyName)
     1350                role = xstr("about_role_" + role)
     1351                authors.append(author + " (" + role + ")")
    13511352            dialog.set_authors(authors)
    13521353
     
    13551356            if not pygobject:
    13561357                gtk.about_dialog_set_url_hook(self._showAboutURL, None)
     1358
     1359            self._aboutDialog = dialog
    13571360
    13581361        return self._aboutDialog
Note: See TracChangeset for help on using the changeset viewer.