Skip to content

Commit a083c7e

Browse files
Infinite-NullInfinite-Nullgziolomichakrapp
authored
Create Block: Add --textdomain flag to create block tool (#69802)
* feat: add --textdomain option for internationalization support * Add changelog entry Co-authored-by: Infinite-Null <[email protected]> Co-authored-by: gziolo <[email protected]> Co-authored-by: michakrapp <[email protected]>
1 parent ea80bab commit a083c7e

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

packages/create-block/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Enhancement
6+
7+
- Add support for `--textdomain` flag to create block tool ([#69802](https://github.com/WordPress/gutenberg/pull/69802)).
8+
59
## 4.65.0 (2025-04-11)
610

711
## 4.64.0 (2025-03-27)

packages/create-block/lib/index.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ program
6363
'disable integration with `@wordpress/scripts` package'
6464
)
6565
.option( '--wp-env', 'enable integration with `@wordpress/env` package' )
66+
.option( '--textdomain <value>', 'text domain for internationalization' )
6667
.action(
6768
async (
6869
slug,
@@ -77,6 +78,7 @@ program
7778
wpEnv,
7879
variant,
7980
targetDir,
81+
textdomain,
8082
}
8183
) => {
8284
try {
@@ -110,6 +112,7 @@ program
110112
wpScripts,
111113
wpEnv,
112114
targetDir,
115+
textdomain,
113116
} ).filter( ( [ , value ] ) => value !== undefined )
114117
);
115118

@@ -158,7 +161,7 @@ program
158161
'description',
159162
'dashicon',
160163
'category',
161-
! plugin && 'textdomain',
164+
! plugin && ! textdomain && 'textdomain',
162165
].filter( Boolean ),
163166
variant,
164167
optionsValues
@@ -216,5 +219,8 @@ program
216219
log.info(
217220
` $ ${ commandName } todo-list --template es5 --title "TODO List"`
218221
);
222+
log.info(
223+
` $ ${ commandName } todo-list --no-plugin --textdomain=my-plugin`
224+
);
219225
} )
220226
.parse( process.argv );

0 commit comments

Comments
 (0)