@@ -42,21 +42,31 @@ public function load_text_domain() {
42
42
* Enqueue script for translations of the performance panel settings
43
43
*/
44
44
public function prepare_and_load_js_translations () {
45
- wp_register_script (
46
- 'wp-module-performance-translations ' ,
47
- NFD_PERFORMANCE_BUILD_URL . '/translations.min.js ' ,
48
- array ( 'lodash ' , 'react ' , 'react-dom ' , 'wp-data ' , 'wp-dom-ready ' , 'wp-element ' , 'wp-html-entities ' , 'wp-i18n ' ),
49
- $ this ->version ,
50
- true
51
- );
52
45
53
- $ this ::load_js_translations (
54
- 'wp-module-performance ' ,
55
- 'wp-module-performance-translations ' ,
56
- NFD_PERFORMANCE_PLUGIN_LANGUAGES_DIR
46
+ add_action (
47
+ 'admin_enqueue_scripts ' ,
48
+ function () {
49
+ $ this ::load_js_translations (
50
+ 'wp-module-performance ' ,
51
+ 'nfd-performance ' ,
52
+ NFD_PERFORMANCE_PLUGIN_LANGUAGES_DIR
53
+ );
54
+
55
+ $ this ::load_js_translations (
56
+ 'wp-module-performance ' ,
57
+ 'nfd-performance-bulk-optimizer ' ,
58
+ NFD_PERFORMANCE_PLUGIN_LANGUAGES_DIR
59
+ );
60
+
61
+ $ this ::load_js_translations (
62
+ 'wp-module-performance ' ,
63
+ 'nfd-performance-image-bulk-optimizer ' ,
64
+ NFD_PERFORMANCE_PLUGIN_LANGUAGES_DIR
65
+ );
66
+ },
67
+ 100
57
68
);
58
69
59
- wp_enqueue_script ( 'wp-module-performance-translations ' );
60
70
}
61
71
62
72
/**
0 commit comments