[docs] [issue17067] Examples in documentation for 3.x in 23.1.3.4. Deferred translations are rather weak
Carsten Klein
report at bugs.python.org
Mon Jan 28 22:15:46 CET 2013
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 at python
components: Documentation
messages: 180882
nosy: carsten.klein at axn-software.de, docs at 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 <report at bugs.python.org>
<http://bugs.python.org/issue17067>
_______________________________________
More information about the docs
mailing list