Re: [PATCH][PR server/24377] Fix mixing English and system default languages in error messages on Windows

Eli Zaretskii
2019-03-29T08:27:08Z

> From: Ð’Ð»Ð°Ð´Ð¸Ð¼Ð¸Ñ€ ÐœÐ°Ñ€Ñ‚ÑŒÑÐ½Ð¾Ð² <vilgeforce@gmail.com>
> Date: Thu, 28 Mar 2019 23:36:05 +0300
> Cc: gdb-patches@sourceware.org
>
> ÑÐ±, 23 Ð¼Ð°Ñ€. 2019 Ð³. Ð² 16:11, Eli Zaretskii <eliz@gnu.org>:
> > Thanks, but isn't this a step backward? Would it make sense to have
> > the hard-coded messages be translated instead? Or is that impossible
> > for some reason?
>
> There is _nl_locale_name function in intl/localename.c, it could be
> used to retrieve current locale name, which, in turn, could be used to
> translate messages in FormatMessage. But when I include gettextP.h in
> win32-low.c I got an error:
> In file included from win32-low.c:38:0:
> ../../intl/gettextP.h:71:8: error: inline variables are only available
> with -std=c++1z or -std=gnu++1z [-Werror]

Can you tell why you needed to retrieve the current locale's name?

If gdbserver supports NLS and gettext, all you need is to wrap the
untranslated messages in _().