Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add textdomain to block strings and update tests accordingly #187

Merged
merged 1 commit into from
Nov 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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