Tallefer/gettext-cs-utils

String key case conflicts with MsgFmt

GoogleCodeExporter opened this issue · 0 comments

Microsoft "resources" files use case-insensitive insertion and case-sensitive 
lookup, so PO files that contain string keys differing only by case do not get 
inserted when calling MsgFmt.exe.

Attached is a patch to MsgFmt.exe that works around this limitation by 
prepending to each inserted string key a "prefix string", containing the offset 
of every char that differs from the LowerInvariant char, allowing string keys 
differing only by case to be inserted into the resources file without conflict.

The patch also provides an interface for apply prefixes to, and prefixes from, 
string keys.  To look up a string, Prefix.Apply is called to apply the prefix 
the string so that it will be found:

resourceManager.GetString(Gettext.Cs.Prefix.Apply(value));

Original issue reported on code.google.com by Jason....@gmail.com on 22 Oct 2012 at 6:22

Attachments: