Code Monkey home page Code Monkey logo

gulp-wp-pot's Introduction

gulp-wp-pot

Information

npm version GitHub Workflow Status Scrutinizer Code Quality Code Coverage

Package gulp-wp-pot
Description Gulp wrapper for wp-pot. Generates pot files for WordPress plugins and themes.

Like my work and want to say thanks?

Do it here:
Buy Me A Coffee

Install

$ npm install --save-dev gulp-wp-pot

Example usage with Gulp

var gulp = require('gulp');
var wpPot = require('gulp-wp-pot');

gulp.task('default', function () {
    return gulp.src('src/*.php')
        .pipe(wpPot( {
            domain: 'domain',
            package: 'Example project'
        } ))
        .pipe(gulp.dest('file.pot'));
});

wpPot({options})

See available options in the wp-pot readme, https://github.com/wp-pot/wp-pot#options
All options except src and writeFile is passed to wp-pot.

Related

License

MIT Β© Rasmus Bengtsson | Initial work by Willy Bahuaud

gulp-wp-pot's People

Contributors

dependabot[bot] avatar fossabot avatar frozzare avatar greenkeeper[bot] avatar greenkeeperio-bot avatar mlang38 avatar mmassaki avatar rasmusbe avatar renovate-bot avatar snyk-bot avatar willybahuaud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gulp-wp-pot's Issues

"translators:" comment not working in certain situations.

Thanks in advance! Really, really useful stuff πŸ˜€.

Consider the following example:

Does Not Work.

<?php 
/**
 * The Copyright Message Template.
 */
?>

<p><?php 
	
	/* translators: 1: current year, 2: site title link. */
	printf( 
		_x( '&copy; %1$d %2$s', 'site copyright', 'textdomain' ), 
		date( 'Y' ), 
		'<a href="' . esc_url( home_url( '/' ) ) . '">' . esc_html( get_bloginfo( 'name' ) ) . '</a>'
	);

?></p>

.pot: Missing translators: comment.

#: template-parts/copyright.php:16
msgctxt "site copyright"
msgid "&copy; %1$d %2$s"
msgstr ""

Does Work.

<?php 
/**
 * The Copyright Message Template.
 */

/* translators: 1: current year, 2: site title link. */
printf( 
	_x( '&copy; %1$d %2$s', 'site copyright', 'textdomain' ), 
	date( 'Y' ), 
	'<a href="' . esc_url( home_url( '/' ) ) . '">' . esc_html( get_bloginfo( 'name' ) ) . '</a>'
);

.pot: All is well here.

#. translators: 1: current year, 2: site title link.
#: template-parts/copyright.php:8
msgctxt "site copyright"
msgid "&copy; %1$d %2$s"
msgstr ""

Trying to get JS parser to work

Hi, excuse my basic understanding of gulp.

I have been successfully generating pot files for php

gulp.task('translatePHP', () => { return gulp.src(['src/**/*.php', '!src/{vendor,vendor/**}']) .pipe(sort()) .pipe(wpPot({ domain: project, package: project })) .on('error', gutil.log) .pipe(gulp.dest('src/languages/' + project + '.pot')) .pipe(notify({message: 'TASK: "translate" Completed! πŸ’―', onLast: true})); });

but with my attempt at JS

gulp.task('translateJS', () => { return gulp.src(['src/**/*.js', '!src/{vendor,vendor/**}']) .pipe(sort()) .pipe(wpPot({ parser: 'js', parserOptions: { ecmaVersion: 6, }, })) .on('error', gutil.log) .pipe(gulp.dest('src/languages/' + project + '.js.pot')) .pipe(notify({message: 'TASK: "translate" Completed! πŸ’―', onLast: true})); });

I just get an error and no clue as what is erroring

[08:45:51] Using gulpfile ~/projects/github.com/alanef/plugin-widget-for-eventbrite-api-project/gulpfile.js [08:45:51] Starting 'translateJS'... [08:45:53] error [08:45:53] The following tasks did not complete: translateJS

Any help with how to investigate would be fantastic.

An in-range update of wp-pot is breaking the build 🚨

The dependency wp-pot was updated from 1.6.3 to 1.6.4.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

wp-pot is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v1.6.4
  • Update php-parser to version 3.0.0-prerelease.6
  • Add fixes to be compatible with new php-parser version
Commits

The new version differs by 15 commits.

  • 10df9cc 1.6.4
  • 3e2fa1d updates
  • 1741d3e Merge pull request #55 from rasmusbe/greenkeeper/php-parser-3.0.0-prerelease.6
  • cd8b879 changes for php-parser 3
  • 009babe chore(package): update lockfile package-lock.json
  • 1f4754f fix(package): update php-parser to version 3.0.0-prerelease.6
  • 61b0970 Merge pull request #54 from rasmusbe/rasmusbe-patch-1
  • 7dd4655 Update readme.md
  • 9af20c3 Merge pull request #53 from rasmusbe/greenkeeper/php-parser-3.0.0-prerelease.5
  • ec6b8eb chore(package): update lockfile package-lock.json
  • 3c057bc fix(package): update php-parser to version 3.0.0-prerelease.5
  • 5e04a4e Merge pull request #52 from rasmusbe/greenkeeper/php-parser-3.0.0-prerelease.4
  • 3d9ffd6 chore(package): update lockfile
  • 6e89aba fix(package): update php-parser to version 3.0.0-prerelease.4
  • 14a988a travis fixes

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Add Support for Extracted Comments

