Changeset 59126
- Timestamp:
- 09/30/2024 02:57:32 PM (6 weeks ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/l10n.php
r59029 r59126 1208 1208 $relative = explode( '/', $relative ); 1209 1209 1210 $languages_path = WP_LANG_DIR . '/plugins'; 1210 /* 1211 * Ensure correct languages path when using a custom `WP_PLUGIN_DIR` / `WP_PLUGIN_URL` configuration. 1212 * See https://core.trac.wordpress.org/ticket/60891 and https://core.trac.wordpress.org/ticket/62016. 1213 */ 1214 $plugins_dir = array_slice( explode( '/', $plugins_url['path'] ), 2 ); 1215 $plugins_dir = trim( $plugins_dir[0], '/' ); 1216 $dirname = $plugins_dir === $relative[0] ? 'plugins' : 'themes'; 1217 1218 $languages_path = WP_LANG_DIR . '/' . $dirname; 1211 1219 1212 1220 $relative = array_slice( $relative, 2 ); // Remove plugins/<plugin name> or themes/<theme name>. -
trunk/tests/phpunit/tests/l10n/loadScriptTextdomain.php
r57922 r59126 15 15 * @ticket 49145 16 16 * @ticket 60891 17 * @ticket 62016 17 18 * 18 19 * @dataProvider data_resolve_relative_path … … 136 137 ), 137 138 ), 139 // @ticket 62016 140 array( 141 '/languages/themes/internationalized-theme-en_US-2f86cb96a0233e7cb3b6f03ad573be0b.json', 142 'theme-with-script-translations', 143 '/wp-content/themes/my-theme/js/script.js', 144 'internationalized-theme', 145 ), 138 146 ); 139 147 }
Note: See TracChangeset
for help on using the changeset viewer.