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

Text domain header #43

Merged
merged 3 commits into from Jul 10, 2018

Conversation

2 participants
@swissspidy
Collaborator

swissspidy commented Jul 10, 2018

Fixes #41.

Note: while working on this I uncovered a bug in the destination file determination.

It previously used isset() to check whether the Domain Path header was present. However, it is always set, but can be empty.

This meant that the default value, $this->destination = $this->slug . '.pot'; was never used. Also, that default value is wrong anyway as it doesn't generate the POT file in the plugin's directory, but the current working dir.

swissspidy added some commits Jul 10, 2018

Show outdated Hide outdated src/MakePotCommand.php
Show outdated Hide outdated src/MakePotCommand.php
* @return string String without leading and trailing slashes.
*/
protected function unslashit( $string ) {
return ltrim( rtrim( $string, '/\\' ), '/\\' );

This comment has been minimized.

@schlessera

schlessera Jul 10, 2018

Member

This would actually be a good use of DIRECTORY_SEPARATOR. However, as we are not quite sure what we get and what we already did with it, I'd say we leave it as is now to stay on the safe side (especially with Cygwin on Windows).

@schlessera

schlessera Jul 10, 2018

Member

This would actually be a good use of DIRECTORY_SEPARATOR. However, as we are not quite sure what we get and what we already did with it, I'd say we leave it as is now to stay on the safe side (especially with Cygwin on Windows).

@schlessera schlessera added this to the 0.1.0 milestone Jul 10, 2018

@schlessera schlessera merged commit bd16b5f into master Jul 10, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@schlessera schlessera deleted the text-domain-header branch Jul 10, 2018

@schlessera schlessera added the bug label Jul 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment