Skip to content

Commit

Permalink
Merge pull request #187 from thrijith/feature/add-textdomain-js-block
Browse files Browse the repository at this point in the history
Add textdomain to block js strings and Update test accordingly
  • Loading branch information
schlessera authored Nov 9, 2018
2 parents 0ca5ec4 + 9c69025 commit 4372117
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions features/scaffold-block.feature
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@ Feature: WordPress block code scaffolding
"""
And the {PLUGIN_DIR}/blocks/the-green-mile/index.js file should contain:
"""
title: __( 'The green mile' ),
title: __( 'The green mile', 'movies' ),
"""
And the {PLUGIN_DIR}/blocks/the-green-mile/index.js file should contain:
"""
category: 'widgets',
"""
And the {PLUGIN_DIR}/blocks/the-green-mile/index.js file should contain:
"""
__( 'Hello from the editor!' )
__( 'Hello from the editor!', 'movies' )
"""
And the {PLUGIN_DIR}/blocks/the-green-mile/index.js file should contain:
"""
__( 'Hello from the saved content!' )
__( 'Hello from the saved content!', 'movies' )
"""
And the {PLUGIN_DIR}/blocks/the-green-mile/editor.css file should exist
And the {PLUGIN_DIR}/blocks/the-green-mile/editor.css file should contain:
Expand All @@ -98,7 +98,7 @@ Feature: WordPress block code scaffolding
When I run `wp scaffold block shawshank-redemption --plugin=movies --title="The Shawshank Redemption"`
Then the {PLUGIN_DIR}/blocks/shawshank-redemption/index.js file should contain:
"""
title: __( 'The Shawshank Redemption' ),
title: __( 'The Shawshank Redemption', 'movies' ),
"""
And STDOUT should be:
"""
Expand Down
6 changes: 3 additions & 3 deletions templates/block-index-js.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* This is the display title for your block, which can be translated with `i18n` functions.
* The block inserter will show this name.
*/
title: __( '{{title_ucfirst_js}}' ),
title: __( '{{title_ucfirst_js}}', '{{namespace}}' ),
{{#dashicon}}
/**
Expand Down Expand Up @@ -60,7 +60,7 @@
return el(
'p',
{ className: props.className },
__( 'Hello from the editor!' )
__( 'Hello from the editor!', '{{namespace}}' )
);
},

Expand All @@ -75,7 +75,7 @@
return el(
'p',
{},
__( 'Hello from the saved content!' )
__( 'Hello from the saved content!', '{{namespace}}' )
);
}
} );
Expand Down

0 comments on commit 4372117

Please sign in to comment.