New submission from Carsten Klein:
The examples for the topic presented are rather weak. In fact, they merely
present do nothing replacements for an actually working, deferred localization
mechanism or some sort of prototypical implementation thereof.
As such I propose that they be replaced with something more meaningful,
for example such as
class DeferredTranslation(object):
def __init__(self, message, ...):
self.message = message
def __str__(self):
return gettext.translation(...).lgettext(self.message)
def _(message, ...):
return DeferredTranslation(message, ...)
MSG = _('localized message')
Or something else along that way other than the currently presented examples :D
----------
assignee: docs@python
components: Documentation
messages: 180882
nosy: [email protected], docs@python
priority: normal
severity: normal
status: open
title: Examples in documentation for 3.x in 23.1.3.4. Deferred translations are
rather weak
type: enhancement
versions: Python 3.3
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue17067>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com