[wp-trac] [WordPress Trac] #45528: load_script_textdomain() doesn't load translations when WP installed in a subdirectory with custom content dir

WordPress Trac noreply at wordpress.org
Sat Dec 8 11:37:55 UTC 2018


#45528: load_script_textdomain() doesn't load translations when WP installed in a
subdirectory with custom content dir
-------------------------------------------------+-------------------------
 Reporter:  fierevere                            |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  5.0.1
Component:  I18N                                 |     Version:  5.0
 Severity:  normal                               |  Resolution:
 Keywords:  has-screenshots needs-unit-tests     |     Focuses:
  has-patch                                      |
-------------------------------------------------+-------------------------

Comment (by tmatsuur):

 Replying to [comment:14 fierevere]:
 > Its not plugin/theme, new core editor (block editor/gutenberg) is using
 json translations too.
 > They are not loaded with custom WP_CONTENT_DIR
 >
 > This issue can affect themes/plugins, but it affects core too.
 >
 > And yes, js files are under ''wp-includes'' and translated strings json
 files in ''wp-content/languages/''
 > ''
 > load_script_textdomain()''
 > must handle core js files translation case too, since its used now for
 editor translation.

 I will understand that.

 At the same time I think that this function is an attractive feature of
 5.0.0.

 Using the wp_set_script_translations function in themes and plugins,
 the translation function can be used within JavaScript.

 Currently, '[domain]-[locale]-[handle].json' under the theme and plugin
 can be used.

 However, '[domain]-[locale]-[md5-hash].json' can not be used.

 I expect that this problem can be solved.
 And, I think "Host name comparison condition" is important.

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


More information about the wp-trac mailing list