WP-scripts: Add command to create Jed-compatible JSON files #42774
Paulsky
started this conversation in
Developer Experience
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would like a command to generate json files from po files in my language directory. For example:
wp-scripts i18n-make-json
.This function was added in wp-cli: wp-cli/i18n-command#108
I'm not using the wp-cli in my current project. If I would like to generate Jed-compatible JSON files, I have to setup wp-cli only for this purpose, or install some (outdated) npm package like
po2json
(which only takes single files, not directories, and doesn't generate the recommanded file names:See: https://developer.wordpress.org/block-editor/how-to-guides/internationalization/#load-translation-file
By the way, I think people (including myself) finding this way of setting the script translations really confusting, cumbersome, buggy: https://wordpress.stackexchange.com/questions/407346/using-wp-set-script-translations-without-manually-registering-the-script
I have 3 locales and 2 script entry points. So I have to make:
Beta Was this translation helpful? Give feedback.
All reactions