gregsullivan / _tw

The _tw generator creates a WordPress starter theme optimized for modern development with Tailwind CSS, Tailwind Typography and the WordPress editor.
https://underscoretw.com
GNU General Public License v2.0
486 stars 28 forks source link

use wp-i18n to translate strings. #118

Open esradev opened 6 days ago

esradev commented 6 days ago

How I can use @wordpress/i18n package to make the theme strings used on javascript part ready for traslation and use wp-i18n command tool to generate .pot update .po and make .mo and .json files for that.

I alreadey have setup my project and the wp-i18n commands will work with the bundled file that generated by wp-scripts, but when I use ESbuild to bundle js files, the wp-i18n commands not detect any string to translate.

gregsullivan commented 6 days ago

Hello—Thanks for posting this!

Off the top of my head, I think it could be an issue with esbuild needing a bit of additional work to recognize the @wordpress/i18n package. This blog post has some thoughts as far as that goes.

Are you able to share your repository? It's difficult to say anything definitive without seeing how you've set up the JavaScript side of things.