Exemplo n.º 1
0
 def translate(self,
               msgid,
               mapping=None,
               context=None,
               target_language=None):
     return z3translate(msgid, self._domain, mapping, context,
                        target_language)
 def translate(self, domain, msgid, mapping=None, context=None,
               target_language=None, default=None):
     """
     Translate a message using Unicode.
     """
     return z3translate(msgid, domain, mapping, context,
                        target_language, default)
    def translate(self, domain, msgid, mapping=None, context=None, target_language=None, default=None):
        # Translate a message using Unicode.
        if not msgid:
            # refuse to translate an empty msgid
            return default

        # ZPT passes the object as context.  That's wrong according to spec.
        if not IBrowserRequest.providedBy(context):
            context = aq_acquire(context, "REQUEST")
        text = msgid

        return z3translate(msgid, domain, mapping, context, target_language, default)
    def translate(self,
                  domain,
                  msgid,
                  mapping=None,
                  context=None,
                  target_language=None,
                  default=None):
        # Translate a message using Unicode.
        if not msgid:
            # refuse to translate an empty msgid
            return default

        # ZPT passes the object as context.  That's wrong according to spec.
        if not IBrowserRequest.providedBy(context):
            context = aq_acquire(context, 'REQUEST')
        text = msgid

        return z3translate(msgid, domain, mapping, context, target_language,
                           default)
Exemplo n.º 5
0
 def translate(self, msgid, mapping=None, context=None,
               target_language=None):
     return z3translate(msgid, self._domain, mapping, context,
                        target_language)