Closed maikeoldsea closed 1 year ago
Hmm that might be a Windows issue, because we definitely do extract file name & line numbers and all our tests verify that. Unfortunately I don‘t have a Windows machine to test.
Does it work with WSL?
I haven't tried WSL since I'm using windows
On Mon, Feb 6, 2023, 23:45 Pascal Birchler @.***> wrote:
Hmm that might be a Windows issue, because we definitely do extract file name & line numbers and all our tests verify that. Unfortunately I don‘t have a Windows machine to test.
Does it work with WSL?
— Reply to this email directly, view it on GitHub https://github.com/wp-cli/i18n-command/issues/352#issuecomment-1420332099, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5XAJRH4QAY3NKXIKNBDBW3WWH4SPANCNFSM6AAAAAAUTPHIIE . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Any luck finding a Windows machine to confirm this issue on yet? I'm stuck without make-pot. It's such a basic example it seems like it must affect other (Windows) users as well.
I‘d recommend installing WSL on your machine and then installing WP-CLI there
I can't use WSL in a Windows build process, but regardless, it seems like it'd make more sense for you to install a Windows partition and just fix the bug(s).
Hi, just tested on Windows setup: PHP 7.4.32 WP-CLI 2.7.1
PHP file:
<?php
$x = __('Hello world');
?>
POT output:
Success: POT file successfully generated!
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2023-02-16T08:58:33+00:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.7.1\n"
#: test.php:2
msgid "Hello world"
msgstr ""
wp cli --info
:
OS: Windows NT 10.0 build 19044 (Windows 10) AMD64
Shell: C:\WINDOWS\system32\cmd.exe
PHP binary: ******\php.exe
PHP version: 7.4.32
php.ini used: ******
MySQL binary:
MySQL version:
SQL modes:
WP-CLI root dir: phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir: phar://wp-cli.phar/vendor
WP_CLI phar path: ******
WP-CLI packages dir:
WP-CLI cache dir: ******
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.7.1
WFM, I get the same results as @pedro-mendonca :
PHP file:
<?php
$x = __('Hello world');
?>
Command
wp i18n make-pot . test.pot --ignore-domain
Output
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2023-02-16T07:57:23-07:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.7.1\n"
#: test.php:2
msgid "Hello world"
msgstr ""
wp --info
OS: Windows NT 10.0 build 22621 (Windows 10) AMD64
Shell: C:\WINDOWS\system32\cmd.exe
PHP binary: <path>\7.4.29\php.exe
PHP version: 7.4.29
php.ini used: <path>\7.4.29\php.ini
MySQL binary:
MySQL version:
SQL modes:
WP-CLI root dir: phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir: phar://wp-cli.phar/vendor
WP_CLI phar path: <path>\wp-content\plugins\test-make-pot
WP-CLI packages dir: <path>/.wp-cli/packages/
WP-CLI cache dir: <path>/.wp-cli/cache
WP-CLI global config: <path>/.wp-cli/config.yml
WP-CLI project config:
WP-CLI version: 2.7.1
Closing this for now since this can't be reproduced yet.
If it can be reproduced reliably, I am happy to reopen it.
Bug Report
Describe the current, buggy behavior When generating a .POT file, the file does not contain the source file name or line number for the extracted string. I see:
I was expecting something like:
Older versions of WP-CLI (2.4.x) seem to be able to parse the file correctly.
Describe how other contributors can replicate this bug
Download the WP-CLI .phar file and create 'wp.bat' as described in the installation instructions (https://make.wordpress.org/cli/handbook/guides/installing/)
Create a test PHP file:
wp i18n make-pot . test.pot --ignore-domain
Check the contents of the resulting 'test.pot' file. I see:
Let us know what environment you are running this on Windows, WP-CLI installed as .phar, PHP 7.4.0