the3dfxdude/7kaa — pull request #17 by 7k2 (2013-12-20 02:40:23+00:00)
Title: Disable gettext for MSVC

I tested the patch on 32-bit Linux with gcc 4.8.2, Clang 3.3, MinGW-w64 20130523, and Windows SDK* (VS 2008; compiler version 15.00.30729.01). For each build, I loaded tutorial 13 (“Seats of Power & Greater Beings”), and let it run at speed 8 till Jan 1, 1014. This let me check a small sample of the news messages.

In the Clang build, there was a news item that was incorrectly displayed. Instead of “Yax Moch Xoc has betrayed you and turned towards Korax's Kingdom,” it showed up as “Korax has betrayed you and turned towards Korax's Kingdom.”

I can get it to work correctly if I have:

String name(race_res[short_para1]->get_name(short_para2));
snprintf(str, MAX_STR_LEN+1, _("%s has betrayed you and turned towards %s."), &name, nation_name2());

instead of:

snprintf(str, MAX_STR_LEN+1, _("%s has betrayed you and turned towards %s."), race_res[short_para1]->get_name(short_para2), nation_name2());

(News::unit_betray() in ONEWSENG.cpp)

Both get_name() and nation_name2() return a char pointer to a local static String (OSTR) in their respective functions. I’m not sure what the root cause of the problem is.

* Thanks to the3dfxdude for the https://wiki.videolan.org/GenerateLibFromDll link. I was able to create a suitable library from OpenAL32.dll for use with MSVC.