'Gettext picks reads from wrong directory

I'm using GNU gettext to translate a program written in C++ with MFC and running under MS Windows and now I have a problem.

I have subdirectories for the Chinese translations as zh-CN and zh-TW and I set the language to use as

setlocale(LC_ALL, "zh-TW");
SetThreadLocale(1028);

The second one is using the LCID for traditional Chinese. Now the problem is that gettext don't read from my zh-TW directory, but instead tries to read from zh that don't exist so I get English. If I rename my zh-TW directory to just zh it works, but I also have to support simplified Chinese (zh-CN).

How do I convince gettext to read from the right directory?



Solution 1:[1]

The tricky part is that gettext looks for zh_TW so zh-TW will be ignored.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 liftarn