[wp-trac] [WordPress Trac] #54797: Allow languages path in register_block_type
WordPress Trac
noreply at wordpress.org
Tue Jun 17 09:41:18 UTC 2025
#54797: Allow languages path in register_block_type
------------------------------------------+-----------------------------
Reporter: Rahe | Owner: gziolo
Type: enhancement | Status: assigned
Priority: normal | Milestone: Future Release
Component: I18N | Version: 5.5
Severity: normal | Resolution:
Keywords: needs-unit-tests needs-patch | Focuses:
------------------------------------------+-----------------------------
Changes (by swissspidy):
* keywords: has-patch needs-refresh needs-unit-tests => needs-unit-tests
needs-patch
Comment:
Replying to [comment:30 swissspidy]:
> > > An alernative to consider is to detect whether a script is
registered inside a plugin (vs core block) and pass the custom path based
on the setting read from the domain path set in the plugin metadata. More
about that in https://developer.wordpress.org/plugins/internationalization
/how-to-internationalize-your-plugin/#domain-path.
> >
> > It might be challenging to read the domain path provided in the
plugin's metadata because `get_plugin_data()` is defined only in the admin
but not on the frontend.
>
> We should be able to move the function. That would be useful for #62244
as well.
>
> I don't like duplicating `Domain Path` in `block.json`, just adds
redundancy.
We didn't end up moving the function in #62244 due to back compat, but
it's now loaded pretty early, see https://github.com/WordPress/wordpress-
develop/blob/3410c205da5564cdb44bd9110c3b27f294583cf0/src/wp-
settings.php#L526-L527
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54797#comment:32>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list