Skip to content

php-format comment missing #427

@kkmuffme

Description

@kkmuffme

Bug Report

Describe the current, buggy behavior

The

#, php-format

comment is not added (anymore?) when running wp i18n make-pot

#121 (comment) provides an example where it should exist, but it seems only the plural issue was fixed there, but the "php-format" comment is/was still missing.

Describe how other contributors can replicate this bug

wp i18n make-pot for printf( _n( '%d cat', '%d cats', 1, 'foo' ), 1 );

See correct results with:
xgettext test.php for

<?php
printf( ngettext( '%d cat', '%d cats', 1 ), 1 );

Describe what you would expect as the correct outcome

#: test.php:2
#, php-format
msgid "%d cat"
msgid_plural "%d cats"
msgstr[0] ""
msgstr[1] ""

Let us know what environment you are running this on

WP-CLI version: 2.11.0

Provide a possible solution

If there is a placeholder add the php-format comment (like it's already done for the "translators:" anyway, so in those cases + those where we don't have a translators comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions