0

Translating a website with gettext and PoEdit for the first time, I noticed that the messages generated by conditional statements are ignored.

How can PoEdit get the messages from a switch construct like this, for example?

if ($a == 1)
    echo _("Text one");
else if ($a == 2)
    echo _("Text two");
else if ($a == 3)
    echo _("More text .. $b");
GCW
  • 312
  • 5
  • 17

1 Answers1

0

This is not a "switch statement", but regardless, I assure you that neither Poedit nor xgettext (which is what does the extraction) treats code inside if statements any differently from any other code.

Whatever the problem is with your unknown code and your unknown Poedit configuration / xgettext invocation is impossible to say. What is possible to say, with certainly, is that it is not related to conditional statements — that would be utterly ridiculous and non-functional (can you imagine non-trivial piece of code without any branching?).

Václav Slavík
  • 6,445
  • 2
  • 28
  • 25