[wp-trac] [WordPress Trac] #54797: Allow languages path in register_block_type

WordPress Trac noreply at wordpress.org
Wed Jan 12 11:48:12 UTC 2022


#54797: Allow languages path in register_block_type
-----------------------------+-----------------------------
 Reporter:  Rahe             |      Owner:  (none)
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  I18N             |    Version:  trunk
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 Hello,

 On `register_block_type` and block.json right now the languages folder
 path is not handled.
 This calls the `register_block_script_handle` function that just do :

 {{{#!php
 <?php
         if ( ! empty( $metadata['textdomain'] ) && in_array( 'wp-i18n',
 $script_dependencies, true ) ) {
                 wp_set_script_translations( $script_handle,
 $metadata['textdomain'] );
         }

 }}}

 Since it's pretty common to change where the languages are stored into a
 folder, I think we need to :
 * Add to the block.json an entry to specify the languages folder
 * Impact this part of code and add maybe add filters


 Nicolas,

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54797>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list