From 746173b4b82c769b4e5d53998111d509d5cc1a67 Mon Sep 17 00:00:00 2001 From: Dion Hulse 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: https://develop.svn.wordpress.org/trunk@17575 602fd350-edb4-49c9-b593-d223f7449a82 --- 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