LLMS_Assets::set_script_translations( array $script )
Load JSON format localization files for a registered script
Description Description
This method mimics the behavior of PO/MO pot files loaded for PHP localization.
Language files can be found in the following locations (The first loaded file takes priority):
-
wp-content/languages/{$textdomain}/{$textdomain}-{$locale}-{$file_md5_hash}.json
This is recommended "safe" location where custom language files can be stored. A file stored in this directory will never be automatically overwritten.
-
wp-content/languages/plugins/{$textdomain}-{$locale}-{$file_md5_hash}.json
This is the default directory where WordPress will download language files from the WordPress GlotPress server during updates. If you store a custom language file in this directory it will be overwritten during updates.
-
wp-content/plugins/{$textdomain}/languages/{$textdomain}-{$locale}-{$file_md5_hash}.json
This is the the LifterLMS plugin directory. A language file stored in this directory will be removed from the server during a LifterLMS plugin update.
Parameters Parameters
- $script
-
(Required) An asset definition array from the return of
LLMS_Assets::get()
.
Return Return
(void)
Source Source
File: includes/class-llms-assets.php
Changelog Changelog
Version | Description |
---|---|
4.9.0 | Introduced. |