diff --git a/src/ui/asset-manager.php b/src/ui/asset-manager.php index 38e930b4..8aa4965d 100644 --- a/src/ui/asset-manager.php +++ b/src/ui/asset-manager.php @@ -48,6 +48,7 @@ public function register_scripts() { \DUPLICATE_POST_CURRENT_VERSION, true ); + \wp_set_script_translations( 'duplicate_post_edit_script', 'duplicate-post' ); \wp_register_script( 'duplicate_post_strings', @@ -60,6 +61,7 @@ public function register_scripts() { \DUPLICATE_POST_CURRENT_VERSION, true ); + \wp_set_script_translations( 'duplicate_post_strings', 'duplicate-post' ); \wp_register_script( 'duplicate_post_quick_edit_script', diff --git a/tests/Unit/UI/Asset_Manager_Test.php b/tests/Unit/UI/Asset_Manager_Test.php index cf8869c0..77a8e365 100644 --- a/tests/Unit/UI/Asset_Manager_Test.php +++ b/tests/Unit/UI/Asset_Manager_Test.php @@ -114,6 +114,11 @@ public function test_register_scripts() { \DUPLICATE_POST_CURRENT_VERSION, true ); + Monkey\Functions\expect( '\wp_set_script_translations' ) + ->with( + 'duplicate_post_edit_script', + 'duplicate-post' + ); Monkey\Functions\expect( '\wp_register_script' ) ->with( @@ -127,6 +132,11 @@ public function test_register_scripts() { \DUPLICATE_POST_CURRENT_VERSION, true ); + Monkey\Functions\expect( '\wp_set_script_translations' ) + ->with( + 'duplicate_post_strings', + 'duplicate-post' + ); Monkey\Functions\expect( '\wp_register_script' ) ->with(