WordPress Version: 3.7
/**
* Sets the location of the language directory.
*
* To set directory manually, define <code>WP_LANG_DIR</code> in wp-config.php.
*
* 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 preceding directories are found,
* WP_CONTENT_DIR/languages is used.
*
* The WP_LANG_DIR constant was introduced in 2.1.0.
*
* @access private
* @since 3.0.0
*/
function wp_set_lang_dir()
{
if (!defined('WP_LANG_DIR')) {
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
define('LANGDIR', 'wp-content/languages');
}
} else {
define('WP_LANG_DIR', ABSPATH . WPINC . '/languages');
// no leading slash, no trailing slash, full path, not relative to ABSPATH
if (!defined('LANGDIR')) {
// Old relative path maintained for backwards compatibility
define('LANGDIR', WPINC . '/languages');
}
}
}
}