gulp-wp-pot does not support extracted comments e.g. using the "translators:" (or other) keyword at the start of comments just prior to a translation function call, e.g.

your-translated-file.php:

<?php
/* translators: Limit to 32 characters or less */
$short_variable = __('Limited Length Phrase', 'sample-textdomain');

might produce a pot entry like so:

sample-textdomain.pot: (excerpt)

#. translators: Limit to 32 characters or less
#: your-translated-file.php:3
msgid "Limited Length Phrase"
msgstr ""

Not picking up translations inside WooCommerce conditionals

This is my page.php template:

<?php
/**
   * Default page template
   * @package SG One
*/
get_header(); 

	echo '<section>';
		get_template_part('template-parts/nav/nav', 'sub');
		echo '<div class="container grid-2xl">';
		get_template_part('template-parts/components/component', 'breadcrumbs'); 
		echo '</div>';
	echo '</section>';

	echo '<section class="section-margin hide-mp-top">';
	echo '<div class="container grid-2xl">';

		if(class_exists('woocommerce')):
			if(is_cart()):
				echo '<h1>' . get_the_title() . '</h1>';
				echo do_shortcode('[woocommerce_cart]');
			elseif(is_checkout()):
				if(is_wc_endpoint_url('order-received')){

					// This translation is not being picked up
					echo '<h1 class="h2">' . __('Order confirmation', 'sg-one') . '</h1>';
				}
				echo do_shortcode('[woocommerce_checkout]');
			elseif(is_account_page()):
				echo '<h1>' . get_the_title() . '</h1>';
				echo do_shortcode('[woocommerce_my_account]');
			else:
				echo '<h1>' . get_the_title() . '</h1>';
				the_content();
			endif;
		else:
			echo '<h1>' . get_the_title() . '</h1>';
			the_content();
		endif;
	
		// This translation is being picked up
		echo __('Test', 'sg-one');

		echo '</div>';
	echo '</section>';

get_footer(); 
?>

gulp-wp-pot is not generating the translation of __('Order confirmation', 'sg-one') inside the WooCommerce conditionals. Outside the conditionals, translations works just fine.

These are my dev dependencies:

"devDependencies": {
    "browser-sync": "^2.26.7",
    "gulp": "^4.0.2",
    "gulp-autoprefixer": "^7.0.1",
    "gulp-concat": "^2.6.1",
    "gulp-ext-replace": "^0.3.0",
    "gulp-imagemin": "^7.1.0",
    "gulp-sass": "^4.0.2",
    "gulp-sort": "^2.0.0",
    "gulp-sourcemaps": "^2.6.5",
    "gulp-uglify": "^3.0.2",
    "gulp-wp-pot": "^2.4.1",
    "gulp-zip": "^5.0.1",
    "imagemin-mozjpeg": "^8.0.0",
    "imagemin-webp": "^5.1.0",
    "merge-stream": "^2.0.0",
    "pump": "^3.0.0"
}

This is my gulp task:

gulp.task('translate', function() {
	return gulp.src(themeDir + '**/*.php')
		.pipe(sort())
		.pipe(wpPot({
			domain        : 'sg-one',
			package       : 'SG One'
		}))
	.pipe(gulp.dest(themeDir + 'languages/en_GB.pot'))
});

I'm still having the issue without .pipe(sort()).

An in-range update of wp-pot is breaking the build 🚨

Version 1.6.2 of wp-pot was just published.

Branch Build failing 🚨
Dependency wp-pot
Current Version 1.6.1
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

wp-pot is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ❌ continuous-integration/travis-ci/push: The Travis CI build could not complete due to an error (Details).

Release Notes v1.6.2

Updated dependencies for php-parser and matched

Commits

The new version differs by 4 commits.

  • fce4e65 1.6.2
  • 92b29b3 Update deps
  • cd8d3a2 Merge pull request #43 from rasmusbe/dev-update
  • 35e16c7 Updated dev packages and updated failed tests

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of wp-pot is breaking the build 🚨

Version 1.1.0 of wp-pot just got published.

Branch Build failing 🚨
Dependency wp-pot
Current Version 1.0.0
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As wp-pot is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 9 commits .

  • 289dd02 1.1.0
  • 750a37e Earlier domain check and easier comment passing
  • f433203 Use php-parser for more parsing
  • 15002ac Some small eslint rule changes
  • 53931b6 Small code syntax changes and some added rules
  • 66b1d85 Update some code to es6
  • 9717af2 Update readme.md
  • cee7587 Merge pull request #2 from rasmusbe/greenkeeper/php-parser-1.0.0
  • d0fd4ad fix(package): update php-parser to version 1.0.0

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Tie translations to gulp.src location, not location of Gulpfile

When the gulpfile setup lives outside the project folder, the translation file gets messed up.

Let's say for example I have the following setup:

Gulpfile etc sits in
wp-content/themes/gulp-dev

Actual theme sits in
wp-content/themes/mytheme

The Gulp task looks like this (simplified):

var root = '../mytheme/';
var languages = root + 'languages/';

gulp.task('i18n', function () {
    return gulp.src(root + '**/*.php')
	.pipe(sort())
	.pipe(wppot( {
		domain: 'mytheme',
		destFile:  languages + 'mytheme.pot',
		package: themename
	} ))
	.pipe(gulp.dest(languages));
});

The resulting output in the .pot file gets this:

