wpml-tm-dashboard-ajax.class.php
1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
use WPML\TM\API\Basket;
class WPML_Dashboard_Ajax {
public function enqueue_js() {
wp_register_script(
'wpml-tm-dashboard-scripts',
WPML_TM_URL . '/res/js/tm-dashboard/wpml-tm-dashboard.js',
array( 'jquery', 'backbone', 'wpml-tm-progressbar' ),
ICL_SITEPRESS_VERSION
);
$wpml_tm_strings = $this->get_wpml_tm_script_js_strings();
wp_localize_script( 'wpml-tm-dashboard-scripts', 'wpml_tm_strings', $wpml_tm_strings );
wp_enqueue_script( 'wpml-tm-dashboard-scripts' );
wp_enqueue_script( OTGS_Assets_Handles::POPOVER_TOOLTIP );
wp_enqueue_style( OTGS_Assets_Handles::POPOVER_TOOLTIP );
}
private function get_wpml_tm_script_js_strings() {
$wpml_tm_strings = array(
'BB_default' => Basket::shouldUse()
? __( 'Add selected content to translation basket', 'wpml-translation-management' )
: __( 'Translate selected content', 'wpml-translation-management' ),
'BB_mixed_actions' => __(
'Add selected content to translation basket / Duplicate',
'wpml-translation-management'
),
'BB_duplicate_all' => __( 'Duplicate', 'wpml-translation-management' ),
'BB_no_actions' => __(
'Choose at least one translation action',
'wpml-translation-management'
),
'duplication_complete' => __(
'Finished Post Duplication',
'wpml-translation-management'
),
'wpml_duplicate_dashboard_nonce' => wp_create_nonce( 'wpml_duplicate_dashboard_nonce' ),
'wpml_need_sync_message_nonce' => wp_create_nonce( 'wpml_need_sync_message_nonce' ),
'duplicating' => __( 'Duplicating', 'wpml-translation-management' ),
'post_parent' => __( 'Post parent', 'wpml-translation-management' ),
'any' => __( 'Any', 'wpml-translation-management' ),
);
return $wpml_tm_strings;
}
}