Closed Goral64 closed 3 years ago
I didn't know this flag. Is this a standard?
https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html
php-format no-php-format Likewise for PHP, see php-format.
https://www.gnu.org/software/gettext/manual/html_node/php_002dformat.html#php_002dformat 15.3.24 PHP Format Strings PHP format strings are described in the documentation of the PHP function sprintf, in phpdoc/manual/function.sprintf.html or http://www.php.net/manual/en/function.sprintf.php.
I've implemented a regexp to detect if the original text includes a sprintf expression: https://github.com/php-gettext/PHP-Scanner/blob/master/src/PhpScanner.php#L58
Could you check if it works fine to you, before release a new version?
It seems to be working very well. Thank you and I look forward to the PR.
Ok, new version released including this.
The scanner does not add the php-format flag for gettext() arguments that are a format string for sprintf() functions such as %s or %d. For example:
sprintf(gettext("This is %s"), $value);
does not return flag#, php-format