Module i18n
pyMoul i18n
A dumb and do nearly nothing i18n message factory and message
implementation. It's a kind of a place holder.
Inspired by zope.i18nmessage
>>> _ = MessageFactory('test')
>>> msg = _(u'test')
>>> msg
u'test'
>>> msg.domain
'test'
>>> msg.default
u'test'
>>> msg.mapping is None
True
>>> template = _(u'id', u'This is a ${name}!')
>>> template
u'id'
>>> template % {'name' : u'test'}
u'This is a test!'
>>> template % {'name' : u'another test'}
u'This is a another test!'
>>> error = _('id')
Traceback (most recent call last):
...
TypeError: ustr must be a unicode string
>>> error = _(u'id', 'This is a ${name}!')
Traceback (most recent call last):
...
TypeError: default must be a unicode string
__version__
None
-
- Value:
'$Id: i18n.py 122 2007-02-02 17:34:06Z tiran $'
|
|
PymoulMessageFactory
None
-
- Value:
<moul.i18n.MessageFactory object at 0x402aff0c>
|
|
_
None
-
- Value:
<moul.i18n.MessageFactory object at 0x402aff0c>
|
|