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

Владимир Мартьянов
2019-03-29T08:42:51Z

Just try to use gettext with FormatMessage. I don't have idea how to
do it, could you please give me a code sample?

пт, 29 мар. 2019 г. в 11:27, Eli Zaretskii <eliz@gnu.org>:
>
> > 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 _().