Irit Katriel added the comment:
There were several votes in the discussion for rejecting this deprecation, so I
am closing the issue.
--
nosy: +iritkatriel
resolution: -> rejected
stage: -> resolved
status: open -> closed
___
Python tracker
A.M. Kuchling added the comment:
I suggest we just close this ticket. I tried producing a documentation patch
(attached), but they seem like a marginal improvement.
(I don't think the text in the docs such as 'gettext' (bound to
self.gettext()) is confusing; given the context, I think the
Barry A. Warsaw added the comment:
On Mar 13, 2014, at 05:15 AM, Éric Araujo wrote:
The source contains :meth:`self.gettext`, and Sphinx adds the parentheses
when creating markup for a function, probably because it’s common to say
things like “the len() function”. There is a Sphinx config
Éric Araujo added the comment:
The doc for NullTranslations.install needs the erroneous '()'s removed to
make clear
that the bindings are to bound methods and not the result of calls to bound
methods.
Ie, self.gettest() should be just self.gettext.
The source contains
Changes by Jakub Wilk jw...@jwilk.net:
--
nosy: +jwilk
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18217
___
___
Python-bugs-list mailing list
Éric Araujo added the comment:
Working with an explicit translator object sounds much better to me too. I
haven’t used it yet, but Babel has been on my radar for long, and does that
(like flufl.i18n from what I can tell).
--
nosy: +eric.araujo
___
Barry A. Warsaw added the comment:
On Jun 21, 2013, at 04:18 PM, Éric Araujo wrote:
Working with an explicit translator object sounds much better to me too. I
haven’t used it yet, but Babel has been on my radar for long, and does that
(like flufl.i18n from what I can tell).
flufl.enum didn't
Terry J. Reedy added the comment:
The rationale for install is For convenience, you want the _() function to be
installed in Python’s builtins namespace, so it is easily accessible in all
modules of your application. As David noted, this also make it easy to update
_ in just one place when a
New submission from Alex Gaynor:
There's a myriad of reasons it's a bad idea:
* Makes code harder to read
* Doesn't play nicely with multiple projects using gettext
* Defeats any attempt at static analysis
* etc...
--
messages: 191152
nosy: alex
priority: normal
severity: normal
Changes by Barry A. Warsaw ba...@python.org:
--
nosy: +barry
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18217
___
___
Python-bugs-list mailing
R. David Murray added the comment:
How would you do dynamic switching of translation locale at runtime, then?
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18217
___
Alex Gaynor added the comment:
I'm not sure I understand the question. What `install()` does is set
`__builtins__._` to be gettext. I think people should import the gettext
function they need.
--
___
Python tracker rep...@bugs.python.org
Barry A. Warsaw added the comment:
On Jun 14, 2013, at 09:27 PM, R. David Murray wrote:
How would you do dynamic switching of translation locale at runtime, then?
flufl.i18n :)
http://pythonhosted.org/flufl.i18n/
--
___
Python tracker
R. David Murray added the comment:
install says this:
This installs the function _() in Python’s builtins namespace, based on
domain, localedir, and codeset which are passed to the function translation()
Unless I'm misunderstanding something, this means that the actual value of _ is
Alex Gaynor added the comment:
I think the code makes what this does much clearer:
http://hg.python.org/cpython/file/01da7bf11ca1/Lib/gettext.py#l209
There's no reason you can't make your own translation object, and expose it's
gettext method as as your API, and then you can update the
R. David Murray added the comment:
Which is what Barry's library does.
But rather than just deprecating install, I think we should fix the module so
that it supports this directly. That could be as simple as adding a dynamic
translations class.
What does library code that wants to provide
16 matches
Mail list logo