Home > Net >  Gettext msgid is empty
Gettext msgid is empty

Time:04-07

The xgettext command extracted this .pot from my .c file:

#: src/callbacks.c:171
msgid ""
"A new NEC2 input file may not be opened\n"
"while the Frequency Loop is running"
msgstr ""

from here:

  if( !Nec2_Save_Warn(
        _("A new NEC2 input file may not be opened\n"
          "while the Frequency Loop is running")) )
    return;

Questions:

  • Is it a problem that the first line of msgid is an empty string?
  • Will it affect the ability for dgettext to find the translation when the lines are translated?
  • Other considerations?

CodePudding user response:

This is normal, this is how gettext works with multi-line strings, the first "" line isn't an empty string it just says "this is a multi-line string". xgettext does this for lines that are too long (that can be controlled by --no-wrap) and for strings with embedded new lines.

The translation must be in the same format but other than that, there's no reason to worry.

  • Related