예제 #1
0
 def on_run_button(self, event):
     """Handle the event when the user clicks the run button."""
     self.print(wx.GetTranslation(_(u"Run button pressed.")))
     self.continue_command()
     if self.toggle_run is False:
         self.toggle_run = True
         self.continue_button.Enable(True)
     self.run_command()
예제 #2
0
        def GetSingularString(self, msgid, project=None):
            if msgid is None or len(msgid.strip()) == 0:
                return u""

            msg = missing = object()

            if project is None or len(project.strip()) == 0:
                project = self.i18nMan._DEFAULT_PROJECT

            msg = self.i18nMan.getText(project, self.i18nMan._DEFAULT_CATALOG,
                                       msgid, missing)

            if msg is missing:
                msg = wx.GetTranslation(msgid)

                if self.i18nMan._testing:
                    return self.i18nMan._wrapText(msg)

                if self.i18nMan._expand:
                    return self.i18nMan._expandText(msg)

            return msg
예제 #3
0
    def wxTranslate(self, msgid):
        """
        Returns the current locale set translation for the
        WxWidgets "wxstd" domain.

        @param msgid: The unicode or ASCII default key to
                    translation
        @type msgid: ASCII c{str} or c{unicode}

        @rtype: c{unicode}
        @return: The translated unicode string for key msgid
                  or msgid if no translation found
        """
        assert self._init

        if wxIsAvailable():
            res = wx.GetTranslation(msgid)
        else:
            res = msgid

        if self._testing:
            return self._wrapText(res)

        return res
예제 #4
0
 def test_translation1(self):
     ldr = wx.FileTranslationsLoader()
     wx.GetTranslation('hello')
예제 #5
0
 def unicode_translation(message):
     return wx.GetTranslation(message).encode("utf-8")
예제 #6
0
 def unicode_translation(message):
     return wx.GetTranslation(message).encode(default_locale)
예제 #7
0
 def _(T):
     return wx.GetTranslation(T)