[Sugar-devel] [FEATURE] Enhanced Gettext

Benjamin M. Schwartz bmschwar at fas.harvard.edu
Tue Jan 5 13:30:27 EST 2010


Sayamindu Dasgupta wrote:
> On Tue, Jan 5, 2010 at 11:03 PM, Benjamin M. Schwartz
> <bmschwar at fas.harvard.edu> wrote:
>> Benjamin M. Schwartz wrote:
>>> Sayamindu Dasgupta wrote:
>>>> This feature
>>>> would add a sugar.gettext module, which, if used by activities, will
>>>> search an alternative path (configurable via GConf) for translations
>>>> before looking into the activity directory (where the translations
>>>> present in the original release bundle exist.
>>> Can't we do this with unmodified gettext by setting the LOCALEDIR envvar?
>> s/LOCALEDIR/TEXTDOMAINDIR/
> 
> Ideally it would, but I don't think all programs/libraries honour
> this.

Sure.  The question is whether python's gettext module respects this.  If
it does, we don't have to make a python sugar.gettext module, and we don't
have to modify the activities.

If python's gettext isn't susceptible to environment variables, we can do
it using a one-line call to gettext.bindtextdomain.  We might even be able
to hide that call inside "import sugar.activity" to avoid modifying the
existing activities.

--Ben

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
Url : http://lists.sugarlabs.org/archive/sugar-devel/attachments/20100105/8dfbec42/attachment.pgp 


More information about the Sugar-devel mailing list