summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Vagelpohl <jens@plyp.com>2022-11-06 13:18:42 +0100
committerJens Vagelpohl <jens@plyp.com>2022-11-06 13:18:42 +0100
commit658203afa210bd33a38f9a3dc4415e3b84fd16ad (patch)
tree5ada2d4202c862478e3bb29cff4901b1393521cd
parent467ed7abf7e75604a47748710b86d3ac8eecac46 (diff)
downloadzope-i18nmessageid-658203afa210bd33a38f9a3dc4415e3b84fd16ad.tar.gz
- port more fixes from PR #27
-rw-r--r--docs/narr.rst11
1 files changed, 6 insertions, 5 deletions
diff --git a/docs/narr.rst b/docs/narr.rst
index 5982880..52aa1cc 100644
--- a/docs/narr.rst
+++ b/docs/narr.rst
@@ -70,13 +70,14 @@ with a string that needs to be translatable:
>>> _ = MessageFactory("futurama")
>>> robot = _(u"robot-message", u"${name} is a robot.")
-Messages at first seem like they are unicode strings:
+Messages at first seem like they are text strings:
.. doctest::
+ >>> import six
>>> robot == u'robot-message'
True
- >>> isinstance(robot, unicode)
+ >>> isinstance(robot, six.text_type)
True
The additional domain, default and mapping information is available
@@ -98,17 +99,17 @@ object. They cannot be changed once the message id is created:
>>> robot.domain = "planetexpress"
Traceback (most recent call last):
...
- TypeError: readonly attribute
+ AttributeError: readonly attribute
>>> robot.default = u"${name} is not a robot."
Traceback (most recent call last):
...
- TypeError: readonly attribute
+ AttributeError: readonly attribute
>>> robot.mapping = {u'name': u'Bender'}
Traceback (most recent call last):
...
- TypeError: readonly attribute
+ AttributeError: readonly attribute
If you need to change their information, you'll have to make a new
message id object: