1

Topic: Bug in SecondLanguage reading .mo files?

First of all, thank you for developing the SecondLanguage library. We have been using it successfully for a few months now, for the internationalization of a relatively large application, with almost 3000 text entries in .po files.

I've been looking at a switch to .mo files for fasting application startup, and I ran into failing unit tests when attempting to fetch pluralized forms with a context variable, E.g.:

  Translation.GetPluralString("Box","Boxes", 1, "Noun");

This returns null for my test case.  If I switch the unit test to read from the corresponding .po file, all is well.

I'm building the .mo file using  the GNU msgfmt, with the defaults:  msgfmt  message.po -omessages.mo

BTW, it took a bit of a sales pitch to move the team from the .NET resx approach to using gettext tools, but we've been very happy with the switch.

2

Re: Bug in SecondLanguage reading .mo files?

Hello,

I will take a look at this tomorrow morning.

Thanks for reporting this bug!

James

3

Re: Bug in SecondLanguage reading .mo files?

Hello pharapiak,

I have found the bug with contexts and plurals in .mo files: SecondLanguage saved this combination in a subtly different format from ordinary .mo files. It was self-consistent, but did not match gettext. I have fixed this.

Please let me know if you need me to add any compatibility layer -- for instance if you have been loading .po in SecondLanguage and using it to save in .mo and cannot regenerate from the .po files.

Have a good day, and thanks for letting me know about this bug!

James