Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
test.test_gettext.DummyGNUTranslations Class Reference
Inheritance diagram for test.test_gettext.DummyGNUTranslations:
Inheritance graph
[legend]
Collaboration diagram for test.test_gettext.DummyGNUTranslations:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def foo
def lgettext
def lngettext
def gettext
def ngettext
def add_fallback
def info
def charset
def output_charset
def set_output_charset
def install

Public Attributes

 plural

Static Public Attributes

int LE_MAGIC = 0x950412de
int BE_MAGIC = 0xde120495

Detailed Description

Definition at line 328 of file test_gettext.py.


Member Function Documentation

def gettext.NullTranslations.add_fallback (   self,
  fallback 
) [inherited]

Definition at line 165 of file gettext.py.

00165 
00166     def add_fallback(self, fallback):
00167         if self._fallback:
00168             self._fallback.add_fallback(fallback)
00169         else:
00170             self._fallback = fallback

def gettext.NullTranslations.charset (   self) [inherited]

Definition at line 200 of file gettext.py.

00200 
00201     def charset(self):
00202         return self._charset

Definition at line 329 of file test_gettext.py.

00329 
00330     def foo(self):
00331         return 'foo'
00332 

Here is the caller graph for this function:

def gettext.GNUTranslations.gettext (   self,
  message 
) [inherited]

Reimplemented from gettext.NullTranslations.

Definition at line 330 of file gettext.py.

00330 
00331     def gettext(self, message):
00332         missing = object()
00333         tmsg = self._catalog.get(message, missing)
00334         if tmsg is missing:
00335             if self._fallback:
00336                 return self._fallback.gettext(message)
00337             return message
00338         return tmsg

def gettext.NullTranslations.info (   self) [inherited]

Definition at line 197 of file gettext.py.

00197 
00198     def info(self):
00199         return self._info

Here is the caller graph for this function:

def gettext.NullTranslations.install (   self,
  names = None 
) [inherited]

Definition at line 209 of file gettext.py.

00209 
00210     def install(self, names=None):
00211         import builtins
00212         builtins.__dict__['_'] = self.gettext
00213         if hasattr(names, "__contains__"):
00214             if "gettext" in names:
00215                 builtins.__dict__['gettext'] = builtins.__dict__['_']
00216             if "ngettext" in names:
00217                 builtins.__dict__['ngettext'] = self.ngettext
00218             if "lgettext" in names:
00219                 builtins.__dict__['lgettext'] = self.lgettext
00220             if "lngettext" in names:
00221                 builtins.__dict__['lngettext'] = self.lngettext
00222 

Here is the call graph for this function:

def gettext.GNUTranslations.lgettext (   self,
  message 
) [inherited]

Reimplemented from gettext.NullTranslations.

Definition at line 305 of file gettext.py.

00305 
00306     def lgettext(self, message):
00307         missing = object()
00308         tmsg = self._catalog.get(message, missing)
00309         if tmsg is missing:
00310             if self._fallback:
00311                 return self._fallback.lgettext(message)
00312             return message
00313         if self._output_charset:
00314             return tmsg.encode(self._output_charset)
00315         return tmsg.encode(locale.getpreferredencoding())

Here is the call graph for this function:

def gettext.GNUTranslations.lngettext (   self,
  msgid1,
  msgid2,
  n 
) [inherited]

Reimplemented from gettext.NullTranslations.

Definition at line 316 of file gettext.py.

00316 
00317     def lngettext(self, msgid1, msgid2, n):
00318         try:
00319             tmsg = self._catalog[(msgid1, self.plural(n))]
00320             if self._output_charset:
00321                 return tmsg.encode(self._output_charset)
00322             return tmsg.encode(locale.getpreferredencoding())
00323         except KeyError:
00324             if self._fallback:
00325                 return self._fallback.lngettext(msgid1, msgid2, n)
00326             if n == 1:
00327                 return msgid1
00328             else:
00329                 return msgid2

Here is the call graph for this function:

def gettext.GNUTranslations.ngettext (   self,
  msgid1,
  msgid2,
  n 
) [inherited]

Reimplemented from gettext.NullTranslations.

Definition at line 339 of file gettext.py.

00339 
00340     def ngettext(self, msgid1, msgid2, n):
00341         try:
00342             tmsg = self._catalog[(msgid1, self.plural(n))]
00343         except KeyError:
00344             if self._fallback:
00345                 return self._fallback.ngettext(msgid1, msgid2, n)
00346             if n == 1:
00347                 tmsg = msgid1
00348             else:
00349                 tmsg = msgid2
00350         return tmsg
00351 
00352 
# Locate a .mo file using the gettext strategy
def gettext.NullTranslations.output_charset (   self) [inherited]

Definition at line 203 of file gettext.py.

00203 
00204     def output_charset(self):
00205         return self._output_charset

def gettext.NullTranslations.set_output_charset (   self,
  charset 
) [inherited]

Definition at line 206 of file gettext.py.

00206 
00207     def set_output_charset(self, charset):
00208         self._output_charset = charset


Member Data Documentation

int gettext.GNUTranslations.BE_MAGIC = 0xde120495 [static, inherited]

Definition at line 226 of file gettext.py.

int gettext.GNUTranslations.LE_MAGIC = 0x950412de [static, inherited]

Definition at line 225 of file gettext.py.

Definition at line 235 of file gettext.py.


The documentation for this class was generated from the following file: