wp-cli / i18n-command

Provides internationalization tools for WordPress projects.
MIT License
96 stars 52 forks source link

make-pot: Add TypeScript support #364

Closed retlehs closed 1 year ago

retlehs commented 1 year ago

This PR updates the make-pot command to support scanning files that end with .ts and .tsx to support TypeScript

swissspidy commented 1 year ago

Thanks for raising this, but unfortunately it doesn‘t work like that. To support TypeScript files we need a parser that supports TS, and ours doesn‘t. And I‘m not aware of another JS/TS parser in PHP, especially since there is no proper TS spec anyway that could be implemented.

Adding TS support not only means having such a parser, but also tests as well.

See #176 where this was suggested before.

Out of curiosity, why do you need this? The make-pot command has been developed for using it on built JS files that run in the browser

retlehs commented 1 year ago

The make-pot command has been developed for using it on built JS files that run in the browser

This makes sense :+1: I'm used to running the make-pot command on a directory with pre-built JS files, but it's not a problem to run it on the compiled files instead