About multi-lingual support on MinGW

One day I downloaded a version of MinGW. When I was trying using it to compile a C++ source file, I found that, took me by surprise, the compiler can produce Chinese output like "严重错误:没有输入文件。 编译中断。". But I lose the compiler and never find it again.
I found some translation files under (MinGW installstion folder)\share\locale\zh_CN, but I don't know how how to apply them.
Therefore, are there any way to make the MinGW compiler produce chinese output or apply the translation files?
First of all, the original "MinGW.org" project is pretty much dead, for a long time now.

You really should be using Mingw-w64 these days!
https://www.mingw-w64.org/

I recommend to install Mingw-w64 and the associated build tools (bash, make, etc.) via MSYS2:
https://www.msys2.org/


Furthermore, gcc and g++ should respect the usual LC_* environment variables to set the locale:
https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html#Environment-Variables/

The LC_MESSAGES environment variable specifies the language to use in diagnostic messages.

...so you can try this:
1
2
export LC_MESSAGES=zh_CN
gcc <your parameters here>
Last edited on
@kigar64551

I am using Windows, so I use set LC_MESSAGES=zh_CN, then I type gccbut it still gives me English output. Here is the output:

gcc: fatal error: no input files
compilation terminated.
Even on Windows you won't get far without a "proper" Shell (i.e. bash) and the other usual build tools, such as GNU make. Therefore the recommendation to use MSYS2, which will give you not only the latest version of mingw-w64 (they provide gcc as well as clang), but also a full "Unix-like" environment with bash and make tools. In fact, in MSYS2, you can simply install whatever you need with the pacman package manager.

Anyway, for me LC_MESSAGES=zh_CN does works with pacman, but not with gcc:
https://i.imgur.com/kx6dHPV.png

...which is not much of a surprise, because there is no "gcc.mo" or "cc1.mo" in my directory:
C:\msys64\usr\share\locale\zh_CN\LC_MESSAGES

Not sure, whether I'm missing a required package, or they simply didn't build gcc with locale support ?!

Maybe you want to ask here, which is more likely to give you an answer:
https://www.msys2.org/contact/
Last edited on
@kigar64551

I found that when I am under Windows 7 the MinGW compiler can produce Chinese output (without setting LC_MESSAGES), but under Windows 10 it cannot.
Topic archived. No new replies allowed.