[MERGE][#187283] Import gettext '_' in module name space protecting it from __builtin__ namespace pollution

Vincent Ladeuil v.ladeuil at free.fr
Mon Feb 4 08:22:50 GMT 2008


>>>>> "john" == John Arbash Meinel <john at arbash-meinel.com> writes:

<snip/>

    >> I still consider it a work around as any gtk developer can still
    >> use '_' as an anonymous variable and fall in the same trap.
    >> 
    >> But from previous discussions I thought this may be an acceptable
    >> solution.
    >> 
    >> Vincent
    >> 
    >> 

    john> I personally think it would be better to do something like:

    john> import gettext
    john> gettext.install('olive-gtk')

    john> _i18n = gettext.gettext

Yes, I was in favor of such a solution but my understanding was
that the team rejected it because using '_' was preferred
(shorter, more standard, whatever).

    john> ...

    john> from bzrlib.plugins.gtk import _i18n

    john> and then use "_i18n(foo)" instead of "_(foo)"

    john> You could even install "_i18n" or even "i18n" in __builtins__
    john> since it is much less likely to get overridden accidentally.

Sure.

    john> It is a bit more invasive of a change, but I think
    john> overall more beneficial.

I have no strong opinion here, especially since I don't
participate that much (anymore ?).

My point was to make the test suite pass, which is close with
that patch.

     Vincent



More information about the bzr-gtk mailing list