#: ../mytheme/404.php:17
msgid "hmmm. Oops! That page can&rsquo;t be found."
msgstr ""

The URL reference contains the relative link to the theme folder. It still works (because the URI just points back to itself) but it's not clean.

An in-range update of wp-pot is breaking the build 🚨

Version 1.3.0 of wp-pot just got published.

Branch Build failing 🚨
Dependency wp-pot
Current Version 1.2.0
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

wp-pot is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this πŸ’ͺ

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details

Commits

The new version differs by 12 commits.

  • 772eaed 1.3.0
  • a0a72f6 Add support for template name headers
  • c46b8cb Add support for metadata in file headers
  • 76bba6b Keep comments when processing same line
  • 140b364 Make headers function better
  • 44b1b01 Improve code style
  • 488cf04 Better looping in pot maker
  • 22d5214 Split code into classes to improve code quality
  • e6ba169 Add tests for node 4 since its still maintained
  • 6791e85 Set temporary path on travis to avoid failures
  • e0053ff Merge pull request #18 from rasmusbe/greenkeeper/eslint-plugin-node-5.0.0
  • a144c51 chore(package): update eslint-plugin-node to version 5.0.0

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of eslint is breaking the build 🚨

Version 3.13.0 of eslint just got published.

Branch Build failing 🚨
Dependency eslint
Current Version 3.12.2
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As eslint is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Release Notes v3.13.0
  • cd4c025 Update: add fixer for no-extra-label (#7840) (Teddy Katz)
  • aa75c92 Fix: Ensure prefer-const fixes destructuring assignments (fixes #7852) (#7859) (Teddy Katz)
  • 4008022 Chore: Refactor to use ES6 Classes (Part 3)(refs #7849) (#7865) (Gyandeep Singh)
  • c9ba40a Update: add fixer for no-unneeded-ternary (#7540) (Teddy Katz)
  • dd56d87 Update: add object-shorthand option for arrow functions (fixes #7564) (#7746) (Teddy Katz)
  • fbafdc0 Docs: padded-blocks never case (fixes #7868) (#7878) (alberto)
  • ca1f841 Fix: no-useless-return stack overflow on loops after throw (fixes #7855) (#7856) (Teddy Katz)
  • d80d994 Update: add fixer for object-property-newline (fixes #7740) (#7808) (Teddy Katz)
  • bf3ea3a Fix: capitalized-comments: Ignore consec. comments if first is invalid (#7835) (Kevin Partington)
  • 616611a Chore: Refactor to use ES6 Classes (Part 2)(refs #7849) (#7847) (Gyandeep Singh)
  • 856084b Chore: Refactor to use ES6 Classes (Part 1)(refs #7849) (#7846) (Gyandeep Singh)
  • bf45893 Docs: Clarify that we only support Stage 4 proposals (#7845) (Kevin Partington)
  • 0fc24f7 Fix: adapt new-paren rule so it handles TypeScript (fixes #7817) (#7820) (Philipp A)
  • df0b06b Fix: no-multiple-empty-lines perf issue on large files (fixes #7803) (#7843) (Teddy Katz)
  • 18fa521 Chore: use ast-utils helper functions in no-multiple-empty-lines (#7842) (Teddy Katz)
  • 7122205 Docs: Array destructuring example for no-unused-vars (fixes #7838) (#7839) (Remco Haszing)
  • e21b36b Chore: add integration tests for cache files (refs #7748) (#7794) (Teddy Katz)
  • 2322733 Fix: Throw error if ruletester is missing required test scenarios (#7388) (Teddy Katz)
  • 1beecec Update: add fixer for operator-linebreak (#7702) (Teddy Katz)
  • c5c3b21 Fix: no-implied-eval false positive on 'setTimeoutFoo' (fixes #7821) (#7836) (Teddy Katz)
  • 00dd96c Chore: enable array-bracket-spacing on ESLint codebase (#7830) (Teddy Katz)
  • ebcae1f Update: no-return-await with with complex return argument (fixes #7594) (#7595) (Dalton Santos)
  • fd4cd3b Fix: Disable no-var autofixer in some incorrect cases in loops (#7811) (Alan Pierce)
  • 1f25834 Docs: update outdated info in Architecture page (#7816) (Teddy Katz)
  • f20b9e9 Fix: Relax no-useless-escape's handling of ']' in regexes (fixes #7789) (#7793) (Teddy Katz)
  • 3004c1e Fix: consistent-return shouldn't report class constructors (fixes #7790) (#7797) (Teddy Katz)
  • b938f1f Docs: Add an example for the spread operator to prefer-spread.md (#7802) (#7804) (butlermd)
  • b8ce2dc Docs: Remove .html extensions from links in developer-guide (#7805) (Kevin Partington)
  • aafebb2 Docs: Wrap placeholder sample in {% raw %} (#7798) (Daniel Lo Nigro)
  • bb6b73b Chore: replace unnecessary function callbacks with arrow functions (#7795) (Teddy Katz)
  • 428fbdf Fix: func-call-spacing "never" doesn't fix w/ line breaks (fixes #7787) (#7788) (Kevin Partington)
  • 6e61070 Fix: semi false positive before regex/template literals (fixes #7782) (#7783) (Teddy Katz)
  • ff0c050 Fix: remove internal property from config generation (fixes #7758) (#7761) (alberto)
  • 27424cb New: prefer-destructuring rule (fixes #6053) (#7741) (Alex LaFroscia)
  • bb648ce Docs: fix unclear example for no-useless-escape (#7781) (Teddy Katz)
  • 8c3a962 Fix: syntax errors from object-shorthand autofix (fixes #7744) (#7745) (Teddy Katz)
  • 8b296a2 Docs: fix in semi.md: correct instead of incorrect (#7779) (German Prostakov)
  • 3493241 Upgrade: strip-json-comments ~v2.0.1 (Janus Troelsen)
  • 75b7ba4 Chore: enable object-curly-spacing on ESLint codebase (refs #7725) (#7770) (Teddy Katz)
  • 7d1dc7e Update: Make default-case comment case-insensitive (fixes #7673) (#7742) (Robert Rossmann)
  • f1bf5ec Chore: convert remaining old-style context.report() calls to the new API (#7763) (Teddy Katz)
Commits

The new version differs by 43 commits .

  • 8571ab8 3.13.0
  • d54e0c1 Build: package.json and changelog update for 3.13.0
  • cd4c025 Update: add fixer for no-extra-label (#7840)
  • aa75c92 Fix: Ensure prefer-const fixes destructuring assignments (fixes #7852) (#7859)
  • 4008022 Chore: Refactor to use ES6 Classes (Part 3)(refs #7849) (#7865)
  • c9ba40a Update: add fixer for no-unneeded-ternary (#7540)
  • dd56d87 Update: add object-shorthand option for arrow functions (fixes #7564) (#7746)
  • fbafdc0 Docs: padded-blocks never case (fixes #7868) (#7878)
  • ca1f841 Fix: no-useless-return stack overflow on loops after throw (fixes #7855) (#7856)
  • d80d994 Update: add fixer for object-property-newline (fixes #7740) (#7808)
  • bf3ea3a Fix: capitalized-comments: Ignore consec. comments if first is invalid (#7835)
  • 616611a Chore: Refactor to use ES6 Classes (Part 2)(refs #7849) (#7847)
  • 856084b Chore: Refactor to use ES6 Classes (Part 1)(refs #7849) (#7846)
  • bf45893 Docs: Clarify that we only support Stage 4 proposals (#7845)
  • 0fc24f7 Fix: adapt new-paren rule so it handles TypeScript (fixes #7817) (#7820)

There are 43 commits in total. See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

wrong context on _nx_noop()

using:

_nx_noop( 'Singular', 'Plural', 'context', PLUGIN_TEXTDOMAIN );

getting:

#: includes/file.php:xx
msgctxt "PLUGIN_TEXTDOMAIN"
msgid "Singular"
msgid_plural "Plural"
msgstr[0] ""
msgstr[1] ""

must be:

#: includes/file.php:xx
msgctxt "context"
msgid "Singular"
msgid_plural "Plural"
msgstr[0] ""
msgstr[1] ""

WordPress is:

function _nx_noop( $singular, $plural, $context, $domain = null ) {
    ...
}

Dependency Dashboard

This issue provides visibility into Renovate updates and their statuses. Learn more

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.


  • Check this box to trigger a request for Renovate to run again on this repository

Translator notes not added to .pot file

Using version 2.0.4, translator notes in my PHP file are not getting added to the generated .pot file as expected.

Source:

<?php
/* translators: PHP date string used by mysql2date function */
$date_string = __( 'j F Y @ g:i a', 'my_textdomain' );
?>

Output:

#: assets/functions/admin.php:56
msgid "j F Y @ g:i a"
msgstr ""

An in-range update of eslint-config-standard is breaking the build 🚨

The devDependency eslint-config-standard was updated from 14.0.1 to 14.1.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-config-standard is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ node-multi-build: * node-v11 - Failed

Commits

The new version differs by 3 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Encoding issue (with poedit)

Hi,

The problem is with latin chars

_e('Voici quelques liens pour vous aider Γ  dΓ©marrer', 'domain');

POT headers

"Project-Id-Version: some-project\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPathExcluded-0: *.js\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n\n"

I use Netbeans, so all source files are in utf-8 without BOM by default.

When I update the .po with the .pot poedit
poedit-error
poedit-error-results

Poedit error: Duplicate message definition

After generate the .POT file and open it with Poedit by selecting "Create new translation", the file won't be opened and returns following errors:

Mon Jul 18 03:24:07 2016: /var/folders/vj/mtrbj91j6hgdgcbcwkqn_51m0000gn/T/poeditLwzPFK/0ref.pot:534: duplicate message definition...
Mon Jul 18 03:24:07 2016: /var/folders/vj/mtrbj91j6hgdgcbcwkqn_51m0000gn/T/poeditLwzPFK/0ref.pot:311: ...this is the location of the first definition
Mon Jul 18 03:24:07 2016: msgmerge(2871,0x7fff785f0000) malloc: *** error for object 0x7fbef8414a20: pointer being freed was not allocated
Mon Jul 18 03:24:07 2016: *** set a breakpoint in malloc_error_break to debug

When I select "Edit a translation" it can be opened but I got notification that duplicated translation string found and Poedit automatically fixed that.

My Poedit version 1.8.8

constant as domain

How about constants as domain?

I'm usually: _x( 'text, 'context', PLUGIN_TEXTDOMAIN );

Instead of _x( 'text, 'context', 'plugin-textdomain' );

An in-range update of eslint is breaking the build 🚨

The devDependency eslint was updated from 5.15.3 to 5.16.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details

Release Notes for v5.16.0
  • dfef227 Build: gensite passes rulesMeta to formatter rendering (#11567) (Kevin Partington)
  • c06d38c Fix: Allow HTML formatter to handle no meta data (#11566) (Ilya Volodin)
  • 87a5c03 Docs: func-style: clarify when allowArrowFunctions is used (#11548) (Oliver Joseph Ash)
  • bc3e427 Update: pass rule meta to formatters RFC 10 (#11551) (Chris Meyer)
  • b452f27 Chore: Update README to pull in reviewer data (#11506) (Nicholas C. Zakas)
  • afe3d25 Upgrade: Bump js-yaml dependency to fix Denial of Service vulnerability (#11550) (Vernon de Goede)
  • 4fe7eb7 Chore: use nyc instead of istanbul (#11532) (Toru Nagashima)
  • f16af43 Chore: fix formatters/table test (#11534) (Toru Nagashima)
  • 78358a8 Docs: fix duplicate punctuation in CLI docs (#11528) (Teddy Katz)
Commits

The new version differs by 11 commits.

  • ded2f94 5.16.0
  • ea36e13 Build: changelog update for 5.16.0
  • dfef227 Build: gensite passes rulesMeta to formatter rendering (#11567)
  • c06d38c Fix: Allow HTML formatter to handle no meta data (#11566)
  • 87a5c03 Docs: func-style: clarify when allowArrowFunctions is used (#11548)
  • bc3e427 Update: pass rule meta to formatters RFC 10 (#11551)
  • b452f27 Chore: Update README to pull in reviewer data (#11506)
  • afe3d25 Upgrade: Bump js-yaml dependency to fix Denial of Service vulnerability (#11550)
  • 4fe7eb7 Chore: use nyc instead of istanbul (#11532)
  • f16af43 Chore: fix formatters/table test (#11534)
  • 78358a8 Docs: fix duplicate punctuation in CLI docs (#11528)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of eslint-plugin-standard is breaking the build 🚨

Version 2.2.0 of eslint-plugin-standard just got published.

Branch Build failing 🚨
Dependency eslint-plugin-standard
Current Version 2.1.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As eslint-plugin-standard is β€œonly” a devDependency of this project it might not break production or downstream projects, but β€œonly” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this πŸ’ͺ


Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build failed Details
Commits

The new version differs by 3 commits .

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Unable to parse php file

Hi @rasmusbe ,
Thanks for this cool plugin

Unfortunately i'm currently facing an issue with this plugin.
Whenever i run the gulp task, this error always shows up
TypeError: Cannot read property 'toLowerCase' of undefined | Unable to parse inc/class-tgm-plugin-activation.php

I'm using version ^2.3.2 of gulp-wp-pot
npm version 6.2.0
gulp CLI version 2.0.1, Local version 3.9.1

Here's the full error log

throw er; // Unhandled 'error' event
      ^
TypeError: Cannot read property 'toLowerCase' of undefined | Unable to parse inc/class-tgm-plugin-activation.php
    at parser.read_variable (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\variable.js:48:35)
    at parser.read_expr_item (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\expr.js:342:19)
    at parser.read_expr (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\expr.js:11:23)
    at parser.read_expr (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\expr.js:67:60)
    at parser.read_expr_item (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\expr.js:130:26)
    at parser.read_expr (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\expr.js:11:23)
    at parser.read_expr_item (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\expr.js:110:50)
    at parser.read_expr (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\expr.js:11:23)
    at parser.read_expr (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\expr.js:43:52)
    at parser.read_expr_item (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\expr.js:110:50)
    at parser.read_expr (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\expr.js:11:23)
    at parser.read_if_expr (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\if.js:57:25)
    at parser.read_if (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\if.js:22:24)
    at parser.read_statement (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\statement.js:201:21)
    at parser.read_inner_statement (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\statement.js:188:21)
    at parser.read_inner_statements (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\statement.js:88:30)
    at parser.read_code_block (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\statement.js:400:14)
    at parser.read_function (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\function.js:48:28)
    at parser.read_class_body (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\class.js:103:26)
    at parser.read_class (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\class.js:29:30)
    at parser.read_inner_statement (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\statement.js:170:21)
    at parser.read_inner_statements (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\statement.js:88:30)
    at parser.read_code_block (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\statement.js:400:14)
    at parser.read_statement (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\statement.js:198:21)
    at parser.read_if (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\if.js:43:19)
    at parser.read_statement (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\statement.js:201:21)
    at parser.read_top_statement (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\statement.js:76:21)
    at parser.read_start (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser\main.js:18:19)
    at parser.parse (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\parser.js:276:23)
    at engine.parseCode (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\node_modules\php-parser\src\index.js:167:22)
    at TranslationParser.parseFile (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\translation-parser.js:346:28)
    at wpPot (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\wp-pot\index.js:171:38)
    at DestroyableTransform._flush (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\gulp-wp-pot\index.js:51:27)
    at DestroyableTransform.prefinish (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\readable-stream\lib\_stream_transform.js:138:10)
    at emitNone (events.js:106:13)
    at DestroyableTransform.emit (events.js:208:7)
    at prefinish (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\readable-stream\lib\_stream_writable.js:619:14)
    at finishMaybe (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\readable-stream\lib\_stream_writable.js:627:5)
    at endWritable (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\readable-stream\lib\_stream_writable.js:638:3)
    at DestroyableTransform.Writable.end (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\readable-stream\lib\_stream_writable.js:594:41)
    at DestroyableTransform.onend (C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\vinyl-fs\node_modules\readable-stream\lib\_stream_readable.js:523:10)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)
    at DestroyableTransform.emit (events.js:208:7)
    at C:\DevProjects\wordpress-fresh\wp-content\themes\toba\node_modules\vinyl-fs\node_modules\readable-stream\lib\_stream_readable.js:965:16
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)

Finally, here's my gulp task

gulp.task( 'pot', function() {
    return gulp.src( './**/*.php' )
        .pipe( wpPot({
            domain: 'toba',
            package: 'Toba Theme'
        }) )
        .pipe( gulp.dest( './languages/toba.pot' ) );
});

Issue while upgrading to Gulp 4

I have a WordPress theme and I'm trying to update all the methods to Gulp 4.

Dependencies:

const autoprefixer = require('autoprefixer');
const babel = require('gulp-babel');
const bourbon = require( 'bourbon' ).includePaths;
const browserSync = require('browser-sync').create();
const concat = require('gulp-concat');
const cssnano = require('cssnano');
const fs = require('fs');
const gulp = require('gulp');
const imagemin = require('gulp-imagemin');
const packagejson = JSON.parse(fs.readFileSync('./package.json'));
const mqpacker = require( 'css-mqpacker' );
const plumber = require('gulp-plumber');
const postcss = require('gulp-postcss');
const rename = require('gulp-rename');
const sass = require('gulp-sass');
const sassGlob = require('gulp-sass-glob');
const sort = require( 'gulp-sort' );
const sourcemaps = require('gulp-sourcemaps');
const svgmin = require( 'gulp-svgmin' );
const uglify = require('gulp-uglify');
const wpPot = require('wp-pot');

Config:

const config = {
  styles: {
    front_end: 'assets/sass/*.scss',
    main: 'sass/**/*.scss',
    srcDir: 'assets/sass',
    front_end_dest: 'assets/css',
    main_dest: './'
  },
  scripts: {
    main: './assets/js/src/**/*.js',
    uglify: [ 'assets/js/*.js', '!assets/js/*.min.js', '!assets/js/customizer.js' ],
    dest: './assets/js'
  },
  images: {
  	main: './assets/img/**/*',
  	dest: './assets/img/'
  },
  languages: {
    src: [ './*.php', '!vendor/**/*.php' ],
    dest: './languages/'
  },
  browserSync: {
    active: false,
    localURL: 'mylocalsite.local'
  }
};

I've tried various things for config.languages.src ranging from what is there currently to just functions.php but that value doesn't appear to change the result.

Then the translation method:

function translation() {
    return gulp.src(config.languages.src)
      .pipe(plumber())
      .pipe(sort())
      .pipe(wpPot( {
        domain: packagejson.name,
        package: packagejson.name,
      } ) )
      .pipe(gulp.dest(config.languages.dest));
}

I've tried to add the method both of these ways:

exports.translation    = translation;
gulp.task('translation', translation);

When I run gulp translation, I get the following:

[14:25:45] Using gulpfile ~/wp-content/themes/minnpost-largo/gulpfile.js
[14:25:45] Starting 'translation'...
[14:25:47] 'translation' errored after 2.37 s
[14:25:47] TypeError: dest.on is not a function
    at DestroyableTransform.Readable.pipe (/wp-content/themes/minnpost-largo/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:564:8)
    at DestroyableTransform.pipe2 (/wp-content/themes/minnpost-largo/node_modules/gulp-plumber/index.js:72:14)
    at translation (/wp-content/themes/minnpost-largo/gulpfile.js:213:8)
    at taskWrapper (/wp-content/themes/minnpost-largo/node_modules/undertaker/lib/set-task.js:13:15)
    at bound (domain.js:425:14)
    at runBound (domain.js:438:12)
    at asyncRunner (/wp-content/themes/minnpost-largo/node_modules/async-done/index.js:55:18)
    at processTicksAndRejections (internal/process/task_queues.js:79:9)

Can you point me in a direction here?

Parse errors throw exception instead of emitting error

I am using gulp-wp-pot in a watch task, but the task crashes when wp-pot fails to parse a file.

[09:31:51] Starting 'pot'...
/Users/stefanfisk/Projects/berghs/berghs.se/repo/node_modules/wp-pot/translation-parser.js:325
        throw e;
        ^

SyntaxError: Parse Error : syntax error, expecting T_ENDIF on line 530 | Unable to parse page-application.php
    at parser.raiseError (/Users/stefanfisk/Projects/berghs/berghs.se/repo/node_modules/php-parser/src/parser.js:261:15)
    at parser.error (/Users/stefanfisk/Projects/berghs/berghs.se/repo/node_modules/php-parser/src/parser.js:301:15)
    at parser.expect (/Users/stefanfisk/Projects/berghs/berghs.se/repo/node_modules/php-parser/src/parser.js:386:10)
    at parser.read_if (/Users/stefanfisk/Projects/berghs/berghs.se/repo/node_modules/php-parser/src/parser/if.js:39:12)
    at parser.read_statement (/Users/stefanfisk/Projects/berghs/berghs.se/repo/node_modules/php-parser/src/parser/statement.js:194:46)
    at parser.read_top_statement (/Users/stefanfisk/Projects/berghs/berghs.se/repo/node_modules/php-parser/src/parser/statement.js:74:21)
    at parser.read_start (/Users/stefanfisk/Projects/berghs/berghs.se/repo/node_modules/php-parser/src/parser/main.js:17:19)
    at parser.parse (/Users/stefanfisk/Projects/berghs/berghs.se/repo/node_modules/php-parser/src/parser.js:243:21)
    at engine.parseCode (/Users/stefanfisk/Projects/berghs/berghs.se/repo/node_modules/php-parser/src/index.js:168:22)
    at TranslationParser.parseFile (/Users/stefanfisk/Projects/berghs/berghs.se/repo/node_modules/wp-pot/translation-parser.js:321:28)

2.0 breaks compatibility with Twig files

Hello and thank you for your great plugin!
Unfortunately with the rewrite onto 2.0 it does not work anymore for twig files.
We are using Timber in our themes and this plugin was great in combination with it.

In our newest base theme we gave up on gulp and went straight to npm trying out https://github.com/rasmusbe/wp-pot and out of a sudden it would not find any strings in twig files anymore :(

Could you please have a look? Would be wonderful to get the functionality back as there isn't really any alternative available.

Keep up the great work!

Memory issue

Out of nowhere started seeing memory issues when wpPot runs...

<--- Last few GCs --->

[46760:0x108008000] 20658 ms: Scavenge 1393.8 (1424.6) -> 1393.5 (1425.6) MB, 2.6 / 0.0 ms (average mu = 0.114, current mu = 0.037) allocation failure
[46760:0x108008000] 21347 ms: Mark-sweep 1394.1 (1425.6) -> 1393.8 (1424.6) MB, 687.6 / 0.0 ms (average mu = 0.070, current mu = 0.021) allocation failure scavenge might not succeed
[46760:0x108008000] 21356 ms: Scavenge 1394.4 (1424.6) -> 1394.1 (1425.6) MB, 4.6 / 0.0 ms (average mu = 0.070, current mu = 0.021) allocation failure

<--- JS stacktrace --->

==== JS stack trace =========================================

0: ExitFrame [pc: 0x3a3f28fdbe3d]

Security context: 0x018cd549e6e9
1: makeAbs [0x18c09045421] [/Users/bartdabek/Sites/www/lawtons.test/wp-content/themes/lawtons/node_modules/glob/common.js:~203] [pc=0x3a3f290504a3](this=0x018cabf8c8f9 ,self=0x018cec3ec591 ,f=0x018cf0752919 <String[160]: /Users/bartdabek/Sites/www/lawtons.test/wp-content/themes/lawtons/../../plugins/s...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0x10096d6b6 node::Abort() (.cold.1) [/usr/local/opt/node@10/bin/node]
2: 0x10003b8d0 node_module_register [/usr/local/opt/node@10/bin/node]
3: 0x10003ba91 node::OnFatalError(char const*, char const*) [/usr/local/opt/node@10/bin/node]
4: 0x100178d87 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/opt/node@10/bin/node]
5: 0x100178d29 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/opt/node@10/bin/node]
6: 0x10042d29c v8::internal::Heap::UpdateSurvivalStatistics(int) [/usr/local/opt/node@10/bin/node]
7: 0x10042eed9 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [/usr/local/opt/node@10/bin/node]
8: 0x10042c576 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/opt/node@10/bin/node]
9: 0x10042b387 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/opt/node@10/bin/node]
10: 0x1004339ae v8::internal::Heap::AllocateRawWithLigthRetry(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/local/opt/node@10/bin/node]
11: 0x1004339f8 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/local/opt/node@10/bin/node]
12: 0x10041404f v8::internal::Factory::AllocateRawWithImmortalMap(int, v8::internal::PretenureFlag, v8::internal::Map*, v8::internal::AllocationAlignment) [/usr/local/opt/node@10/bin/node]
13: 0x100415b6e v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [/usr/local/opt/node@10/bin/node]
14: 0x1004ef2ce v8::internal::String::SlowFlatten(v8::internal::Handlev8::internal::ConsString, v8::internal::PretenureFlag) [/usr/local/opt/node@10/bin/node]
15: 0x1006345a2 v8::internal::Runtime_StringCharCodeAt(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/opt/node@10/bin/node]
16: 0x3a3f28fdbe3d
17: 0x3a3f290504a3
[1] 46760 abort gulp

No idea what's going on my system hasn't changed... nothing was upgraded yet this is now failing.

text.replace is not a function

Full Log:

[12:46:31] Starting 'generate_pot'...
/Users/joelworsham/Sites/www/wordpress-develop/public_html/src/wp-content/plugins/learndash-gradebook/node_modules/wp-pot/index.js:361
  text = text.replace(/\\([\s\S])|(")/g, '\\$1$2');
              ^

TypeError: text.replace is not a function
    at escapeQuotes (/Users/joelworsham/Sites/www/wordpress-develop/public_html/src/wp-content/plugins/learndash-gradebook/node_modules/wp-pot/index.js:361:15)
    at getPotMsgId (/Users/joelworsham/Sites/www/wordpress-develop/public_html/src/wp-content/plugins/learndash-gradebook/node_modules/wp-pot/index.js:378:13)
    at translationToPot (/Users/joelworsham/Sites/www/wordpress-develop/public_html/src/wp-content/plugins/learndash-gradebook/node_modules/wp-pot/index.js:434:32)
    at generatePot (/Users/joelworsham/Sites/www/wordpress-develop/public_html/src/wp-content/plugins/learndash-gradebook/node_modules/wp-pot/index.js:475:28)
    at wpPot (/Users/joelworsham/Sites/www/wordpress-develop/public_html/src/wp-content/plugins/learndash-gradebook/node_modules/wp-pot/index.js:514:23)
    at DestroyableTransform._flush (/Users/joelworsham/Sites/www/wordpress-develop/public_html/src/wp-content/plugins/learndash-gradebook/node_modules/gulp-wp-pot/index.js:51:25)
    at DestroyableTransform.<anonymous> (/Users/joelworsham/Sites/www/wordpress-develop/public_html/src/wp-content/plugins/learndash-gradebook/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:115:49)
    at DestroyableTransform.g (events.js:260:16)
    at emitNone (events.js:67:13)
    at DestroyableTransform.emit (events.js:166:7)

Process finished with exit code 1

Hi author.

Could you please update required wp-pot version to latest one.
Right now it is set to "^1,3,3"

But you updated the version of wp-pot to 1,3,4.

Please see this closed issue.

Thanks for your hard work.

Not picking up translations used inside filters

It looks like gulp-wp-pot is not picking up translations inside (some?) filters or functions.

I have two local sites. Site 1 is running gulp-wp-pot 2.3.6 and site 2 is 2.4.0. They're using the exact same gulp file, packages, theme and structure except all packages are up to date on site 2.

Site 1, running gulp-wp-pot 2.3.6 , is correctly picking up translations inside this function from mytheme/woocommerce/checkout/form-coupon.php:

<?php wc_print_notice( apply_filters( 'woocommerce_checkout_coupon_message', esc_html__( 'Have a gift card?', 'sg-one' ) . ' <a href="#" class="showcoupon">' . esc_html__( 'Click here to use your gift card', 'sg-one' ) . '</a>' ), 'notice' ); ?>

This function is the same as the WooCommerce core function - i just replaced the translatable strings and translation domain.

The exact same translations are however not generated for site 2, running gulp-wp-pot 2.4.0.

This simple string is also in the same template file:

<p><?php esc_html_e( 'If you have a gift card code, please apply it below.', 'sg-one' ); ?></p>.

Both versions generate this string just fine. That's why I suspect that there is some bug with functions/filters.

These are my dev dependencies:

"devDependencies": {
    "browser-sync": "^2.26.7",
    "gulp": "^4.0.2",
    "gulp-autoprefixer": "^7.0.1",
    "gulp-concat": "^2.6.1",
    "gulp-ext-replace": "^0.3.0",
    "gulp-imagemin": "^7.1.0",
    "gulp-sass": "^4.0.2",
    "gulp-sort": "^2.0.0",
    "gulp-sourcemaps": "^2.6.5",
    "gulp-uglify": "^3.0.2",
    "gulp-wp-pot": "^2.4.0",
    "gulp-zip": "^5.0.1",
    "imagemin-mozjpeg": "^8.0.0",
    "imagemin-webp": "^5.1.0",
    "merge-stream": "^2.0.0",
    "pump": "^3.0.0"
}

This is my gulp task:

gulp.task('translate', function() {
	return gulp.src(themeDir + '**/*.php')
		.pipe(sort())
		.pipe(wpPot({
			domain        : 'sg-one',
			package       : 'SG One'
		}))
	.pipe(gulp.dest(themeDir + 'languages/en_GB.pot'))
});

I'm still having the issue without .pipe(sort()).

Not finding any translations

Hi, I have a pretty basic project setup.

Gulp version 3.9.1
Node version 6.5.0

src/
dist/
gulpfile.js

using the sample task
gulp.task('pot', function () {
return gulp.src('src/*.php')
.pipe(sort())
.pipe(wpPot( {
domain: 'XXXX',
destFile:'file.pot',
package: 'XXXX',
bugReport: 'http://example.com',
lastTranslator: 'John Doe <[email protected]>',
team: 'Team Team <[email protected]>'
} ))
.pipe(gulp.dest('dist'));
});

It generates the file.pot but it's empty of translations

`# Copyright (C) 2016 XXXX

This file is distributed under the same license as the XXXX package.

msgid ""
msgstr ""
"Project-Id-Version: XXXX\n"
"Report-Msgid-Bugs-To: http://example.com\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2016-MO-DA HO:MI+ZONE\n"
"Last-Translator: John Doe [email protected]\n"
"Language-Team: Team Team [email protected]\n"
"X-Poedit-Basepath: ..\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-KeywordsList: ;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
"X-Poedit-SearchPath-0: .\n"
"X-Poedit-SearchPathExcluded-0: *.js\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"`

I've used poedit to open the file and it finds no translations. it'll then search the directory and populate the file.

is there an incompatibility with the newer node/gulp version?

An in-range update of eslint-plugin-node is breaking the build 🚨

Version 7.0.1 of eslint-plugin-node was just published.

Branch Build failing 🚨
Dependency eslint-plugin-node
Current Version 7.0.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

eslint-plugin-node is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • ❌ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Release Notes v7.0.1

Bug fixes

  • It fixed false positive that the node/no-unsupported-features/node-builtins reports the process.emitWarning method on Node.js >=6 <8. It was supported since Node.js 6.0.0.
Commits

The new version differs by 3 commits.

  • a4a7ad2 7.0.1
  • 44b57ed Fix: false positive 'no-unsupported-features/node-builtins'
  • cde4c82 Docs: update README.md

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.