Re: [PATCH] Don't reimport gettext



On Thu, Feb 26, 2009 at 10:35 PM, Kai Willadsen <kai willadsen gmail com> wrote:
> 2009/2/26 Vincent Legoll <vincent legoll gmail com>:
>> Pylint reports duplicated imports of gettext,
>> use the previously imported one to set "_"
>
> This looks slightly strange to me. There's only one usage of _() in
> that file, so why not just use the full gettext.gettext() form for
> that case and drop the _() alias from this file altogether?

I must admit that I had not looked that much to the file when
fixing pylint's reports :-)

But indeed you may be right, perhaps that is to keep even that
file consistent with all the gettext usage everywhere else...

Seems the python documentation is telling us to do just that...

http://docs.python.org/library/gettext.html#gettext.gettext
"""
gettext.gettext(message)
[...]
This function is usually aliased as _() in the local namespace
"""

A quick grep through meld's source revealed _ as being used
everywhere...

-- 
Vincent Legoll


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]