Pass the correct script handle for translations#120
Conversation
…ations() rather than the block name.
|
The blocks are designed to be released individually, not as a 'block-experiments' bundle, and they must be packaged with the included script. This will ensure that the current |
|
You've misunderstood the PR. The build process is not changing the first parameter to This PR changes that parameter to the |
|
Alright, the reason for my confusion is that I had already added the correct translation call: https://github.com/Automattic/block-experiments/blob/master/bundler/template/index.php#L44 But it was added somewhere else, and apparently without realising that there was an existing (incorrect) translation call added in #39. My change was unreleased so doesn't yet appear on wp.org. I'll remove the one I added and go with the one here. |
Fix translations by passing the script handle to wp_set_script_translations() rather than the block name.
In testing the Block Directory in non-english, I ran into these blocks not loading translations. Turned out it's passing the block slug rather than the script to localise.