wp-pot / gulp-wp-pot

Gulp plugin to generate pot file for WordPress plugins and themes
https://www.npmjs.com/package/gulp-wp-pot
MIT License
70 stars 9 forks source link

text.replace is not a function #39

Closed joelworsham closed 7 years ago

joelworsham commented 7 years ago

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
joelworsham commented 7 years ago

Issue was on my end. I was interpolating a var into the string to be translated, rather than using sprintf().