PluginProbe
Translate and Go multilingual – Automatic AI translation – wpLingua / 2.11.2
Translate and Go multilingual – Automatic AI translation – wpLingua v2.11.2
2.16.5 2.16.4 2.16.3 2.16.2 2.16.1 2.16.0 2.15.2 2.15.1 2.15.0 2.14.3 2.14.2 2.14.1 2.14.0 2.13.1 2.13.0 2.12.3 2.12.2 2.12.1 trunk 1.0.3 1.0.4 1.0.5 1.1.0 1.1.1 1.2.0 All 110 releases
wplingua / data / attribute.php

attribute.php in Translate and Go multilingual – Automatic AI translation – wpLingua 2.11.2, at data/attribute.php

313 lines 6.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // If this file is called directly, abort.
4 if ( ! defined( 'WPINC' ) ) {
5 die;
6 }
7
8
9 /**
10 * Get attributes and selectors of JSON to translate
11 *
12 * @return array
13 */
14 function wplng_data_attr_json_to_translate() {
15 return apply_filters(
16 'wplng_attr_json_to_translate',
17 array(
18 // Theme: Divi
19 array(
20 'attr' => 'data-et-multi-view',
21 'selector' => '[data-et-multi-view]',
22 ),
23
24 // Theme: my-listing
25 array(
26 'attr' => ':choices',
27 'selector' => 'order-filter[:choices]',
28 ),
29 array(
30 'attr' => ':choices',
31 'selector' => 'checkboxes-filter[:choices]',
32 ),
33
34 // Plugin: WooCommerce
35 array(
36 'attr' => 'data-wc-context',
37 'selector' => '[data-wc-context]',
38 ),
39 array(
40 'attr' => 'data-wp-context',
41 'selector' => '[data-wp-context]',
42 ),
43
44 // Plugin: Elementor (or addon)
45 array(
46 'attr' => 'data-premium-element-link',
47 'selector' => '[data-premium-element-link]',
48 ),
49
50 // Plugin: Elementor Essential Addons (Event Calendar)
51 array(
52 'attr' => 'data-translate',
53 'selector' => '.eael-event-calendar-cls[data-translate]',
54 ),
55 array(
56 'attr' => 'data-events',
57 'selector' => '.eael-event-calendar-cls[data-events]',
58 ),
59 )
60 );
61 }
62
63
64 /**
65 * Get attributes and selectors of texts in attribute to translate
66 *
67 * @return array
68 */
69 function wplng_data_attr_text_to_translate() {
70 return apply_filters(
71 'wplng_attr_text_to_translate',
72 array(
73 // Default tags
74 array(
75 'attr' => 'alt',
76 'selector' => '[alt]',
77 ),
78 array(
79 'attr' => 'title',
80 'selector' => '[title]',
81 ),
82 array(
83 'attr' => 'placeholder',
84 'selector' => '[placeholder]',
85 ),
86 array(
87 'attr' => 'label',
88 'selector' => '[label]',
89 ),
90 array(
91 'attr' => 'aria-label',
92 'selector' => '[aria-label]',
93 ),
94 array(
95 'attr' => 'value',
96 'selector' => '[type="submit"]',
97 ),
98 array(
99 'attr' => 'value',
100 'selector' => 'input[type="button"]',
101 ),
102
103 // WordPress
104 array(
105 'attr' => 'content',
106 'selector' => 'meta[property="article:tag"]',
107 ),
108 array(
109 'attr' => 'content',
110 'selector' => 'meta[property="article:section"]',
111 ),
112 array(
113 'attr' => 'content',
114 'selector' => 'meta[name="description"]',
115 ),
116
117 // Open Graph
118 array(
119 'attr' => 'content',
120 'selector' => 'meta[property="og:title"]',
121 ),
122 array(
123 'attr' => 'content',
124 'selector' => 'meta[property="og:description"]',
125 ),
126 array(
127 'attr' => 'content',
128 'selector' => 'meta[property="og:site_name"]',
129 ),
130 array(
131 'attr' => 'content',
132 'selector' => 'meta[property="og:image:alt"]',
133 ),
134
135 // Dublin Core
136 array(
137 'attr' => 'content',
138 'selector' => 'meta[name="dc.title"]',
139 ),
140 array(
141 'attr' => 'content',
142 'selector' => 'meta[name="dc.description"]',
143 ),
144
145 // Twitter
146 array(
147 'attr' => 'content',
148 'selector' => 'meta[name="twitter:title"]',
149 ),
150 array(
151 'attr' => 'content',
152 'selector' => 'meta[name="twitter:description"]',
153 ),
154 array(
155 'attr' => 'content',
156 'selector' => 'meta[name="twitter:label1"]',
157 ),
158 array(
159 'attr' => 'content',
160 'selector' => 'meta[name="twitter:data1"]',
161 ),
162 array(
163 'attr' => 'content',
164 'selector' => 'meta[name="twitter:label2"]',
165 ),
166 array(
167 'attr' => 'content',
168 'selector' => 'meta[name="twitter:data2"]',
169 ),
170 array(
171 'attr' => 'content',
172 'selector' => 'meta[name="twitter:image:alt"]',
173 ),
174
175 // Plugin: Fluent Forms tooltips
176 array(
177 'attr' => 'data-content',
178 'selector' => '.ff-el-tooltip[data-content]',
179 ),
180
181 // Plugin: Forminator
182 array(
183 'attr' => 'data-placeholder',
184 'selector' => '[data-placeholder]',
185 ),
186 array(
187 'attr' => 'data-search-placeholde',
188 'selector' => '[data-search-placeholde]',
189 ),
190
191 // Plugin: Smart Slider 3
192 array(
193 'attr' => 'data-title',
194 'selector' => '[data-title]',
195 ),
196
197 // Plugin: WooCommerce
198 array(
199 'attr' => 'data-order_button_text',
200 'selector' => '[data-order_button_text]',
201 ),
202
203 // Plugin: Elementor Essential Addons (Event Calendar)
204 array(
205 'attr' => 'data-detailsButtonText',
206 'selector' => '.eael-event-calendar-cls[data-detailsButtonText]',
207 ),
208 )
209 );
210 }
211
212
213 /**
214 * Get attributes and selectors of HTML in attribute to translate
215 *
216 * @return array
217 */
218 function wplng_data_attr_html_to_translate() {
219 return apply_filters(
220 'wplng_attr_html_to_translate',
221 array(
222 array(
223 'attr' => 'data-sub-html',
224 'selector' => '[data-sub-html]',
225 ),
226 )
227 );
228 }
229
230
231 /**
232 * Get attributes and selectors of URL to translate
233 *
234 * @return array
235 */
236 function wplng_data_attr_url_to_translate() {
237 return apply_filters(
238 'wplng_attr_url_to_translate',
239 array(
240 array(
241 'attr' => 'href',
242 'selector' => 'a[href]',
243 ),
244 array(
245 'attr' => 'action',
246 'selector' => 'form[action]',
247 ),
248 array(
249 'attr' => 'content',
250 'selector' => 'meta[property="og:url"]',
251 ),
252 array(
253 'attr' => 'href',
254 'selector' => 'link[rel="canonical"]',
255 ),
256 array(
257 'attr' => 'content',
258 'selector' => 'meta[name="dc.relation"]',
259 ),
260 array(
261 'attr' => 'src',
262 'selector' => 'img[src]',
263 ),
264 array(
265 'attr' => 'src',
266 'selector' => 'iframe[src]',
267 ),
268 array(
269 'attr' => 'src',
270 'selector' => 'video source[src]',
271 ),
272
273 // Plugin: Divi Supreme
274 array(
275 'attr' => 'data-mfp-src',
276 'selector' => '[data-mfp-src]',
277 ),
278 )
279 );
280 }
281
282
283 /**
284 * GEt attributes and selector of elements where translate language ID
285 *
286 * @return array
287 */
288 function wplng_data_attr_lang_id_to_replace() {
289 return apply_filters(
290 'wplng_attr_lang_id_to_replace',
291 array(
292 array(
293 'attr' => 'lang',
294 'selector' => 'html',
295 ),
296 array(
297 'attr' => 'content',
298 'selector' => 'meta[property="og:locale"]',
299 ),
300 array(
301 'attr' => 'content',
302 'selector' => 'meta[name="dc.language"]',
303 ),
304
305 // Plugin: Elementor Essential Addons (Event Calendar)
306 array(
307 'attr' => 'data-locale',
308 'selector' => '.eael-event-calendar-cls[data-locale]',
309 ),
310 )
311 );
312 }
313