From e4e4a084d40e962f6cc62b6218e1975ff00524c4 Mon Sep 17 00:00:00 2001 From: dd32 Date: Thu, 31 Mar 2011 08:11:30 +0000 Subject: [PATCH] Default WP_LANG_DIR to `WP_CONTENT_DIR/languages` when `wp-includes/languages/` doesn't exist. Fixes #17006 git-svn-id: http://svn.automattic.com/wordpress/trunk@17575 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/load.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/load.php b/wp-includes/load.php index 298dd7dfb5..e60f90da69 100644 --- a/wp-includes/load.php +++ b/wp-includes/load.php @@ -283,8 +283,10 @@ function wp_debug_mode() { * * To set directory manually, define WP_LANG_DIR in wp-config.php. * - * First looks for language folder in WP_CONTENT_DIR and uses that folder if it - * exists. Or it uses the "languages" folder in WPINC. + * If the language directory exists within WP_CONTENT_DIR that is used + * 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. * @@ -293,7 +295,7 @@ function wp_debug_mode() { */ function wp_set_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 if ( !defined( 'LANGDIR' ) ) { // Old static relative path maintained for limited backwards compatibility - won't work in some cases