[Bug translation/93759] Invalid % in param

2021-10-27 Thread egallager at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93759

Eric Gallager  changed:

   What|Removed |Added

   Keywords||easyhack
 Status|NEW |RESOLVED
   Severity|normal  |trivial
 Resolution|--- |FIXED

--- Comment #8 from Eric Gallager  ---
(In reply to Roland Illig from comment #7)
> Is there still something to do for this bug?
> 
> de.po looks good now, having "c-no-format" instead of "c-format".

Well, you were the one to open it originally, so if you don't see anything left
to do, I guess that means it can be closed now...

[Bug translation/93759] Invalid % in param

2021-01-19 Thread roland.illig at gmx dot de via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93759

--- Comment #7 from Roland Illig  ---
Is there still something to do for this bug?

de.po looks good now, having "c-no-format" instead of "c-format".

[Bug translation/93759] Invalid % in param

2020-02-21 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93759

--- Comment #6 from CVS Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:8d1780b56d0cb1d50115d4e925e81cd8b9cb2923

commit r10-6794-g8d1780b56d0cb1d50115d4e925e81cd8b9cb2923
Author: Jakub Jelinek 
Date:   Fri Feb 21 22:01:03 2020 +0100

i18n: Fix translation of --help [PR93759]

The first two hunks make sure we actually translate what has been marked
for translation, i.e. the cl_options[...].help strings, rather than those
strings ammended in various ways, like:
_("%s  Same as %s."), help, ...
or
"%s  %s", help, _(use_diagnosed_msg)

The exgettext changes attempt to make sure that the cl_options[...].help
strings are marked as no-c-format, because otherwise if they happen
to contain a % character, such as the 90% substring, they will be marked
as c-format, which they aren't.

2020-02-21  Jakub Jelinek  

PR translation/93759
* opts.c (print_filtered_help): Translate help before appending
messages to it rather than after that.

* exgettext: For *.opt help texts, use __opt_help_text("...")
rather than _("...") in the $emsg file and pass options that
say that this implies no-c-format.

[Bug translation/93759] Invalid % in param

2020-02-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93759

--- Comment #5 from Jakub Jelinek  ---
Created attachment 47861
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47861=edit
gcc10-pr93759.patch

I think this patch should fix both issues, but in gcc.pot lots off the *.opt
messages are then marked ,no-c-format, rather than most of them without a flag
and just the few ones with % chars as (incorrectly) ,c-format.

[Bug translation/93759] Invalid % in param

2020-02-17 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93759

Jakub Jelinek  changed:

   What|Removed |Added

 Status|WAITING |NEW
 CC||jakub at gcc dot gnu.org,
   ||jsm28 at gcc dot gnu.org

--- Comment #4 from Jakub Jelinek  ---
The --help translation looks very much broken.  The help string from the *.opt
files is stored in cl_options[???].help.
  help = option->help;
  if (help == NULL)
{
  if (exclude_flags & CL_UNDOCUMENTED)
continue;

  help = undocumented_msg;
}

  if (option->alias_target < N_OPTS
  && cl_options [option->alias_target].help)
{
  if (help == undocumented_msg)
{
  /* For undocumented options that are aliases for other options
 that are documented, point the reader to the other option in
 preference of the former.  */
  snprintf (new_help, sizeof new_help,
_("Same as %s.  Use the latter option instead."),
cl_options [option->alias_target].opt_text);
}
  else
{
  /* For documented options with aliases, mention the aliased
 option's name for reference.  */
  snprintf (new_help, sizeof new_help,
_("%s  Same as %s."),
help, cl_options [option->alias_target].opt_text);
}

  help = new_help;
}

  if (option->warn_message)
{
  /* Mention that the use of the option will trigger a warning.  */
  if (help == new_help)
snprintf (new_help + strlen (new_help),
  sizeof new_help - strlen (new_help),
  "  %s", _(use_diagnosed_msg));
  else
snprintf (new_help, sizeof new_help,
  "%s  %s", help, _(use_diagnosed_msg));

  help = new_help;
}

  /* Get the translation.  */
  help = _(help);
So, yes, they are just passed to _() and thus shouldn't be marked ,c-format.
But in the alias case where the help is documented it will actually never find
the right translation, etc.

[Bug translation/93759] Invalid % in param

2020-02-17 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93759

Martin Liška  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2020-02-17
 CC||marxin at gcc dot gnu.org
 Ever confirmed|0   |1

--- Comment #3 from Martin Liška  ---
@Roland: Where do you see the error? Is it a compilation warning?

[Bug translation/93759] Invalid % in param

2020-02-15 Thread roland.illig at gmx dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93759

--- Comment #2 from Roland Illig  ---
(In reply to Andreas Schwab from comment #1)
> Apparently the problem is that "% p" looks like a valid c-format.

Then there's a bug in either gettext or the GCC definitions of where c-format
strings may appear. The decision for making a string c-format or not must not
be based on the string's value, but on the context where it appears.

[Bug translation/93759] Invalid % in param

2020-02-15 Thread sch...@linux-m68k.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93759

--- Comment #1 from Andreas Schwab  ---
Apparently the problem is that "% p" looks like a valid c-format.