https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80278

            Bug ID: 80278
           Summary: Messages with untranslated string fragment in
                    config/i386/i386.c
           Product: gcc
           Version: 6.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: translation
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fmarchal at perso dot be
  Target Milestone: ---

In function ix86_option_override_internal() in config/i386/i386.c, several
messages are build like this:

   error ("generic CPU can be used only for %stune=%s %s",
      prefix, suffix, sw);

Here, sw is assigned an untranslated string literal:

  /* Set up prefix/suffix so the error messages refer to either the command
     line argument, or the attribute(target).  */
  if (main_args_p)
    {
      prefix = "-m";
      suffix = "";
      sw = "switch";
    }
  else
    {
      prefix = "option(\"";
      suffix = "\")";
      sw = "attribute";
    }

Such messages can't be translated properly because sw isn't translated.

An easy fix might be to use sw=_("switch") and sw=_("attribute") but, if you do
that, please add a comment to let the translators know that the nth %s in the
message is replaced with the translation for "switch" or "attribute".

Reply via email to