Back to index

plone3  3.1.7
Classes | Functions | Variables
PlacelessTranslationService.GettextMessageCatalog Namespace Reference

Classes

class  BrokenMessageCatalog
class  GettextMessageCatalog
class  MoFileCache

Functions

def ptFile
def getMessage

Variables

string permission = 'View management screens'
tuple translationRegistry = Registry()
 registerTranslation = translationRegistry.register
tuple rtlRegistry = Registry()
 registerRTL = rtlRegistry.register
tuple _moCache = MoFileCache(os.path.join(CLIENT_HOME, 'pts'))
 cachedPoFile = _moCache.cachedPoFile
 purgeMoFileCache = _moCache.purgeCache

Detailed Description

A simple implementation of a Message Catalog.

$Id: GettextMessageCatalog.py 61752 2008-03-31 16:07:04Z hannosch $

Function Documentation

def PlacelessTranslationService.GettextMessageCatalog.getMessage (   catalog,
  id,
  orig_text = None 
)
get message from catalog

returns the message according to the id 'id' from the catalog 'catalog' or
raises a KeyError if no translation was found. The return type is always
unicode

Definition at line 45 of file GettextMessageCatalog.py.

00045 
00046 def getMessage(catalog, id, orig_text=None):
00047     """get message from catalog
00048 
00049     returns the message according to the id 'id' from the catalog 'catalog' or
00050     raises a KeyError if no translation was found. The return type is always
00051     unicode
00052     """
00053     msg = catalog.gettext(id)
00054     if msg is id:
00055         raise KeyError
00056     if type(msg) is types.StringType:
00057         msg = unicode(msg, catalog._charset)
00058     return msg
00059 

Here is the caller graph for this function:

Definition at line 29 of file GettextMessageCatalog.py.

00029 
00030 def ptFile(id, *filename):
00031     if type(filename[0]) is types.DictType:
00032         filename = list(filename)
00033         filename[0] = package_home(filename[0])
00034     filename = os.path.join(*filename)
00035     if not os.path.splitext(filename)[1]:
00036         filename = filename + '.pt'
00037     return PageTemplateFile(filename, '', __name__=id)


Variable Documentation

Definition at line 564 of file GettextMessageCatalog.py.

Definition at line 565 of file GettextMessageCatalog.py.

Definition at line 38 of file GettextMessageCatalog.py.

Definition at line 566 of file GettextMessageCatalog.py.

Definition at line 43 of file GettextMessageCatalog.py.

Definition at line 41 of file GettextMessageCatalog.py.

Definition at line 42 of file GettextMessageCatalog.py.

Definition at line 40 of file GettextMessageCatalog.py.