fix: le traduzioni non finiscono piu' nel pacchetto, se le genera wordpress.org da translate.wordpress.org

This commit is contained in:
Lorenzo Iovino 2026-09-07 10:55:00 +02:00
parent fbae03e4f3
commit 9811e3b0c4
6 changed files with 14 additions and 184 deletions

View file

@ -21,11 +21,14 @@ function pinfesta_register_block() {
);
// The editor strings live in JavaScript, so they need their own JSON
// catalogue. The handle is read back from the registered block instead of
// being guessed: WordPress builds it from block.json and it can change.
// catalogue: wordpress.org builds it from translate.wordpress.org and drops
// it in the languages folder of the site, which is where WordPress looks
// when no path is passed. The handle is read back from the registered block
// instead of being guessed: WordPress builds it from block.json and it can
// change.
if ( $type && ! empty( $type->editor_script_handles ) ) {
foreach ( $type->editor_script_handles as $handle ) {
wp_set_script_translations( $handle, 'piazza-in-festa', PINFESTA_DIR . 'languages' );
wp_set_script_translations( $handle, 'piazza-in-festa' );
}
}
}