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
This commit is contained in:
dd32 2011-03-31 08:11:30 +00:00
parent 51b3f2faf2
commit e4e4a084d4
1 changed files with 5 additions and 3 deletions

View File

@ -283,8 +283,10 @@ function wp_debug_mode() {
*
* 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
* 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