public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: niXman <i.nixman@autistici.org>
Cc: Gcc Help <gcc-help@gcc.gnu.org>
Subject: Re: --enable-nls doesn't work as expected
Date: Fri, 5 Jan 2024 11:19:18 +0000	[thread overview]
Message-ID: <CAH6eHdT2SBreQoCycedwCUR+ZdwFnnztFGMAAxtXORraw2Qqfg@mail.gmail.com> (raw)
In-Reply-To: <fdc044d7367185330d6d9ba61dd0fd02@autistici.org>

On Fri, 5 Jan 2024 at 11:06, niXman via Gcc-help <gcc-help@gcc.gnu.org> 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.

  reply	other threads:[~2024-01-05 11:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-05 11:05 niXman
2024-01-05 11:19 ` Jonathan Wakely [this message]
2024-01-05 12:03   ` niXman
2024-01-05 12:24   ` LIU Hao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAH6eHdT2SBreQoCycedwCUR+ZdwFnnztFGMAAxtXORraw2Qqfg@mail.gmail.com \
    --to=jwakely.gcc@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=i.nixman@autistici.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).