Getting localized action message and descriptions

Gökçen Eraslan gokcen at pardus.org.tr
Tue Jan 25 01:39:44 PST 2011


Pazartesi 24 Ocak 2011 günü (saat 16:18:40) David Zeuthen şunları yazmıştı:
> We should probably change the GObject API to pass getenv("LANG") if
> non-NULL or something.

I've written a patch to get locale using getenv("LANG"), but pkaction command 
gave segfault with that. Some applications that does not set any locale, and 
use C locale by default may be desinged to print only ASCII strings, so I 
think getting locale using environment is not a good idea.

I've written a second patch (attached) to use setlocale to get locale, and it 
works fine. pkaction does not crash and it prints message and descriptions in 
English always, but my Qt application prints message and description in 
Turkish, as it supposed to do.

Ideas?

-- 
Gökçen Eraslan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: use-system-locale-in-gobject-api.diff
Type: text/x-patch
Size: 1003 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/polkit-devel/attachments/20110125/27484de1/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/polkit-devel/attachments/20110125/27484de1/attachment.pgp>


More information about the polkit-devel mailing list