Skip to content

Commit 4372117

Browse files
authored
Merge pull request #187 from thrijith/feature/add-textdomain-js-block
Add textdomain to block js strings and Update test accordingly
2 parents 0ca5ec4 + 9c69025 commit 4372117

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

features/scaffold-block.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,19 @@ Feature: WordPress block code scaffolding
6565
"""
6666
And the {PLUGIN_DIR}/blocks/the-green-mile/index.js file should contain:
6767
"""
68-
title: __( 'The green mile' ),
68+
title: __( 'The green mile', 'movies' ),
6969
"""
7070
And the {PLUGIN_DIR}/blocks/the-green-mile/index.js file should contain:
7171
"""
7272
category: 'widgets',
7373
"""
7474
And the {PLUGIN_DIR}/blocks/the-green-mile/index.js file should contain:
7575
"""
76-
__( 'Hello from the editor!' )
76+
__( 'Hello from the editor!', 'movies' )
7777
"""
7878
And the {PLUGIN_DIR}/blocks/the-green-mile/index.js file should contain:
7979
"""
80-
__( 'Hello from the saved content!' )
80+
__( 'Hello from the saved content!', 'movies' )
8181
"""
8282
And the {PLUGIN_DIR}/blocks/the-green-mile/editor.css file should exist
8383
And the {PLUGIN_DIR}/blocks/the-green-mile/editor.css file should contain:
@@ -98,7 +98,7 @@ Feature: WordPress block code scaffolding
9898
When I run `wp scaffold block shawshank-redemption --plugin=movies --title="The Shawshank Redemption"`
9999
Then the {PLUGIN_DIR}/blocks/shawshank-redemption/index.js file should contain:
100100
"""
101-
title: __( 'The Shawshank Redemption' ),
101+
title: __( 'The Shawshank Redemption', 'movies' ),
102102
"""
103103
And STDOUT should be:
104104
"""

templates/block-index-js.mustache

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* This is the display title for your block, which can be translated with `i18n` functions.
2525
* The block inserter will show this name.
2626
*/
27-
title: __( '{{title_ucfirst_js}}' ),
27+
title: __( '{{title_ucfirst_js}}', '{{namespace}}' ),
2828
2929
{{#dashicon}}
3030
/**
@@ -60,7 +60,7 @@
6060
return el(
6161
'p',
6262
{ className: props.className },
63-
__( 'Hello from the editor!' )
63+
__( 'Hello from the editor!', '{{namespace}}' )
6464
);
6565
},
6666

@@ -75,7 +75,7 @@
7575
return el(
7676
'p',
7777
{},
78-
__( 'Hello from the saved content!' )
78+
__( 'Hello from the saved content!', '{{namespace}}' )
7979
);
8080
}
8181
} );

0 commit comments

Comments
 (0)