Re: --enable-nls doesn't work as expected

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 5 Jan 2024 at 11:06, niXman via Gcc-help <gcc-help@xxxxxxxxxxx> wrote:
>
> hello,
>
> in my MinGW-builds (https://github.com/niXman/mingw-builds) projects I
> use `--disable-nls` by default and all works as expected.
>
> but I received a request to enable NLS support:
> https://github.com/niXman/mingw-builds/issues/666
>
> the problem is when using `--enable-nls` the built compiler outputs
> messages for the `gcc` or `gcc -v` or `gcc --help` commands in the
> language of the user's locale (in this case Chinese), but the error
> messages it still outputs in English:
> https://github.com/niXman/mingw-builds/issues/666#issuecomment-1878064389
>
> any ideas?

That should work fine. The zh_CN.po file contains translations for
"error" and "%qD was not declared in this scope" so if the first
command uses the translated strings, then the second one should too.

It works perfectly for me using a native linux compiler:

$ LANG=zh_CN.utf-8 gcc hello.cpp
hello.cpp: In function ‘int main()’:
hello.cpp:3:1: 错误:‘cout1’在此作用域中尚未声明>
   3 | cout1 << "Hello";
     | ^~~~~


Are you able to reproduce this yourself, using your build? I would
check it, to make sure it isn't just user error, e.g. forgetting to
set the locale in the environment for the second command. You should
also ask the user how they're setting the locale. i.e. do some basic
triage and analysis of the issue report.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux