RFC: doc for message contexts additions in PO files
frederic.delanoy at gmail.com
Sun Apr 24 04:03:45 CDT 2011
I've put together the following doc for the introduction of message
contexts. It's still a bit raw but I'd improve it for the wiki
Could you please have a look and help proofread it?
I'd like to ensure I didn't miss an important step.
Thanks in advance.
PS: BTW what is the reference version? en_US.po or en.po?
Adding one/more message contexts (ADD LINK TO EXTERNAL DOC) (QUICK MC
Prerequisite: enable maintainer mode using ./configure --enable-maintainer-mode
(you might have to add some development packages; check with your distribution
1. Locate strings to be "altered"
Say you have in your localized po file:
#: file1.rc:123 file2.rc:456
msgid "ambiguous word"
and you want to disambiguate, you'd do the following
2. Find appropriate translations
- check the respective rc entries
(in file1.rc line 123)
FOO "ambiguous word"
(in file2.rc line 456)
BAR "ambiguous word"
and find their meaning/context (e.g. using some code browsing
tools, like cscope to find references; running the program is
3. Add the messages contexts
- The following syntax is used: "translation" -> "#msgctxt#your
- You end up with sthg like
FOO "#msgctxt#context #ambiguous word#"
BAR "#msgctxt#context 2#ambiguous word#"
3. Run 'make depend && make'
4. Edit your po file to add the new translations
5. Ideally, remove the "#, fuzzy" automatically inserted in the
file (and En.rc ).
6. Run 'make' again and test your changes.
More information about the wine-devel