This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch, fortran] PR38573 Missing markers for translation
- From: Jerry DeLisle <jvdelisle at charter dot net>
- To: Jakub Jelinek <jakub at redhat dot com>, Thomas Koenig <tkoenig at netcologne dot de>
- Cc: gfortran <fortran at gcc dot gnu dot org>, gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 1 Apr 2017 10:18:18 -0700
- Subject: Re: [patch, fortran] PR38573 Missing markers for translation
- Authentication-results: sourceware.org; auth=none
- References: <958a1a42-4b5a-7b1e-51df-998e7dc5b0d6@charter.net> <5bbb218a-3a82-cf8e-81ad-7ea0f5429117@netcologne.de> <20170401134050.GW17461@tucnak>
On 04/01/2017 06:40 AM, Jakub Jelinek wrote:
--- snip ---
>
> So, the above means the strings are translated twice (say if in theory
> you translate from english to language X and that translation, when
> used as english, translated again to language X means something different,
> you get wrong message. Furthermore, the above composition of a message
> from separately translated parts is very translation unfriendly, consider
> if in language Y the "is available since Fortran 77" is translated with
> the word "is" somewhere in the middle.
>
> Fix for the double translation is easy, use G_("...") instead of _("...")
> on the string literals and then _() where it is, the G_ marks it for
> translation but nothing else, and _() actually translates it, but as it
> has no string literal in it, doesn't mark anything for translation.
>
> For the construction of diagnostics from separate parts, it is harder,
> especially if we don't want to introduce further -Wformat-security warnings.
> For construction of a message from parts, it is of course fine if the %s
> or %qs provided strings are language keywords that aren't meant to be
> translated.
>
> Jakub
>
Thank you for clarifications. Will change to G_(). I think this PR has been
hanging around a long time because we simply do not understand how these things
work. I posted because I did not think it was very obvious and was not all that
clear to me from the PR discussion.
Jerry