WordPress.org

Make WordPress Core

Opened 19 months ago

Last modified 19 months ago

#45528 closed defect (bug)

load_script_textdomain() doesn't load translations when WP installed in a subdirectory with custom content dir — at Version 3

Reported by: fierevere Owned by:
Milestone: 5.0.2 Priority: normal
Severity: normal Version: 5.0
Component: I18N Keywords: has-screenshots has-patch has-unit-tests fixed-5.0
Focuses: Cc:

Description (last modified by ocean90)

Translation for Gutenberg editor screen is partial when WP_CONTENT_DIR been redefined. JSON translations are present in WP_CONTENT_DIR/languages but are not used.

Steps to reproduce (fresh WP install):
https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

  1. install localized wordpress in subfolder ( http://localhost:8080/wordpress in my case )
  2. move installation to root of domain

create index.php, redefine siteurl

  1. define new constants
define( 'WP_CONTENT_DIR', '/siteroot/wp/wp-content' );
define( 'WP_CONTENT_URL', 'http://localhost:8080/wp-content' );
define( 'WP_PLUGIN_DIR', '/siteroot/wp/wp-content/plugins' );
define( 'WP_PLUGIN_URL', 'http://localhost:8080/wp-content/plugins' );
  1. ensure everything is working. (It is!)

Try to load editor, (new post/page) - localization is broken.

Expected: geditor-good.jpg
Got: geditor-bad.jpg

Change History (6)

@fierevere
19 months ago

Expected (translated) editor screen

@fierevere
19 months ago

Broken translation

#1 @fierevere
19 months ago

#45526 was marked as a duplicate.

@fierevere
19 months ago

index.php redirector for site root folder. Loads wordpress from /wordpress/

This ticket was mentioned in Slack in #core by yui. View the logs.


19 months ago

#3 @ocean90
19 months ago

  • Description modified (diff)
  • Keywords needs-patch needs-unit-tests added
  • Milestone changed from Awaiting Review to 5.0.1
  • Severity changed from major to normal
  • Summary changed from Editor JSON translations fail to load if WP_CONTENT_DIR been redefined to load_script_textdomain() doesn't load translations when WP installed in a subdirectory with custom content dir

Related issue: When WordPress is installed in a /wp/ directory, $relative becomes -includes/js/dist/editor.min.js.

Related: #45488

Note: See TracTickets for help on using tickets.