[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pgettext() availability in Debian?



2008-03-10 (월), 09:13 +0000, Adam Spragg 쓰시길:
.
> To investigate further, I downloaded the GNU sources for gettext 0.17 
> and had a look at them. According to their header file, pgettext() just 
> calls gettext(), passing its msgctxt argument as gettext()'s msgid. As 
> a test, I tried calling gettext() directly with a context id as a 
> message id on the Debian library. This did not work. And neither can I 
> get a translation for a message that has a context even if it is the 
> only message with a particular msgid. 

I just read the header file. AFAICS, pgettext(msgctxt, msgid) calls
gettext(msgctxt "\004" msgid). The two strings are merged (with "\004"
between them) and the merged string is used as gettext()'s msgid. Are
you sure you used the correct argument for gettext()?

> So, I need to use gettext contexts, but I can't figure out how to do 
> this on my Debian system. If a message has a context, it simply appears 
> to be unavailable. (Messages without contexts load fine, so I know that 
> I'm putting the .mo files in the right place, setting the locale 
> properly and binding to the correct domain, etc...)

I recommend you not to dig into implementation details, but just use the
header file in your project. Or if you can use GLib, just use
<glib/gi18n.h>. Recent GLib supports C_() macro with msgctxt feature.



-- 
Changwoo Ryu <cwryu@debian.org>

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: