Danek Duvall-san wrote (10/29/08 01:01 AM):
> On Wed, Oct 29, 2008 at 12:53:53AM +0900, Takao Fujiwara - Tokyo S/W Center
> wrote:
>
>> I'd like to clarify this.
>> gettext.install can be removed but the definition _ is needed in misc.py.
>
> That's what gettext.install() does -- from the front-end programs. It
> installs it globally, so that it's available from all modules. If you've
> found that's not working properly, okay, but then there's something wrong.
I explained we use bindtextdomain, textdomain and _ in the previous mail.
Let's use the following patch.
--- pkg/src/modules/misc.py.orig
+++ pkg/src/modules/misc.py
@@ -38,6 +38,7 @@
import time
import calendar
import shutil
+import gettext
from stat import *
import pkg.urlhelpers as urlhelpers
@@ -45,6 +46,8 @@
from pkg.client.imagetypes import img_type_names, IMG_NONE
from pkg import VERSION
+_ = gettext.gettext
+
def time_to_timestamp(t):
"""convert seconds since epoch to %Y%m%dT%H%M%SZ format"""
# XXX optimize?
@@ -378,13 +381,13 @@ def bytes_to_str(bytes):
in the largest unit possible."""
units = [
- ("B", 2**10),
- ("kB", 2**20),
- ("MB", 2**30),
- ("GB", 2**40),
- ("TB", 2**50),
- ("PB", 2**60),
- ("EB", 2**70)
+ (_("B"), 2**10),
+ (_("kB"), 2**20),
+ (_("MB"), 2**30),
+ (_("GB"), 2**40),
+ (_("TB"), 2**50),
+ (_("PB"), 2**60),
+ (_("EB"), 2**70)
]
for uom, limit in units:
fujiwara
>
> Danek
>
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss