Title: pre_load_script_translations
Published: January 14, 2019
Last modified: May 20, 2026

---

# apply_filters( ‘pre_load_script_translations’, string|false|null $translations, string|false $file, string $handle, string $domain )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/pre_load_script_translations/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/pre_load_script_translations/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/pre_load_script_translations/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/pre_load_script_translations/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/pre_load_script_translations/?output_format=md#changelog)

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

Pre-filters script translations for the given file, script handle and text domain.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/pre_load_script_translations/?output_format=md#description)󠁿

Returning a non-null value allows to override the default logic, effectively short-
circuiting the function.

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/pre_load_script_translations/?output_format=md#parameters)󠁿

 `$translations`string|false|null

JSON-encoded translation data. Default null.

`$file`string|false

Path to the translation file to load. False if there isn’t one.

`$handle`string

Name of the script to register a translation domain to.

`$domain`string

The text domain.

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

    ```php
    $translations = apply_filters( 'pre_load_script_translations', null, $file, $handle, $domain );
    ```

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

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

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

Loads the translation data for the given script handle and text domain.

  |

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

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

## User Contributed Notes

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