Hi Danek,

The new code doesn't rely on application's gettext.install() call.
The client/__init__.py does the per-module definition of "_"
and client/history.py imports that.

It uses common way for modules:
http://docs.python.org/release/2.6.8/library/gettext.html#localizing-your-module
which doesn't care application's message domain (or whether application
does gettext.install() or not).

Thanks,
Takeshi

On 2012年06月30日 02:48, Danek Duvall wrote:
Abhinandan Ekande wrote:

Hi Shawn, Danek, Takeshi :

I have tried the suggestion by both Shawn and Takeshi. Both works fine. I
have
made the changes as suggested by Takeshi. Here is latest updated webrev :
https://cr.opensolaris.org/action/browse/pkg/ae112802/7166082-rev3/webrev/

Below two files have updated in this webrev. Rest of the files are not
changed.

    src/modules/client/history.py
    src/modules/client/__init__.py

Ran the "pkg history" command with C locale, unicode locale and eucJP
locale. Verified the output. Ran the complete test suite and all test
cases passed.

I think while this is a direction we might want to consider in the future,
I don't want to do it now, because I think it needs to be done more
globally.

I just closed a bug which complained that if you tried to use the progress
tracker class you got a NameError because it used _(), and
gettext.install() hadn't been run.  Moreover, it seems clear to me that if
the modules rely on the program to call gettext.install(), they won't get
the right translations if the program wasn't one of ours, and we really do
need to have a per-module definition of _().

But I think all that will take a little more work and thought, testing, and
performance checking.

I'd rather see Shawn's or my proposal implemented instead.

Thanks,
Danek
_______________________________________________
pkg-discuss mailing list
pkg-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

_______________________________________________
pkg-discuss mailing list
pkg-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to