[wp-trac] [WordPress Trac] #45488: wp_set_script_translations does not load md5-based PO files

WordPress Trac noreply at wordpress.org
Wed Dec 5 17:16:40 UTC 2018


#45488: wp_set_script_translations does not load md5-based PO files
-------------------------------------+---------------------
 Reporter:  ettoredn                 |       Owner:  (none)
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  5.0.1
Component:  I18N                     |     Version:  5.0
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+---------------------

Comment (by ettoredn):

 I manually applied your patch to the source code (don't ask), and
 load_script_textdomain() keeps returning false because
 {{{#!php
 <?php
 $md5_filename = false
 }}}

 because of

 {{{#!php
 <?php
 $relative = false
 }}}

 I believe my previous comment describes why $relative is wrongful false.

 Even if we fix that, we still get
 {{{#!php
 <?php
 $relative = "themes/<mytheme>/js/myscript.js";
 $md5_filename = $file_base . '-' . md5( $relative ) . '.json' =
 "<domain>-<lang>-<md5($relative);
 }}}
 and, of course,

 {{{
 md5("themes/<mytheme>/js/myscript.js") != md5(<relative path in PO file
 used by wp-cli>).
 }}}

 There seems to be an underlying interop problem between WP and wp-cli.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45488#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list