Skip to content

Commit

Permalink
Merge pull request #234 from petitphp/fix/missing-editor-script-trans…
Browse files Browse the repository at this point in the history
…lations

Fix/missing editor script translations
  • Loading branch information
enricobattocchi authored Mar 15, 2024
2 parents e4af6fb + 9e816b2 commit bf33f90
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ui/asset-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
Expand Down
10 changes: 10 additions & 0 deletions tests/Unit/UI/Asset_Manager_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down

0 comments on commit bf33f90

Please sign in to comment.