fix: le traduzioni non finiscono piu' nel pacchetto, se le genera wordpress.org da translate.wordpress.org
This commit is contained in:
parent
fbae03e4f3
commit
9811e3b0c4
6 changed files with 14 additions and 184 deletions
|
|
@ -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' );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue