Closed robert-j-engdahl closed 5 years ago
The problem appears to be that I am creating a .pot file and so I don't give a Translation. Also the Translation property on POSingularEntry wasn't in the constructor, so I think it should be expected to have a valid default value or at least cause a descriptive Exception.
Here is the change I needed to make:
POCatalog catalog = new POCatalog(new List<IPOEntry> {
new POSingularEntry(new POKey("MSGID", pluralId: "MSGIDPL", contextId: "MSGCTX"))
{
Translation = "" ,
},
});
Translation
is a read-write property, hence not included in the ctor params.
I came to the decision not to throw an exception but to treat unset (null reference string) translations as empty strings when generating PO files. Unfortunately, unset translations can be added to POPluralEntry
objects, too. Changing this behavior would be a BC I don't want to introduce.
The code
throws an exception with the following stacktrace:
and even if I find out how to solve this soon, it is still to be preferred with an informative exception about what I did wrong.