Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add X-Generator header to resulting POT file #53

Closed
swissspidy opened this issue Jul 24, 2018 · 5 comments
Closed

Add X-Generator header to resulting POT file #53

swissspidy opened this issue Jul 24, 2018 · 5 comments

Comments

@swissspidy
Copy link
Member

A header like X-Generator: WP-CLI 2.0.0 (using WP_CLI_VERSION) could be useful for developers to see where the POT file is coming from. See #50 (comment).

Even better would be if we could also get the package's version, but I'm not sure how feasible that is.

@vslavik
Copy link

vslavik commented Jul 24, 2018

Even better would be if we could also get the package's version

I'm not sure what you mean by that. If you're referring to some dependencies of WP-CLI, then I think it would be superfluous — everybody uses just <tool>[ <version>] for this header. If you mean the thing the POT is being generated for, then it shouldn't affect X-Generator and should go into (only) the Project-Id-Version header.

@swissspidy
Copy link
Member Author

I was thinking of „WP-CLI i18n-command 1.0.0“ instead of „WP-CLI 2.0.0“

@swissspidy
Copy link
Member Author

@schlessera Is there a way I can get this command's version in PHP? I think it makes more sense to have X-Generator: WP-CLI i18n-command 1.0.0 instead of X-Generator: WP-CLI 2.0.0.

@schlessera
Copy link
Member

@swissspidy, re. package version, there's three scenarios:

  1. For the Phar bundle, you'll find a file inside the Phar called COMPOSER_VERSIONS: https://github.com/wp-cli/wp-cli/blob/v1.5.1/utils/make-phar.php#L288
  2. For commands installed through the package manager, you'd have to get it from the Composer package information through the package manager: https://github.com/wp-cli/package-command/blob/master/src/Package_Command.php#L770-L781
  3. For packages installed via regular Composer, you'll have to parse the Composer information yourself.

I suggest merging the current code as-is, and create a new issue to discuss adding a wp package version command to abstract the above away.

@swissspidy
Copy link
Member Author

Opened wp-cli/package-command#85 and closing this for now.

schlessera pushed a commit that referenced this issue Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants