wp_set_script_translations
wp_set_script_translations ( $handle, $domain = 'default', $path = '' )
Parameters:- (string) handle Script handle the textdomain will be attached to.
- (string) domain Optional. Text domain. Default 'default'.
- (string) path Optional. The full file path to the directory containing translation files.
See:- WP_Scripts::set_translations()
Returns:- (bool) True if the text domain was successfully localized, false otherwise.
Defined at:Change Log: - Introduced in WordPress: 5.0.0
- Deprecated in WordPress: —
Description
Sets translated strings for a script.Works only if the script has already been registered.