# wp_get_installed_translations()

URL: https://chugunov.pro/api-wordpress/functions/wp_get_installed_translations/
Проверено на WordPress 6.9, обновлено 06.08.2026.
Источник: независимый русскоязычный справочник chugunov.pro. Не является официальной документацией WordPress.

Тип: функция.
Появился в версии: 3.7.0.

## Сигнатура

```php
wp_get_installed_translations( string $type ): array
```

## Описание

Ищет переводы плагинов или тем в каталоге wp-content/languages.

## Параметры

- `$type` `string` — обязательный. Что искать. Принимает 'plugins', 'themes', 'core'.

## Возвращаемое значение

`array`

## Исходный код

Файл: `wp-includes/l10n.php:1596`

```php
function wp_get_installed_translations( $type ) {
	global $wp_textdomain_registry;

	if ( 'themes' !== $type && 'plugins' !== $type && 'core' !== $type ) {
		return array();
	}

	$dir = 'core' === $type ? WP_LANG_DIR : WP_LANG_DIR . "/$type";

	if ( ! is_dir( $dir ) ) {
		return array();
	}

	$files = $wp_textdomain_registry->get_language_files_from_path( $dir );
	if ( ! $files ) {
		return array();
	}

	$language_data = array();

	foreach ( $files as $file ) {
		if ( ! preg_match( '/(?:(.+)-)?([a-z]{2,3}(?:_[A-Z]{2})?(?:_[a-z0-9]+)?)\.(?:mo|l10n\.php)/', basename( $file ), $match ) ) {
			continue;
		}

		list( , $textdomain, $language ) = $match;
		if ( '' === $textdomain ) {
			$textdomain = 'default';
		}

		if ( str_ends_with( $file, '.mo' ) ) {
			$pofile = substr_replace( $file, '.po', - strlen( '.mo' ) );

			if ( ! file_exists( $pofile ) ) {
				continue;
			}

			$language_data[ $textdomain ][ $language ] = wp_get_pomo_file_data( $pofile );
		} else {
			$pofile = substr_replace( $file, '.po', - strlen( '.l10n.php' ) );

			// If both a PO and a PHP file exist, prefer the PO file.
			if ( file_exists( $pofile ) ) {
				continue;
			}

			$language_data[ $textdomain ][ $language ] = wp_get_l10n_php_file_data( $file );
		}
	}
	return $language_data;
}
```

## История изменений

- 3.7.0 — Introduced.

## Связанные

Использует: [`wp_get_l10n_php_file_data`](https://chugunov.pro/api-wordpress/functions/wp_get_l10n_php_file_data/), `WP_Textdomain_Registry::get_language_files_from_path`, [`wp_get_pomo_file_data`](https://chugunov.pro/api-wordpress/functions/wp_get_pomo_file_data/).
Используется в: [`delete_theme`](https://chugunov.pro/api-wordpress/functions/delete_theme/), [`delete_plugins`](https://chugunov.pro/api-wordpress/functions/delete_plugins/), [`wp_version_check`](https://chugunov.pro/api-wordpress/functions/wp_version_check/), [`wp_update_plugins`](https://chugunov.pro/api-wordpress/functions/wp_update_plugins/), [`wp_update_themes`](https://chugunov.pro/api-wordpress/functions/wp_update_themes/).

Оригинал в официальной документации: https://developer.wordpress.org/reference/functions/wp_get_installed_translations/
