Title: wp_can_install_language_pack
Published: September 4, 2014
Last modified: May 20, 2026

---

# wp_can_install_language_pack(): bool

## In this article

 * [Return](https://developer.wordpress.org/reference/functions/wp_can_install_language_pack/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_can_install_language_pack/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_can_install_language_pack/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_can_install_language_pack/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_can_install_language_pack/?output_format=md#wp--skip-link--target)

Check if WordPress has access to the filesystem without asking for credentials.

## 󠀁[Return](https://developer.wordpress.org/reference/functions/wp_can_install_language_pack/?output_format=md#return)󠁿

 bool Returns true on success, false on failure.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_can_install_language_pack/?output_format=md#source)󠁿

    ```php
    function wp_can_install_language_pack() {
    	if ( ! wp_is_file_mod_allowed( 'can_install_language_pack' ) ) {
    		return false;
    	}

    	require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
    	$skin     = new Automatic_Upgrader_Skin();
    	$upgrader = new Language_Pack_Upgrader( $skin );
    	$upgrader->init();

    	$check = $upgrader->fs_connect( array( WP_CONTENT_DIR, WP_LANG_DIR ) );

    	if ( ! $check || is_wp_error( $check ) ) {
    		return false;
    	}

    	return true;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/translation-install.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/translation-install.php#L302)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/translation-install.php#L302-L319)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_can_install_language_pack/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_is_file_mod_allowed()](https://developer.wordpress.org/reference/functions/wp_is_file_mod_allowed/)`wp-includes/load.php` |

Determines whether file modifications are allowed.

  | 
| [is_wp_error()](https://developer.wordpress.org/reference/functions/is_wp_error/)`wp-includes/load.php` |

Checks whether the given variable is a WordPress Error.

  |

| Used by | Description | 
| [edit_user()](https://developer.wordpress.org/reference/functions/edit_user/)`wp-admin/includes/user.php` |

Edit user settings based on contents of $_POST

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_can_install_language_pack/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.0.0](https://developer.wordpress.org/reference/since/4.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_can_install_language_pack%2F)
before being able to contribute a note or feedback.