1

I use Gettext and Poedit for translatating web-applications.

$args = array(0 => "about");
$Header['title'] = _("title_".$args[0]);

The problem is that it is receiving only "title_".

2
  • Please clarify what's your problem. Mar 9, 2015 at 12:10
  • I use poedit, it is not parsing and is receiving only title_. This dynamic content, poedit show only title_, it not working
    – Alex
    Mar 9, 2015 at 12:29

1 Answer 1

2

By “receiving” you probably mean that xgettext/Poedit only extracts the string literal from there. Well, xgettext only parses the code to extract literals. It can’t very well somehow magically know what possible values you might pass in as $args values, can it? And because it can’t read your mind, it can only extracts what it can see. Frankly, I’d consider it a xgettext bug that it evens extracts “title_” from this.

You can only meaningfully use literals as gettext function arguments.

1
  • (This is a bit of an oversimplification, if you want to know the full story, read the GNU gettext manual to grasp the concepts.) Mar 10, 2015 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.