Skip to content

Commit

Permalink
Make sure Admin / Block Editor script translations are loaded (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
imath authored Jan 13, 2025
1 parent 9263d27 commit a157f86
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions includes/Assets.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ private function enqueue_script( string $name, array $params = [], array $depend
true
);

wp_set_script_translations( "autoblue-{$name}-plugin-script", 'autoblue' );

if ( ! empty( $params ) && ! $autoblue_defined ) {
wp_add_inline_script( "autoblue-{$name}-plugin-script", 'const autoblue = ' . wp_json_encode( $params ), 'before' );
$autoblue_defined = true;
Expand Down

0 comments on commit a157f86

Please sign in to comment.