#52301 closed enhancement (fixed)
Blocks: Add i18n support to register_block_type_from_metadata
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.7 | Priority: | normal |
Severity: | normal | Version: | 5.7 |
Component: | Editor | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description (last modified by )
Related issue in Gutenberg: https://github.com/WordPress/gutenberg/issues/23636.
Related PR in WP-CLI from @swissspidy: https://github.com/wp-cli/i18n-command/pull/210.
Description
There are some issues related to internationalization (i18n) support in the introduced block.json
metadata files that still need to be resolved.
There is a proposal in block registration document that we still need to implement:
https://github.com/WordPress/gutenberg/blob/master/docs/designers-developers/developers/block-api/block-metadata.md#internationalization-not-implemented
The good news is that WP-CLI has implemented (https://github.com/wp-cli/i18n-command/pull/210) native support for translatable strings extraction from block.json
file in i18n
command. It was based on the aforementioned document.
Code
Change History (11)
This ticket was mentioned in PR #868 on WordPress/wordpress-develop by gziolo.
4 years ago
#1
lukecarbis commented on PR #868:
4 years ago
#3
This PR will need eyes from the documentation team.
#4
@
4 years ago
- Owner set to gziolo
- Resolution set to fixed
- Status changed from new to closed
In 49981:
hellofromtonya commented on PR #868:
4 years ago
#7
Merged in changeset https://core.trac.wordpress.org/changeset/49981 and https://core.trac.wordpress.org/changeset/49982
ZebulanStanphill commented on PR #868:
4 years ago
#8
Shouldn't textdomain
be textDomain
to match the camelCase already being used for editorScript
and editorStyle
?
4 years ago
#9
@ZebulanStanphill, I know it's confusing. In the written language it's two words so you would expect text_domain
in PHP and textDomain
in JavaScript, but in practice, it' was mostly textdomain
in PHP codebase so followed it. Related docs:
- https://github.com/WordPress/gutenberg/blob/master/docs/designers-developers/developers/block-api/block-metadata.md#text-domain
- https://developer.wordpress.org/plugins/internationalization/how-to-internationalize-your-plugin/#text-domains
- https://developer.wordpress.org/reference/functions/load_plugin_textdomain/
#10
@
4 years ago
Related documentation changes in Gutenberg: https://github.com/WordPress/gutenberg/pull/29023.
Trac ticket: https://core.trac.wordpress.org/ticket/52301
Related issue in Gutenberg: https://github.com/WordPress/gutenberg/issues/23636.
Related PR in WP-CLI from @swissspidy: https://github.com/wp-cli/i18n-command/pull/210.
## Description
There are some issues related to internationalization (i18n) support in the introduced
block.json
metadata files that still need to be resolved.There is a proposal in block registration document that we still need to implement:
https://github.com/WordPress/gutenberg/blob/master/docs/designers-developers/developers/block-api/block-metadata.md#internationalization-not-implemented
The good news is that WP-CLI has implemented (https://github.com/wp-cli/i18n-command/pull/210) native support for translatable strings extraction from
block.json
file ini18n
command. It was based on the aforementioned document.