Fujiwara - can you explain why the gettext additions are needed in misc.py?

Thanks,

JR

Danek Duvall wrote:
> On Tue, Oct 28, 2008 at 02:29:10PM +0000, jmr wrote:
>
>   
>> Danek - I'd like to get this wrapped up for 2008.11. Looking through your 
>> comments it looks as if there are no further changes required, but perhaps 
>> some clean up and rationalization post 2008.11 to reduce the inconsistency.
>>
>> I'd like to get this landed, any objections?
>> http://cr.opensolaris.org/~jmr/um_4126_v2_Oct24/
>>     
>
> Unless you understand why the gettext additions are needed for misc.py,
> please drop those.  Everything else is fine for now.
>
> Thanks,
> Danek
>   

misc.py:
> 
>   - line 381: You shouldn't need this -- gettext.install() need only be
>     called once for the process, so once it's in client.py and
>     packagemanager.py, you're done.  In general, your code does a bunch of
>     different things to try to get at the localized text.  In each
>     program's main() or equivalent, you should call gettext.install() with
>     the appropriate arguments, and use _() everywhere else.  But some
>     places you use bindtextdomain() and textdomain() either in addition to
>     or in place of gettext.install(), and you add a "_" member to objects
>     pointing to gettext.gettext() rather than just using the builtin _()
>     function, and in some places you create a N_() method ... it's all over
>     the place.


However the function doesn't have self argument? in bytes_to_str(bytes)
What is your suggestion to get self.parent._() something?

Yes, N_() and _() are needed to get translatable strings with intltool. 
Translatable strings are included in several types, .c, .desktop, .glade, .py, 
.schemas and etc and the simple rule can manage strings easily.
gettext.gettext should be called after gettext is initialized so N_() are used 
for some global values before main() is called.





_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to