Procedure for adding message contexts to PO messages?

Frédéric Delanoy frederic.delanoy at
Tue Jan 11 13:44:56 CST 2011


I'm quite green wrt PO files and was reviewing French PO file after
recent rc -> po migration.
So I read somewhat about PO format and Wine's "PO support code".

I wonder how to add message contexts, and thought it might be this way:
1. Add msgctxt "myContext" next to the associated msgid "myMsgid"
string in en.po
2. Replace myMsgid by #msgctxt#myContext#myMsgid in the relevant rc
file (e.g. IDS_MY_KEY, "#msgctxt#myContext#myMsgid")
3. Translate

Is that the correct procedure? Or am I missing something?

I suppose, if there are multiple contexts (which should always be the
case when introducing contexts, otherwise "#." extracted comments
should be used IMHO), rc files key should be duplicated as well, so
we'd rather have sthg like that?
IDS_MY_KEY, "myMsgid"


IDS_MY_KEY1, "#msgctxt#myContext1#myMsgid"
IDS_MY_KEY2, "#msgctxt#myContext2#myMsgid"

with source code references adapted,

or maybe

IDS_MY_KEY, "myMsgid"
IDS_MY_KEY1, "#msgctxt#myContext1#myMsgid"

where IDS_MY_KEY uses the most common, "default" context. This would
also minimize the amount of changes to be done in source files.

Thanks for clarifications,


PS: For interested people, here's the "reference" I found :

More information about the wine-devel mailing list