Default WP_LANG_DIR to WP_CONTENT_DIR/languages when wp-includes/languages/ doesn't exist. Fixes #17006

git-svn-id: https://develop.svn.wordpress.org/trunk@17575 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2011-03-31 08:11:30 +00:00
parent f9eb15c0ce
commit 746173b4b8

View File

@ -283,8 +283,10 @@ function wp_debug_mode() {
* *
* To set directory manually, define <code>WP_LANG_DIR</code> in wp-config.php. * To set directory manually, define <code>WP_LANG_DIR</code> in wp-config.php.
* *
* First looks for language folder in WP_CONTENT_DIR and uses that folder if it * If the language directory exists within WP_CONTENT_DIR that is used
* exists. Or it uses the "languages" folder in WPINC. * Otherwise if the language directory exists within WPINC, that's used
* Finally, If neither of the preceeding directories is found,
* WP_CONTENT_DIR/languages is used.
* *
* The WP_LANG_DIR constant was introduced in 2.1.0. * The WP_LANG_DIR constant was introduced in 2.1.0.
* *
@ -293,7 +295,7 @@ function wp_debug_mode() {
*/ */
function wp_set_lang_dir() { function wp_set_lang_dir() {
if ( !defined( 'WP_LANG_DIR' ) ) { if ( !defined( 'WP_LANG_DIR' ) ) {
if ( file_exists( WP_CONTENT_DIR . '/languages' ) && @is_dir( WP_CONTENT_DIR . '/languages' ) ) { if ( file_exists( WP_CONTENT_DIR . '/languages' ) && @is_dir( WP_CONTENT_DIR . '/languages' ) || !@is_dir(ABSPATH . WPINC . '/languages') ) {
define( 'WP_LANG_DIR', WP_CONTENT_DIR . '/languages' ); // no leading slash, no trailing slash, full path, not relative to ABSPATH define( 'WP_LANG_DIR', WP_CONTENT_DIR . '/languages' ); // no leading slash, no trailing slash, full path, not relative to ABSPATH
if ( !defined( 'LANGDIR' ) ) { if ( !defined( 'LANGDIR' ) ) {
// Old static relative path maintained for limited backwards compatibility - won't work in some cases // Old static relative path maintained for limited backwards compatibility - won't work in some cases