# wp_set_script_module_translations()

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

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

## Сигнатура

```php
wp_set_script_module_translations( string $id, string $domain = 'default', string $path = '' ): bool
```

## Описание

Translations for script modules are loaded automatically from the default text domain and language directory. Use this function only when a module’s text domain differs from `'default'` or when translation files live outside the standard location, for example plugin modules using their own text domain.[See also](#see-also)
- [WP_Script_Modules::set_translations()](https://developer.wordpress.org/reference/classes/WP_Script_Modules/set_translations/)

## Параметры

- `$id` `string` — обязательный. Идентификатор модуля скрипта.
- `$domain` `string` — необязательный, по умолчанию `'default'`. Текстовый домен. Значение по умолчанию — 'default'.
- `$path` `string` — необязательный, по умолчанию `''`. Полный путь к каталогу, содержащему файлы переводов.

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

`bool`

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

Файл: `wp-includes/script-modules.php:158`

```php
function wp_set_script_module_translations( string $id, string $domain = 'default', string $path = '' ): bool {
	return wp_script_modules()->set_translations( $id, $domain, $path );
}
```

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

- 7.0.0 — Introduced.

## Связанные

Использует: `WP_Script_Modules::set_translations`, [`wp_script_modules`](https://chugunov.pro/api-wordpress/functions/wp_script_modules/), [`WP_Script_Modules`](https://chugunov.pro/api-wordpress/functions/wp_script_modules/).

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