Weglot Translate – Translate your WP website - Version 1.9

Version Description

  • Fix login redirection
  • Add translation for Town, cities and other dynamic fields in WC checkout
  • exclude URL now accepts full URL and any blank separator
Download this release

Release Info

Developer remyb92
Plugin Icon 128x128 Weglot Translate – Translate your WP website
Version 1.9
Comparing to
See all releases

Code changes from version 1.8.2 to 1.9

WeglotPHPClient/src/Client.php CHANGED
@@ -78,7 +78,7 @@ class Client {
78
  }
79
 
80
  public function checkIframe_src( $row ) {
81
- return (strpos( $this->full_trim( $row->src ),'.youtube.' ) !== false);
82
  }
83
 
84
  public function checkImg_src( $row ) {
@@ -134,8 +134,27 @@ class Client {
134
  return null;
135
  }
136
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  public function translateDomFromTo( $dom, $l_from, $l_to ) {
138
- $html = WeglotSDP\str_get_html( $dom, true, true, WG_DEFAULT_TARGET_CHARSET, false, WG_DEFAULT_BR_TEXT, WG_DEFAULT_SPAN_TEXT );
 
 
 
139
 
140
  $exceptions = explode( ',',get_option( 'exclude_blocks' ) );
141
  array_push( $exceptions,'#wpadminbar' );
@@ -320,8 +339,6 @@ class Client {
320
  $microData = array("description");
321
  $jsons = array();
322
  $nbJsonStrings = 0;
323
-
324
-
325
  foreach ( $html->find( 'script[type="application/ld+json"]' ) as $k => $row ) {
326
  $mustAddjson = false;
327
  $json = json_decode($row->innertext,true);
@@ -344,6 +361,8 @@ class Client {
344
  }
345
  }
346
 
 
 
347
  $title = 'Empty title';
348
  foreach ( $html->find( 'title' ) as $k => $row ) {
349
  if($row->innertext != '')
@@ -375,8 +394,9 @@ class Client {
375
  $answer = $json;
376
  if ( isset( $answer['to_words'] ) ) {
377
  $translated_words = $answer['to_words'];
 
378
 
379
- if ( (count( $nodes ) + $nbJsonStrings ) == count( $translated_words ) ) {
380
  for ( $i = 0;$i < count( $nodes );$i++ ) {
381
 
382
  $property = $nodes[$i]['property'];
@@ -413,7 +433,14 @@ class Client {
413
 
414
  }
415
 
416
- return $html->save();
 
 
 
 
 
 
 
417
  } else {
418
  throw new WeglotException( 'Unknown error with Weglot Api (0006)' );
419
  }
@@ -526,68 +553,86 @@ class Client {
526
  }
527
 
528
 
529
- function addValues( $value, &$words, &$nbJsonStrings )
530
- {
531
- if (is_array($value)) {
532
- foreach ($value as $key => $val) {
533
- $this->addValues($val, $words, $nbJsonStrings);
534
- }
535
-
536
- }
537
- else {
538
- array_push(
539
- $words, array(
540
- 't' => 1,
541
- 'w' => $value,
542
- )
543
- );
544
- $nbJsonStrings++;
545
  }
 
 
 
 
 
 
 
 
 
 
546
  }
 
547
 
548
- function setValues(&$data, $path, $translatedwords,&$index) {
549
 
550
- $temp = &$data;
551
- foreach ($path as $key) {
552
- if (array_key_exists($key, $temp))
553
- $temp = &$temp[$key];
554
- else
555
- return null;
556
- }
557
 
558
- if (is_array($temp)) {
559
- foreach ($temp as $key => &$val) {
560
- $this->setValues($val, null, $translatedwords, $index) ;
561
- }
562
- } else {
563
- $temp = $translatedwords[$index];
564
- $index++;
565
  }
566
-
567
- return;
 
568
  }
569
 
570
- function getValue($data, $path) {
571
- $temp = $data;
572
- foreach ( $path as $key ) {
573
- if(array_key_exists($key,$temp))
574
- $temp = $temp[$key];
575
- else
576
- return null;
577
- }
578
- return $temp ;
 
579
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
580
 
581
 
582
- function url_origin( $s, $use_forwarded_host = false ) {
583
- $ssl = ( ! empty( $s['HTTPS'] ) && $s['HTTPS'] == 'on') ? true : false;
584
- $sp = strtolower( $s['SERVER_PROTOCOL'] );
585
- $protocol = substr( $sp, 0, strpos( $sp, '/' ) ) . (($ssl) ? 's' : '');
586
- $port = $s['SERVER_PORT'];
587
- $port = (( ! $ssl && $port == '80') || ($ssl && $port == '443')) ? '' : ':' . $port;
588
- $host = ($use_forwarded_host && isset( $s['HTTP_X_FORWARDED_HOST'] )) ? $s['HTTP_X_FORWARDED_HOST'] : (isset( $s['HTTP_HOST'] ) ? $s['HTTP_HOST'] : null);
589
- $host = isset( $host ) ? $host : $s['SERVER_NAME'] . $port;
590
- return $protocol . '://' . $host;
591
  }
592
  function full_url( $s, $use_forwarded_host = false ) {
593
  return $this->url_origin( $s, $use_forwarded_host ) . $s['REQUEST_URI'];
78
  }
79
 
80
  public function checkIframe_src( $row ) {
81
+ return (strpos( $this->full_trim( $row->src ),'youtube.' ) !== false);
82
  }
83
 
84
  public function checkImg_src( $row ) {
134
  return null;
135
  }
136
 
137
+ public function ignoreNodes($dom) {
138
+ $nodes_to_ignore = array(
139
+ array('<strong>','</strong>'),
140
+ array('<em>','</em>'),
141
+
142
+ );
143
+
144
+ foreach ($nodes_to_ignore as $ignore) {
145
+ $pattern = '#'.$ignore[0].'([^>]*)?'.$ignore[1].'#';
146
+ $replace = htmlentities($ignore[0]).'$1'.htmlentities($ignore[1]);
147
+ $dom = preg_replace($pattern,$replace,$dom);
148
+ }
149
+
150
+ return $dom;
151
+ }
152
+
153
  public function translateDomFromTo( $dom, $l_from, $l_to ) {
154
+ if(strlen($this->api_key)==36)
155
+ $dom = $this->ignoreNodes($dom);
156
+
157
+ $html = WeglotSDP\str_get_html( $dom, true, true, WG_DEFAULT_TARGET_CHARSET, false, WG_DEFAULT_BR_TEXT, WG_DEFAULT_SPAN_TEXT );
158
 
159
  $exceptions = explode( ',',get_option( 'exclude_blocks' ) );
160
  array_push( $exceptions,'#wpadminbar' );
339
  $microData = array("description");
340
  $jsons = array();
341
  $nbJsonStrings = 0;
 
 
342
  foreach ( $html->find( 'script[type="application/ld+json"]' ) as $k => $row ) {
343
  $mustAddjson = false;
344
  $json = json_decode($row->innertext,true);
361
  }
362
  }
363
 
364
+ $countWC18n = $this->addWCLabels($dom,$words);
365
+
366
  $title = 'Empty title';
367
  foreach ( $html->find( 'title' ) as $k => $row ) {
368
  if($row->innertext != '')
394
  $answer = $json;
395
  if ( isset( $answer['to_words'] ) ) {
396
  $translated_words = $answer['to_words'];
397
+ $from_words = $answer['from_words'];
398
 
399
+ if ( (count( $nodes ) + $nbJsonStrings + $countWC18n ) == count( $translated_words ) ) {
400
  for ( $i = 0;$i < count( $nodes );$i++ ) {
401
 
402
  $property = $nodes[$i]['property'];
433
 
434
  }
435
 
436
+ $dom = $html->save();
437
+
438
+ for( $k = 0; $k<$countWC18n; $k++) {
439
+ $dom = str_replace(str_replace('/','\\\\\/',$from_words[$k+$index+$nbJsonStrings]),str_replace('/','\\\\\/',$translated_words[$k+$index+$nbJsonStrings]),$dom);
440
+ }
441
+
442
+ return $dom;
443
+
444
  } else {
445
  throw new WeglotException( 'Unknown error with Weglot Api (0006)' );
446
  }
553
  }
554
 
555
 
556
+ function addValues( $value, &$words, &$nbJsonStrings )
557
+ {
558
+ if (is_array($value)) {
559
+ foreach ($value as $key => $val) {
560
+ $this->addValues($val, $words, $nbJsonStrings);
 
 
 
 
 
 
 
 
 
 
 
561
  }
562
+
563
+ }
564
+ else {
565
+ array_push(
566
+ $words, array(
567
+ 't' => 1,
568
+ 'w' => $value,
569
+ )
570
+ );
571
+ $nbJsonStrings++;
572
  }
573
+ }
574
 
575
+ function setValues(&$data, $path, $translatedwords,&$index) {
576
 
577
+ $temp = &$data;
578
+ foreach ($path as $key) {
579
+ if (array_key_exists($key, $temp))
580
+ $temp = &$temp[$key];
581
+ else
582
+ return null;
583
+ }
584
 
585
+ if (is_array($temp)) {
586
+ foreach ($temp as $key => &$val) {
587
+ $this->setValues($val, null, $translatedwords, $index) ;
 
 
 
 
588
  }
589
+ } else {
590
+ $temp = $translatedwords[$index];
591
+ $index++;
592
  }
593
 
594
+ return;
595
+ }
596
+
597
+ function getValue($data, $path) {
598
+ $temp = $data;
599
+ foreach ( $path as $key ) {
600
+ if(array_key_exists($key,$temp))
601
+ $temp = $temp[$key];
602
+ else
603
+ return null;
604
  }
605
+ return $temp ;
606
+ }
607
+
608
+ function addWCLabels($html,&$words) {
609
+
610
+ preg_match('#wc_address_i18n_params(.*?);#', $html, $match);
611
+ preg_match_all('#(label|placeholder)\\\":\\\"(.*?)\\\"#', $match[1],$all);
612
+ $all_words = $all[2];
613
+ $c = 0;
614
+ foreach($all_words as $value) {
615
+ array_push(
616
+ $words, array(
617
+ 't' => 1,
618
+ 'w' => str_replace('\\\\\/','/',$value),
619
+ )
620
+ );
621
+ $c++;
622
+ }
623
+ return $c;
624
+ }
625
 
626
 
627
+ function url_origin( $s, $use_forwarded_host = false ) {
628
+ $ssl = ( ! empty( $s['HTTPS'] ) && $s['HTTPS'] == 'on') ? true : false;
629
+ $sp = strtolower( $s['SERVER_PROTOCOL'] );
630
+ $protocol = substr( $sp, 0, strpos( $sp, '/' ) ) . (($ssl) ? 's' : '');
631
+ $port = $s['SERVER_PORT'];
632
+ $port = (( ! $ssl && $port == '80') || ($ssl && $port == '443')) ? '' : ':' . $port;
633
+ $host = ($use_forwarded_host && isset( $s['HTTP_X_FORWARDED_HOST'] )) ? $s['HTTP_X_FORWARDED_HOST'] : (isset( $s['HTTP_HOST'] ) ? $s['HTTP_HOST'] : null);
634
+ $host = isset( $host ) ? $host : $s['SERVER_NAME'] . $port;
635
+ return $protocol . '://' . $host;
636
  }
637
  function full_url( $s, $use_forwarded_host = false ) {
638
  return $this->url_origin( $s, $use_forwarded_host ) . $s['REQUEST_URI'];
includes/wg-settings-page.php CHANGED
@@ -9,8 +9,7 @@ if ( WGUtils::isLanguageRTL( $this->original_l ) ) { // Right lo left language
9
  if ( WGUtils::hasLanguageRTL( explode( ',',$this->destination_l ) ) ) {
10
  $showRTL = true;
11
  }
12
- }
13
- ?>
14
  <div class="wrap">
15
  <?php if ( $this->allowed == 0 ) { ?>
16
  <div class="wg-status-box">
@@ -64,408 +63,73 @@ if ( WGUtils::isLanguageRTL( $this->original_l ) ) { // Right lo left language
64
  <th scope="row"><?php esc_html_e( 'Original Language', 'weglot' ); ?><p style="font-weight:normal;margin-top:2px;"><?php esc_html_e( 'What is the original (current) language of your website?', 'weglot' ); ?></p></th>
65
  <td>
66
  <select class="wg-input-select" name="original_l" style="width :200px;">
67
- <option
68
- <?php
69
- if ( esc_attr( get_option( 'original_l' ) ) == 'fr' ) {
70
- echo 'selected'; }
71
- ?>
72
- value="fr"><?php esc_html_e( 'French', 'weglot' ); ?></option>
73
- <option
74
- <?php
75
- if ( esc_attr( get_option( 'original_l' ) ) == 'en' ) {
76
- echo 'selected'; }
77
- ?>
78
- value="en"><?php esc_html_e( 'English', 'weglot' ); ?></option>
79
- <option
80
- <?php
81
- if ( esc_attr( get_option( 'original_l' ) ) == 'zh' ) {
82
- echo 'selected'; }
83
- ?>
84
- value="zh"><?php esc_html_e( 'Simplified Chinese', 'weglot' ); ?></option>
85
- <option
86
- <?php
87
- if ( esc_attr( get_option( 'original_l' ) ) == 'tw' ) {
88
- echo 'selected'; }
89
- ?>
90
- value="tw"><?php esc_html_e( 'Traditional Chinese', 'weglot' ); ?></option>
91
- <option
92
- <?php
93
- if ( esc_attr( get_option( 'original_l' ) ) == 'ru' ) {
94
- echo 'selected'; }
95
- ?>
96
- value="ru"><?php esc_html_e( 'Russian', 'weglot' ); ?></option>
97
- <option
98
- <?php
99
- if ( esc_attr( get_option( 'original_l' ) ) == 'de' ) {
100
- echo 'selected'; }
101
- ?>
102
- value="de"><?php esc_html_e( 'German', 'weglot' ); ?></option>
103
- <option
104
- <?php
105
- if ( esc_attr( get_option( 'original_l' ) ) == 'es' ) {
106
- echo 'selected'; }
107
- ?>
108
- value="es"><?php esc_html_e( 'Spanish', 'weglot' ); ?></option>
109
- <option
110
- <?php
111
- if ( esc_attr( get_option( 'original_l' ) ) == 'sq' ) {
112
- echo 'selected'; }
113
- ?>
114
- value="sq"><?php esc_html_e( 'Albanian', 'weglot' ); ?></option>
115
- <option
116
- <?php
117
- if ( esc_attr( get_option( 'original_l' ) ) == 'ar' ) {
118
- echo 'selected'; }
119
- ?>
120
- value="ar"><?php esc_html_e( 'Arabic', 'weglot' ); ?></option>
121
- <option
122
- <?php
123
- if ( esc_attr( get_option( 'original_l' ) ) == 'hy' ) {
124
- echo 'selected'; }
125
- ?>
126
- value="hy"><?php esc_html_e( 'Armenian', 'weglot' ); ?></option>
127
- <option
128
- <?php
129
- if ( esc_attr( get_option( 'original_l' ) ) == 'az' ) {
130
- echo 'selected'; }
131
- ?>
132
- value="az"><?php esc_html_e( 'Azerbaijani', 'weglot' ); ?></option>
133
- <option
134
- <?php
135
- if ( esc_attr( get_option( 'original_l' ) ) == 'af' ) {
136
- echo 'selected'; }
137
- ?>
138
- value="af"><?php esc_html_e( 'Afrikaans', 'weglot' ); ?></option>
139
- <option
140
- <?php
141
- if ( esc_attr( get_option( 'original_l' ) ) == 'eu' ) {
142
- echo 'selected'; }
143
- ?>
144
- value="eu"><?php esc_html_e( 'Basque', 'weglot' ); ?></option>
145
- <option
146
- <?php
147
- if ( esc_attr( get_option( 'original_l' ) ) == 'be' ) {
148
- echo 'selected'; }
149
- ?>
150
- value="be"><?php esc_html_e( 'Belarusian', 'weglot' ); ?></option>
151
- <option
152
- <?php
153
- if ( esc_attr( get_option( 'original_l' ) ) == 'bg' ) {
154
- echo 'selected'; }
155
- ?>
156
- value="bg"><?php esc_html_e( 'Bulgarian', 'weglot' ); ?></option>
157
- <option
158
- <?php
159
- if ( esc_attr( get_option( 'original_l' ) ) == 'bs' ) {
160
- echo 'selected'; }
161
- ?>
162
- value="bs"><?php esc_html_e( 'Bosnian', 'weglot' ); ?></option>
163
- <option
164
- <?php
165
- if ( esc_attr( get_option( 'original_l' ) ) == 'vi' ) {
166
- echo 'selected'; }
167
- ?>
168
- value="vi"><?php esc_html_e( 'Vietnamese', 'weglot' ); ?></option>
169
- <option
170
- <?php
171
- if ( esc_attr( get_option( 'original_l' ) ) == 'hu' ) {
172
- echo 'selected'; }
173
- ?>
174
- value="hu"><?php esc_html_e( 'Hungarian', 'weglot' ); ?></option>
175
- <option
176
- <?php
177
- if ( esc_attr( get_option( 'original_l' ) ) == 'ht' ) {
178
- echo 'selected'; }
179
- ?>
180
- value="ht"><?php esc_html_e( 'Haitian', 'weglot' ); ?></option>
181
- <option
182
- <?php
183
- if ( esc_attr( get_option( 'original_l' ) ) == 'nl' ) {
184
- echo 'selected'; }
185
- ?>
186
- value="nl"><?php esc_html_e( 'Dutch', 'weglot' ); ?></option>
187
- <option
188
- <?php
189
- if ( esc_attr( get_option( 'original_l' ) ) == 'el' ) {
190
- echo 'selected'; }
191
- ?>
192
- value="el"><?php esc_html_e( 'Greek', 'weglot' ); ?></option>
193
- <option
194
- <?php
195
- if ( esc_attr( get_option( 'original_l' ) ) == 'ka' ) {
196
- echo 'selected'; }
197
- ?>
198
- value="ka"><?php esc_html_e( 'Georgian', 'weglot' ); ?></option>
199
- <option
200
- <?php
201
- if ( esc_attr( get_option( 'original_l' ) ) == 'da' ) {
202
- echo 'selected'; }
203
- ?>
204
- value="da"><?php esc_html_e( 'Danish', 'weglot' ); ?></option>
205
- <option
206
- <?php
207
- if ( esc_attr( get_option( 'original_l' ) ) == 'he' ) {
208
- echo 'selected'; }
209
- ?>
210
- value="he"><?php esc_html_e( 'Hebrew', 'weglot' ); ?></option>
211
- <option
212
- <?php
213
- if ( esc_attr( get_option( 'original_l' ) ) == 'id' ) {
214
- echo 'selected'; }
215
- ?>
216
- value="id"><?php esc_html_e( 'Indonesian', 'weglot' ); ?></option>
217
- <option
218
- <?php
219
- if ( esc_attr( get_option( 'original_l' ) ) == 'ga' ) {
220
- echo 'selected'; }
221
- ?>
222
- value="ga"><?php esc_html_e( 'Irish', 'weglot' ); ?></option>
223
- <option
224
- <?php
225
- if ( esc_attr( get_option( 'original_l' ) ) == 'it' ) {
226
- echo 'selected'; }
227
- ?>
228
- value="it"><?php esc_html_e( 'Italian', 'weglot' ); ?></option>
229
- <option
230
- <?php
231
- if ( esc_attr( get_option( 'original_l' ) ) == 'is' ) {
232
- echo 'selected'; }
233
- ?>
234
- value="is"><?php esc_html_e( 'Icelandic', 'weglot' ); ?></option>
235
- <option
236
- <?php
237
- if ( esc_attr( get_option( 'original_l' ) ) == 'kk' ) {
238
- echo 'selected'; }
239
- ?>
240
- value="kk"><?php esc_html_e( 'Kazakh', 'weglot' ); ?></option>
241
- <option
242
- <?php
243
- if ( esc_attr( get_option( 'original_l' ) ) == 'ca' ) {
244
- echo 'selected'; }
245
- ?>
246
- value="ca"><?php esc_html_e( 'Catalan', 'weglot' ); ?></option>
247
- <option
248
- <?php
249
- if ( esc_attr( get_option( 'original_l' ) ) == 'ky' ) {
250
- echo 'selected'; }
251
- ?>
252
- value="ky"><?php esc_html_e( 'Kyrgyz', 'weglot' ); ?></option>
253
- <option
254
- <?php
255
- if ( esc_attr( get_option( 'original_l' ) ) == 'ko' ) {
256
- echo 'selected'; }
257
- ?>
258
- value="ko"><?php esc_html_e( 'Korean', 'weglot' ); ?></option>
259
- <option
260
- <?php
261
- if ( esc_attr( get_option( 'original_l' ) ) == 'lv' ) {
262
- echo 'selected'; }
263
- ?>
264
- value="lv"><?php esc_html_e( 'Latvian', 'weglot' ); ?></option>
265
- <option
266
- <?php
267
- if ( esc_attr( get_option( 'original_l' ) ) == 'lt' ) {
268
- echo 'selected'; }
269
- ?>
270
- value="lt"><?php esc_html_e( 'Lithuanian', 'weglot' ); ?></option>
271
- <option
272
- <?php
273
- if ( esc_attr( get_option( 'original_l' ) ) == 'mg' ) {
274
- echo 'selected'; }
275
- ?>
276
- value="mg"><?php esc_html_e( 'Malagasy', 'weglot' ); ?></option>
277
- <option
278
- <?php
279
- if ( esc_attr( get_option( 'original_l' ) ) == 'ms' ) {
280
- echo 'selected'; }
281
- ?>
282
- value="ms"><?php esc_html_e( 'Malay', 'weglot' ); ?></option>
283
- <option
284
- <?php
285
- if ( esc_attr( get_option( 'original_l' ) ) == 'mt' ) {
286
- echo 'selected'; }
287
- ?>
288
- value="mt"><?php esc_html_e( 'Maltese', 'weglot' ); ?></option>
289
- <option
290
- <?php
291
- if ( esc_attr( get_option( 'original_l' ) ) == 'mk' ) {
292
- echo 'selected'; }
293
- ?>
294
- value="mk"><?php esc_html_e( 'Macedonian', 'weglot' ); ?></option>
295
- <option
296
- <?php
297
- if ( esc_attr( get_option( 'original_l' ) ) == 'mn' ) {
298
- echo 'selected'; }
299
- ?>
300
- value="mn"><?php esc_html_e( 'Mongolian', 'weglot' ); ?></option>
301
- <option
302
- <?php
303
- if ( esc_attr( get_option( 'original_l' ) ) == 'no' ) {
304
- echo 'selected'; }
305
- ?>
306
- value="no"><?php esc_html_e( 'Norwegian', 'weglot' ); ?></option>
307
- <option
308
- <?php
309
- if ( esc_attr( get_option( 'original_l' ) ) == 'fa' ) {
310
- echo 'selected'; }
311
- ?>
312
- value="fa"><?php esc_html_e( 'Persian', 'weglot' ); ?></option>
313
- <option
314
- <?php
315
- if ( esc_attr( get_option( 'original_l' ) ) == 'pl' ) {
316
- echo 'selected'; }
317
- ?>
318
- value="pl"><?php esc_html_e( 'Polish', 'weglot' ); ?></option>
319
- <option
320
- <?php
321
- if ( esc_attr( get_option( 'original_l' ) ) == 'pt' ) {
322
- echo 'selected'; }
323
- ?>
324
- value="pt"><?php esc_html_e( 'Portuguese', 'weglot' ); ?></option>
325
- <option
326
- <?php
327
- if ( esc_attr( get_option( 'original_l' ) ) == 'ro' ) {
328
- echo 'selected'; }
329
- ?>
330
- value="ro"><?php esc_html_e( 'Romanian', 'weglot' ); ?></option>
331
- <option
332
- <?php
333
- if ( esc_attr( get_option( 'original_l' ) ) == 'sr' ) {
334
- echo 'selected'; }
335
- ?>
336
- value="sr"><?php esc_html_e( 'Serbian', 'weglot' ); ?></option>
337
- <option
338
- <?php
339
- if ( esc_attr( get_option( 'original_l' ) ) == 'sk' ) {
340
- echo 'selected'; }
341
- ?>
342
- value="sk"><?php esc_html_e( 'Slovak', 'weglot' ); ?></option>
343
- <option
344
- <?php
345
- if ( esc_attr( get_option( 'original_l' ) ) == 'sl' ) {
346
- echo 'selected'; }
347
- ?>
348
- value="sl"><?php esc_html_e( 'Slovenian', 'weglot' ); ?></option>
349
- <option
350
- <?php
351
- if ( esc_attr( get_option( 'original_l' ) ) == 'sw' ) {
352
- echo 'selected'; }
353
- ?>
354
- value="sw"><?php esc_html_e( 'Swahili', 'weglot' ); ?></option>
355
- <option
356
- <?php
357
- if ( esc_attr( get_option( 'original_l' ) ) == 'tg' ) {
358
- echo 'selected'; }
359
- ?>
360
- value="tg"><?php esc_html_e( 'Tajik', 'weglot' ); ?></option>
361
- <option
362
- <?php
363
- if ( esc_attr( get_option( 'original_l' ) ) == 'th' ) {
364
- echo 'selected'; }
365
- ?>
366
- value="th"><?php esc_html_e( 'Thai', 'weglot' ); ?></option>
367
- <option
368
- <?php
369
- if ( esc_attr( get_option( 'original_l' ) ) == 'tr' ) {
370
- echo 'selected'; }
371
- ?>
372
- value="tr"><?php esc_html_e( 'Turkish', 'weglot' ); ?></option>
373
- <option
374
- <?php
375
- if ( esc_attr( get_option( 'original_l' ) ) == 'uz' ) {
376
- echo 'selected'; }
377
- ?>
378
- value="uz"><?php esc_html_e( 'Uzbek', 'weglot' ); ?></option>
379
- <option
380
- <?php
381
- if ( esc_attr( get_option( 'original_l' ) ) == 'uk' ) {
382
- echo 'selected'; }
383
- ?>
384
- value="uk"><?php esc_html_e( 'Ukrainian', 'weglot' ); ?></option>
385
- <option
386
- <?php
387
- if ( esc_attr( get_option( 'original_l' ) ) == 'fi' ) {
388
- echo 'selected'; }
389
- ?>
390
- value="fi"><?php esc_html_e( 'Finnish', 'weglot' ); ?></option>
391
- <option
392
- <?php
393
- if ( esc_attr( get_option( 'original_l' ) ) == 'hr' ) {
394
- echo 'selected'; }
395
- ?>
396
- value="hr"><?php esc_html_e( 'Croatian', 'weglot' ); ?></option>
397
- <option
398
- <?php
399
- if ( esc_attr( get_option( 'original_l' ) ) == 'cs' ) {
400
- echo 'selected'; }
401
- ?>
402
- value="cs"><?php esc_html_e( 'Czech', 'weglot' ); ?></option>
403
- <option
404
- <?php
405
- if ( esc_attr( get_option( 'original_l' ) ) == 'sv' ) {
406
- echo 'selected'; }
407
- ?>
408
- value="sv"><?php esc_html_e( 'Swedish', 'weglot' ); ?></option>
409
- <option
410
- <?php
411
- if ( esc_attr( get_option( 'original_l' ) ) == 'et' ) {
412
- echo 'selected'; }
413
- ?>
414
- value="et"><?php esc_html_e( 'Estonian', 'weglot' ); ?></option>
415
- <option
416
- <?php
417
- if ( esc_attr( get_option( 'original_l' ) ) == 'ja' ) {
418
- echo 'selected'; }
419
- ?>
420
- value="ja"><?php esc_html_e( 'Japanese', 'weglot' ); ?></option>
421
- <option
422
- <?php
423
- if ( esc_attr( get_option( 'original_l' ) ) == 'hi' ) {
424
- echo 'selected'; }
425
- ?>
426
- value="hi"><?php esc_html_e( 'Hindi', 'weglot' ); ?></option>
427
- <option
428
- <?php
429
- if ( esc_attr( get_option( 'original_l' ) ) == 'ur' ) {
430
- echo 'selected'; }
431
- ?>
432
- value="ur"><?php esc_html_e( 'Urdu', 'weglot' ); ?></option>
433
- <option
434
- <?php
435
- if ( esc_attr( get_option( 'original_l' ) ) == 'bn' ) {
436
- echo 'selected'; }
437
- ?>
438
- value="bn"><?php esc_html_e( 'Bengali', 'weglot' ); ?></option>
439
- <option
440
- <?php
441
- if ( esc_attr( get_option( 'original_l' ) ) == 'fj' ) {
442
- echo 'selected'; }
443
- ?>
444
- value="fj"><?php esc_html_e( 'Fijian', 'weglot' ); ?></option>
445
- <option
446
- <?php
447
- if ( esc_attr( get_option( 'original_l' ) ) == 'sm' ) {
448
- echo 'selected'; }
449
- ?>
450
- value="sm"><?php esc_html_e( 'Samoan', 'weglot' ); ?></option>
451
- <option
452
- <?php
453
- if ( esc_attr( get_option( 'original_l' ) ) == 'ty' ) {
454
- echo 'selected'; }
455
- ?>
456
- value="ty"><?php esc_html_e( 'Tahitian', 'weglot' ); ?></option>
457
- <option
458
- <?php
459
- if ( esc_attr( get_option( 'original_l' ) ) == 'to' ) {
460
- echo 'selected'; }
461
- ?>
462
- value="to"><?php esc_html_e( 'Tongan', 'weglot' ); ?></option>
463
- <option
464
- <?php
465
- if ( esc_attr( get_option( 'original_l' ) ) == 'cy' ) {
466
- echo 'selected'; }
467
- ?>
468
- value="cy"><?php esc_html_e( 'Welsh', 'weglot' ); ?></option>
469
  </select>
470
  </td>
471
  </tr>
@@ -473,373 +137,7 @@ if ( WGUtils::isLanguageRTL( $this->original_l ) ) { // Right lo left language
473
  <th scope="row"><?php esc_html_e( 'Destination Languages', 'weglot' ); ?><p style="font-weight:normal;margin-top:2px;"><?php echo sprintf( esc_html__( 'Choose languages you want to translate into. Supported languages can be found %1$shere%2$s.', 'weglot' ), '<a target="_blank" href="https://weglot.com/translation-api#languages_code">', '</a>' ); ?></p></th>
474
  <td>
475
  <div style="display:inline-block;width:300px; margin-top: 35px;">
476
- <select id="select-lto" multiple class="demo-default" style="" placeholder="French, German, Italian, Portuguese, …" name="destination_l" >
477
- <option
478
- <?php
479
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'fr' ) !== false ) {
480
- echo 'selected'; }
481
- ?>
482
- value="fr"><?php esc_html_e( 'French', 'weglot' ); ?></option>
483
- <option
484
- <?php
485
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'en' ) !== false ) {
486
- echo 'selected'; }
487
- ?>
488
- value="en"><?php esc_html_e( 'English', 'weglot' ); ?></option>
489
- <option
490
- <?php
491
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'zh' ) !== false ) {
492
- echo 'selected'; }
493
- ?>
494
- value="zh"><?php esc_html_e( 'Simplified Chinese', 'weglot' ); ?></option>
495
- <option
496
- <?php
497
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'tw' ) !== false ) {
498
- echo 'selected'; }
499
- ?>
500
- value="tw"><?php esc_html_e( 'Traditional Chinese', 'weglot' ); ?></option>
501
- <option
502
- <?php
503
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ru' ) !== false ) {
504
- echo 'selected'; }
505
- ?>
506
- value="ru"><?php esc_html_e( 'Russian', 'weglot' ); ?></option>
507
- <option
508
- <?php
509
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'de' ) !== false ) {
510
- echo 'selected'; }
511
- ?>
512
- value="de"><?php esc_html_e( 'German', 'weglot' ); ?></option>
513
- <option
514
- <?php
515
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'es' ) !== false ) {
516
- echo 'selected'; }
517
- ?>
518
- value="es"><?php esc_html_e( 'Spanish', 'weglot' ); ?></option>
519
- <option
520
- <?php
521
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'sq' ) !== false ) {
522
- echo 'selected'; }
523
- ?>
524
- value="sq"><?php esc_html_e( 'Albanian', 'weglot' ); ?></option>
525
- <option
526
- <?php
527
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ar' ) !== false ) {
528
- echo 'selected'; }
529
- ?>
530
- value="ar"><?php esc_html_e( 'Arabic', 'weglot' ); ?></option>
531
- <option
532
- <?php
533
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'hy' ) !== false ) {
534
- echo 'selected'; }
535
- ?>
536
- value="hy"><?php esc_html_e( 'Armenian', 'weglot' ); ?></option>
537
- <option
538
- <?php
539
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'az' ) !== false ) {
540
- echo 'selected'; }
541
- ?>
542
- value="az"><?php esc_html_e( 'Azerbaijani', 'weglot' ); ?></option>
543
- <option
544
- <?php
545
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'af' ) !== false ) {
546
- echo 'selected'; }
547
- ?>
548
- value="af"><?php esc_html_e( 'Afrikaans', 'weglot' ); ?></option>
549
- <option
550
- <?php
551
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'eu' ) !== false ) {
552
- echo 'selected'; }
553
- ?>
554
- value="eu"><?php esc_html_e( 'Basque', 'weglot' ); ?></option>
555
- <option
556
- <?php
557
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'be' ) !== false ) {
558
- echo 'selected'; }
559
- ?>
560
- value="be"><?php esc_html_e( 'Belarusian', 'weglot' ); ?></option>
561
- <option
562
- <?php
563
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'bg' ) !== false ) {
564
- echo 'selected'; }
565
- ?>
566
- value="bg"><?php esc_html_e( 'Bulgarian', 'weglot' ); ?></option>
567
- <option
568
- <?php
569
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'bs' ) !== false ) {
570
- echo 'selected'; }
571
- ?>
572
- value="bs"><?php esc_html_e( 'Bosnian', 'weglot' ); ?></option>
573
- <option
574
- <?php
575
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'vi' ) !== false ) {
576
- echo 'selected'; }
577
- ?>
578
- value="vi"><?php esc_html_e( 'Vietnamese', 'weglot' ); ?></option>
579
- <option
580
- <?php
581
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'hu' ) !== false ) {
582
- echo 'selected'; }
583
- ?>
584
- value="hu"><?php esc_html_e( 'Hungarian', 'weglot' ); ?></option>
585
- <option
586
- <?php
587
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ht' ) !== false ) {
588
- echo 'selected'; }
589
- ?>
590
- value="ht"><?php esc_html_e( 'Haitian', 'weglot' ); ?></option>
591
- <option
592
- <?php
593
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'nl' ) !== false ) {
594
- echo 'selected'; }
595
- ?>
596
- value="nl"><?php esc_html_e( 'Dutch', 'weglot' ); ?></option>
597
- <option
598
- <?php
599
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'el' ) !== false ) {
600
- echo 'selected'; }
601
- ?>
602
- value="el"><?php esc_html_e( 'Greek', 'weglot' ); ?></option>
603
- <option
604
- <?php
605
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ka' ) !== false ) {
606
- echo 'selected'; }
607
- ?>
608
- value="ka"><?php esc_html_e( 'Georgian', 'weglot' ); ?></option>
609
- <option
610
- <?php
611
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'da' ) !== false ) {
612
- echo 'selected'; }
613
- ?>
614
- value="da"><?php esc_html_e( 'Danish', 'weglot' ); ?></option>
615
- <option
616
- <?php
617
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'he' ) !== false ) {
618
- echo 'selected'; }
619
- ?>
620
- value="he"><?php esc_html_e( 'Hebrew', 'weglot' ); ?></option>
621
- <option
622
- <?php
623
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'id' ) !== false ) {
624
- echo 'selected'; }
625
- ?>
626
- value="id"><?php esc_html_e( 'Indonesian', 'weglot' ); ?></option>
627
- <option
628
- <?php
629
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ga' ) !== false ) {
630
- echo 'selected'; }
631
- ?>
632
- value="ga"><?php esc_html_e( 'Irish', 'weglot' ); ?></option>
633
- <option
634
- <?php
635
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'it' ) !== false ) {
636
- echo 'selected'; }
637
- ?>
638
- value="it"><?php esc_html_e( 'Italian', 'weglot' ); ?></option>
639
- <option
640
- <?php
641
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'is' ) !== false ) {
642
- echo 'selected'; }
643
- ?>
644
- value="is"><?php esc_html_e( 'Icelandic', 'weglot' ); ?></option>
645
- <option
646
- <?php
647
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'kk' ) !== false ) {
648
- echo 'selected'; }
649
- ?>
650
- value="kk"><?php esc_html_e( 'Kazakh', 'weglot' ); ?></option>
651
- <option
652
- <?php
653
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ca' ) !== false ) {
654
- echo 'selected'; }
655
- ?>
656
- value="ca"><?php esc_html_e( 'Catalan', 'weglot' ); ?></option>
657
- <option
658
- <?php
659
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ky' ) !== false ) {
660
- echo 'selected'; }
661
- ?>
662
- value="ky"><?php esc_html_e( 'Kyrgyz', 'weglot' ); ?></option>
663
- <option
664
- <?php
665
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ko' ) !== false ) {
666
- echo 'selected'; }
667
- ?>
668
- value="ko"><?php esc_html_e( 'Korean', 'weglot' ); ?></option>
669
- <option
670
- <?php
671
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'lv' ) !== false ) {
672
- echo 'selected'; }
673
- ?>
674
- value="lv"><?php esc_html_e( 'Latvian', 'weglot' ); ?></option>
675
- <option
676
- <?php
677
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'lt' ) !== false ) {
678
- echo 'selected'; }
679
- ?>
680
- value="lt"><?php esc_html_e( 'Lithuanian', 'weglot' ); ?></option>
681
- <option
682
- <?php
683
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'mg' ) !== false ) {
684
- echo 'selected'; }
685
- ?>
686
- value="mg"><?php esc_html_e( 'Malagasy', 'weglot' ); ?></option>
687
- <option
688
- <?php
689
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ms' ) !== false ) {
690
- echo 'selected'; }
691
- ?>
692
- value="ms"><?php esc_html_e( 'Malay', 'weglot' ); ?></option>
693
- <option
694
- <?php
695
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'mt' ) !== false ) {
696
- echo 'selected'; }
697
- ?>
698
- value="mt"><?php esc_html_e( 'Maltese', 'weglot' ); ?></option>
699
- <option
700
- <?php
701
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'mk' ) !== false ) {
702
- echo 'selected'; }
703
- ?>
704
- value="mk"><?php esc_html_e( 'Macedonian', 'weglot' ); ?></option>
705
- <option
706
- <?php
707
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'mn' ) !== false ) {
708
- echo 'selected'; }
709
- ?>
710
- value="mn"><?php esc_html_e( 'Mongolian', 'weglot' ); ?></option>
711
- <option
712
- <?php
713
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'no' ) !== false ) {
714
- echo 'selected'; }
715
- ?>
716
- value="no"><?php esc_html_e( 'Norwegian', 'weglot' ); ?></option>
717
- <option
718
- <?php
719
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'fa' ) !== false ) {
720
- echo 'selected'; }
721
- ?>
722
- value="fa"><?php esc_html_e( 'Persian', 'weglot' ); ?></option>
723
- <option
724
- <?php
725
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'pl' ) !== false ) {
726
- echo 'selected'; }
727
- ?>
728
- value="pl"><?php esc_html_e( 'Polish', 'weglot' ); ?></option>
729
- <option
730
- <?php
731
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'pt' ) !== false ) {
732
- echo 'selected'; }
733
- ?>
734
- value="pt"><?php esc_html_e( 'Portuguese', 'weglot' ); ?></option>
735
- <option
736
- <?php
737
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ro' ) !== false ) {
738
- echo 'selected'; }
739
- ?>
740
- value="ro"><?php esc_html_e( 'Romanian', 'weglot' ); ?></option>
741
- <option
742
- <?php
743
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'sr' ) !== false ) {
744
- echo 'selected'; }
745
- ?>
746
- value="sr"><?php esc_html_e( 'Serbian', 'weglot' ); ?></option>
747
- <option
748
- <?php
749
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'sk' ) !== false ) {
750
- echo 'selected'; }
751
- ?>
752
- value="sk"><?php esc_html_e( 'Slovak', 'weglot' ); ?></option>
753
- <option
754
- <?php
755
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'sl' ) !== false ) {
756
- echo 'selected'; }
757
- ?>
758
- value="sl"><?php esc_html_e( 'Slovenian', 'weglot' ); ?></option>
759
- <option
760
- <?php
761
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'sw' ) !== false ) {
762
- echo 'selected'; }
763
- ?>
764
- value="sw"><?php esc_html_e( 'Swahili', 'weglot' ); ?></option>
765
- <option
766
- <?php
767
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'tg' ) !== false ) {
768
- echo 'selected'; }
769
- ?>
770
- value="tg"><?php esc_html_e( 'Tajik', 'weglot' ); ?></option>
771
- <option
772
- <?php
773
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'th' ) !== false ) {
774
- echo 'selected'; }
775
- ?>
776
- value="th"><?php esc_html_e( 'Thai', 'weglot' ); ?></option>
777
- <option
778
- <?php
779
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'tr' ) !== false ) {
780
- echo 'selected'; }
781
- ?>
782
- value="tr"><?php esc_html_e( 'Turkish', 'weglot' ); ?></option>
783
- <option
784
- <?php
785
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'uz' ) !== false ) {
786
- echo 'selected'; }
787
- ?>
788
- value="uz"><?php esc_html_e( 'Uzbek', 'weglot' ); ?></option>
789
- <option
790
- <?php
791
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'uk' ) !== false ) {
792
- echo 'selected'; }
793
- ?>
794
- value="uk"><?php esc_html_e( 'Ukrainian', 'weglot' ); ?></option>
795
- <option
796
- <?php
797
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'fi' ) !== false ) {
798
- echo 'selected'; }
799
- ?>
800
- value="fi"><?php esc_html_e( 'Finnish', 'weglot' ); ?></option>
801
- <option
802
- <?php
803
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'hr' ) !== false ) {
804
- echo 'selected'; }
805
- ?>
806
- value="hr"><?php esc_html_e( 'Croatian', 'weglot' ); ?></option>
807
- <option
808
- <?php
809
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'cs' ) !== false ) {
810
- echo 'selected'; }
811
- ?>
812
- value="cs"><?php esc_html_e( 'Czech', 'weglot' ); ?></option>
813
- <option
814
- <?php
815
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'sv' ) !== false ) {
816
- echo 'selected'; }
817
- ?>
818
- value="sv"><?php esc_html_e( 'Swedish', 'weglot' ); ?></option>
819
- <option
820
- <?php
821
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'et' ) !== false ) {
822
- echo 'selected'; }
823
- ?>
824
- value="et"><?php esc_html_e( 'Estonian', 'weglot' ); ?></option>
825
- <option
826
- <?php
827
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ja' ) !== false ) {
828
- echo 'selected'; }
829
- ?>
830
- value="ja"><?php esc_html_e( 'Japanese', 'weglot' ); ?></option>
831
- <option
832
- <?php
833
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'hi' ) !== false ) {
834
- echo 'selected'; }
835
- ?>
836
- value="hi"><?php esc_html_e( 'Hindi', 'weglot' ); ?></option>
837
- <option
838
- <?php
839
- if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ur' ) !== false ) {
840
- echo 'selected'; }
841
- ?>
842
- value="ur"><?php esc_html_e( 'Urdu', 'weglot' ); ?></option>
843
  <option
844
  <?php
845
  if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'bn' ) !== false ) {
@@ -880,13 +178,8 @@ if ( WGUtils::isLanguageRTL( $this->original_l ) ) { // Right lo left language
880
  </div>
881
  <input id="destination_input_hidden" type="text" class="wg-input-text" name="destination_l" value="<?php echo esc_attr( get_option( 'destination_l' ) ); ?>" placeholder="en,es" required style="display:none;" />
882
  <?php
883
- if ( $this->userInfo['plan'] <= 0 ) {
884
- ?>
885
- <p class="wg-fsubtext"><?php echo sprintf( esc_html__( 'On the free plan, you can only choose one language and a maximum of 2000 words. If you want to use more than 1 language and 2000 words, please %1$supgrade your plan%2$s.', 'weglot' ), '<a target="_blank" href="https://weglot.com/change-plan">', '</a>' ); ?></p><?php } ?>
886
- <?php
887
- if ( $this->userInfo['plan'] >= 18 && $this->userInfo['plan'] <= 19 ) {
888
- ?>
889
- <p class="wg-fsubtext"><?php echo sprintf( esc_html__( 'On the Starter plan, you can only choose one language. If you want to use more than 1 language, please %1$supgrade your plan%2$s.', 'weglot' ), '<a target="_blank" href="https://weglot.com/change-plan">', '</a>' ); ?></p><?php } ?>
890
  </td>
891
  </tr>
892
  </table>
@@ -898,8 +191,7 @@ if ( WGUtils::isLanguageRTL( $this->original_l ) ) { // Right lo left language
898
  <td><input id="id_is_dropdown" type="checkbox" name="is_dropdown"
899
  <?php
900
  if ( esc_attr( get_option( 'is_dropdown' ) ) == 'on' ) {
901
- echo 'checked';}
902
- ?>
903
  /><label for="id_is_dropdown" style="font-weight: normal;margin-left: 20px;font-style: italic;display: inline-block;"><?php esc_html_e( 'Check if you want the button to be a dropdown box.', 'weglot' ); ?></label></td>
904
  </tr>
905
  <tr valign="top">
@@ -907,103 +199,29 @@ if ( WGUtils::isLanguageRTL( $this->original_l ) ) { // Right lo left language
907
  <td><input id="id_with_flags" type="checkbox" name="with_flags"
908
  <?php
909
  if ( esc_attr( get_option( 'with_flags' ) ) == 'on' ) {
910
- echo 'checked';}
911
- ?>
912
  /><label for="id_with_flags" style="font-weight: normal;margin-left: 20px;font-style: italic;display: inline-block;"><?php esc_html_e( 'Check if you want flags in the language button.', 'weglot' ); ?></label></td>
913
  </tr>
914
  <tr valign="top">
915
  <th scope="row"><?php esc_html_e( 'Type of flags', 'weglot' ); ?></th>
916
  <td>
917
  <select class="wg-input-select" name="type_flags" style="width :200px;">
918
- <option
919
- <?php
920
- if ( esc_attr( get_option( 'type_flags' ) ) == '0' ) {
921
- echo 'selected'; }
922
- ?>
923
- value="0"><?php esc_html_e( 'Rectangle mat', 'weglot' ); ?></option>
924
- <option
925
- <?php
926
- if ( esc_attr( get_option( 'type_flags' ) ) == '1' ) {
927
- echo 'selected'; }
928
- ?>
929
- value="1"><?php esc_html_e( 'Rectangle shiny', 'weglot' ); ?></option>
930
- <option
931
- <?php
932
- if ( esc_attr( get_option( 'type_flags' ) ) == '2' ) {
933
- echo 'selected'; }
934
- ?>
935
- value="2"><?php esc_html_e( 'Square', 'weglot' ); ?></option>
936
- <option
937
- <?php
938
- if ( esc_attr( get_option( 'type_flags' ) ) == '3' ) {
939
- echo 'selected'; }
940
- ?>
941
- value="3"><?php esc_html_e( 'Circle', 'weglot' ); ?></option>
942
  </select>
943
  <div class="flag-style-openclose"><?php esc_html_e( 'Change country flags','weglot' ); ?></div>
944
  <div class="flag-style-wrapper" style="display:none;">
945
- <select class="flag-en-type wg-input-select">
946
- <option value=0><?php esc_html_e( 'Choose English flag:','weglot' ); ?></option>
947
- <option value=0><?php esc_html_e( 'United Kingdom (default)','weglot' ); ?></option>
948
- <option value=1><?php esc_html_e( 'United States','weglot' ); ?></option>
949
- <option value=2><?php esc_html_e( 'Australia','weglot' ); ?></option>
950
- <option value=3><?php esc_html_e( 'Canada','weglot' ); ?></option>
951
- <option value=4><?php esc_html_e( 'New Zealand','weglot' ); ?></option>
952
- <option value=5><?php esc_html_e( 'Jamaica','weglot' ); ?></option>
953
- <option value=6><?php esc_html_e( 'Ireland','weglot' ); ?></option>
954
  </select>
955
- <select class="flag-es-type wg-input-select">
956
- <option value=0><?php esc_html_e( 'Choose Spanish flag:','weglot' ); ?></option>
957
- <option value=0><?php esc_html_e( 'Spain (default)','weglot' ); ?></option>
958
- <option value=1><?php esc_html_e( 'Mexico','weglot' ); ?></option>
959
- <option value=2><?php esc_html_e( 'Argentina','weglot' ); ?></option>
960
- <option value=3><?php esc_html_e( 'Colombia','weglot' ); ?></option>
961
- <option value=4><?php esc_html_e( 'Peru','weglot' ); ?></option>
962
- <option value=5><?php esc_html_e( 'Bolivia','weglot' ); ?></option>
963
- <option value=6 ><?php esc_html_e( 'Uruguay','weglot' ); ?></option>
964
- <option value=7 ><?php esc_html_e( 'Venezuela','weglot' ); ?></option>
965
- <option value=8 ><?php esc_html_e( 'Chile','weglot' ); ?></option>
966
- <option value=9 ><?php esc_html_e( 'Ecuador','weglot' ); ?></option>
967
- <option value=10><?php esc_html_e( 'Guatemala','weglot' ); ?></option>
968
- <option value=11><?php esc_html_e( 'Cuba','weglot' ); ?></option>
969
- <option value=12><?php esc_html_e( 'Dominican Republic','weglot' ); ?></option>
970
- <option value=13><?php esc_html_e( 'Honduras','weglot' ); ?></option>
971
- <option value=14><?php esc_html_e( 'Paraguay','weglot' ); ?></option>
972
- <option value=15><?php esc_html_e( 'El Salvador','weglot' ); ?></option>
973
- <option value=16><?php esc_html_e( 'Nicaragua','weglot' ); ?></option>
974
- <option value=17><?php esc_html_e( 'Costa Rica','weglot' ); ?></option>
975
- <option value=18><?php esc_html_e( 'Puerto Rico','weglot' ); ?></option>
976
- <option value=19><?php esc_html_e( 'Panama','weglot' ); ?></option>
977
  </select>
978
- <select class="flag-pt-type wg-input-select">
979
- <option value=0><?php esc_html_e( 'Choose Portuguese flag:','weglot' ); ?></option>
980
- <option value=0><?php esc_html_e( 'Brazil (default)','weglot' ); ?></option>
981
- <option value=1><?php esc_html_e( 'Portugal','weglot' ); ?></option>
982
  </select>
983
- <select class="flag-fr-type wg-input-select">
984
- <option value=0><?php esc_html_e( 'Choose French flag:','weglot' ); ?></option>
985
- <option value=0><?php esc_html_e( 'France (default)','weglot' ); ?></option>
986
- <option value=1><?php esc_html_e( 'Belgium','weglot' ); ?></option>
987
- <option value=2><?php esc_html_e( 'Canada','weglot' ); ?></option>
988
- <option value=3><?php esc_html_e( 'Switzerland','weglot' ); ?></option>
989
- <option value=4><?php esc_html_e( 'Luxemburg','weglot' ); ?></option>
990
  </select>
991
- <select class="flag-ar-type wg-input-select">
992
- <option value=0><?php esc_html_e( 'Choose Arabic flag:','weglot' ); ?></option>
993
- <option value=0><?php esc_html_e( 'Saudi Arabia (default)','weglot' ); ?></option>
994
- <option value=1><?php esc_html_e( 'Algeria','weglot' ); ?></option>
995
- <option value=2><?php esc_html_e( 'Egypt','weglot' ); ?></option>
996
- <option value=3><?php esc_html_e( 'Iraq','weglot' ); ?></option>
997
- <option value=4><?php esc_html_e( 'Jordan','weglot' ); ?></option>
998
- <option value=5><?php esc_html_e( 'Kuwait','weglot' ); ?></option>
999
- <option value=6><?php esc_html_e( 'Lebanon','weglot' ); ?></option>
1000
- <option value=7><?php esc_html_e( 'Libya','weglot' ); ?></option>
1001
- <option value=8><?php esc_html_e( 'Morocco','weglot' ); ?></option>
1002
- <option value=9><?php esc_html_e( 'Qatar','weglot' ); ?></option>
1003
- <option value=10><?php esc_html_e( 'Syria','weglot' ); ?></option>
1004
- <option value=11><?php esc_html_e( 'Tunisia','weglot' ); ?></option>
1005
- <option value=12><?php esc_html_e( 'United Arab Emirates','weglot' ); ?></option>
1006
- <option value=13><?php esc_html_e( 'Yemen','weglot' ); ?></option>
1007
  </select>
1008
  <p><?php esc_html_e( 'If you want to use a different flag, just ask us.','weglot' ); ?></p>
1009
  </div>
@@ -1014,8 +232,7 @@ if ( WGUtils::isLanguageRTL( $this->original_l ) ) { // Right lo left language
1014
  <td><input id="id_with_name" type="checkbox" name="with_name"
1015
  <?php
1016
  if ( esc_attr( get_option( 'with_name' ) ) == 'on' ) {
1017
- echo 'checked';}
1018
- ?>
1019
  /><label for="id_with_name" style="font-weight: normal;margin-left: 20px;font-style: italic;display: inline-block;"><?php esc_html_e( 'Check if you want to display the name of languages.', 'weglot' ); ?></label></td>
1020
  </tr>
1021
  <tr valign="top">
@@ -1023,8 +240,7 @@ if ( WGUtils::isLanguageRTL( $this->original_l ) ) { // Right lo left language
1023
  <td><input id="id_is_fullname" type="checkbox" name="is_fullname"
1024
  <?php
1025
  if ( esc_attr( get_option( 'is_fullname' ) ) == 'on' ) {
1026
- echo 'checked';}
1027
- ?>
1028
  /><label for="id_is_fullname" style="font-weight: normal;margin-left: 20px;font-style: italic;display: inline-block;"><?php esc_html_e( 'Check if you want the name of the languge. Don\'t check if you want the language code.', 'weglot' ); ?></label></td>
1029
  </tr>
1030
  <tr valign="top">
@@ -1046,8 +262,7 @@ color: blue!important;
1046
  <td><input id="id_is_menu" type="checkbox" name="is_menu"
1047
  <?php
1048
  if ( esc_attr( get_option( 'is_menu' ) ) == 'on' ) {
1049
- echo 'checked';}
1050
- ?>
1051
  /><label for="id_is_menu" style="font-weight: normal;margin-left: 20px;font-style: italic;display: inline-block;"><?php esc_html_e( 'Check if you want to display the button in the navigation menu.', 'weglot' ); ?></label></td>
1052
  </tr>
1053
  <tr valign="top">
@@ -1091,8 +306,7 @@ color: blue!important;
1091
  <td><input id="id_auto_switch" type="checkbox" name="wg_auto_switch"
1092
  <?php
1093
  if ( esc_attr( get_option( 'wg_auto_switch' ) ) == 'on' ) {
1094
- echo 'checked';}
1095
- ?>
1096
  /><label for="id_auto_switch" style="font-weight: normal;margin-left: 20px;font-style: italic;display: inline-block;"><?php esc_html_e( 'Check if you want to redirect users based on their browser language.', 'weglot' ); ?></label></td>
1097
  </tr>
1098
  </table>
@@ -1119,8 +333,7 @@ text-align: right;
1119
  <?php submit_button(); ?>
1120
  </form>
1121
  <?php
1122
- if ( esc_attr( get_option( 'show_box' ) ) == 'off' ) {
1123
- ?>
1124
  <div class="wginfobox">
1125
  <h3><?php esc_html_e( 'Where are my translations?','weglot' ); ?></h3>
1126
  <div>
9
  if ( WGUtils::hasLanguageRTL( explode( ',',$this->destination_l ) ) ) {
10
  $showRTL = true;
11
  }
12
+ } ?>
 
13
  <div class="wrap">
14
  <?php if ( $this->allowed == 0 ) { ?>
15
  <div class="wg-status-box">
63
  <th scope="row"><?php esc_html_e( 'Original Language', 'weglot' ); ?><p style="font-weight:normal;margin-top:2px;"><?php esc_html_e( 'What is the original (current) language of your website?', 'weglot' ); ?></p></th>
64
  <td>
65
  <select class="wg-input-select" name="original_l" style="width :200px;">
66
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'af' ) { echo 'selected'; } ?> value="af"><?php esc_html_e( 'Afrikaans', 'weglot' ); ?></option>
67
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'sq' ) { echo 'selected'; } ?> value="sq"><?php esc_html_e( 'Albanian', 'weglot' ); ?></option>
68
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'ar' ) { echo 'selected'; } ?> value="ar"><?php esc_html_e( 'Arabic', 'weglot' ); ?></option>
69
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'hy' ) { echo 'selected'; } ?> value="hy"><?php esc_html_e( 'Armenian', 'weglot' ); ?></option>
70
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'az' ) { echo 'selected'; } ?> value="az"><?php esc_html_e( 'Azerbaijani', 'weglot' ); ?></option>
71
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'eu' ) { echo 'selected'; } ?> value="eu"><?php esc_html_e( 'Basque', 'weglot' ); ?></option>
72
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'bn' ) { echo 'selected'; } ?> value="bn"><?php esc_html_e( 'Bengali', 'weglot' ); ?></option>
73
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'bs' ) { echo 'selected'; } ?> value="bs"><?php esc_html_e( 'Bosnian', 'weglot' ); ?></option>
74
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'be' ) { echo 'selected'; } ?> value="be"><?php esc_html_e( 'Belarusian', 'weglot' ); ?></option>
75
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'bg' ) { echo 'selected'; } ?> value="bg"><?php esc_html_e( 'Bulgarian', 'weglot' ); ?></option>
76
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'ca' ) { echo 'selected'; } ?> value="ca"><?php esc_html_e( 'Catalan', 'weglot' ); ?></option>
77
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'zh' ) { echo 'selected'; } ?> value="zh"><?php esc_html_e( 'Simplified Chinese', 'weglot' ); ?></option>
78
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'tw' ) { echo 'selected'; } ?> value="tw"><?php esc_html_e( 'Traditional Chinese', 'weglot' ); ?></option>
79
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'hr' ) { echo 'selected'; } ?> value="hr"><?php esc_html_e( 'Croatian', 'weglot' ); ?></option>
80
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'cs' ) { echo 'selected'; } ?> value="cs"><?php esc_html_e( 'Czech', 'weglot' ); ?></option>
81
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'da' ) { echo 'selected'; } ?> value="da"><?php esc_html_e( 'Danish', 'weglot' ); ?></option>
82
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'nl' ) { echo 'selected'; } ?> value="nl"><?php esc_html_e( 'Dutch', 'weglot' ); ?></option>
83
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'en'|| !get_option( 'original_l' ) ) { echo 'selected'; } ?> value="en"><?php esc_html_e( 'English', 'weglot' ); ?></option>
84
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'et' ) { echo 'selected'; } ?> value="et"><?php esc_html_e( 'Estonian', 'weglot' ); ?></option>
85
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'fj' ) { echo 'selected'; } ?> value="fj"><?php esc_html_e( 'Fijian', 'weglot' ); ?></option>
86
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'fi' ) { echo 'selected'; } ?> value="fi"><?php esc_html_e( 'Finnish', 'weglot' ); ?></option>
87
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'fr' ) { echo 'selected'; } ?> value="fr"><?php esc_html_e( 'French', 'weglot' ); ?></option>
88
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'ka' ) { echo 'selected'; } ?> value="ka"><?php esc_html_e( 'Georgian', 'weglot' ); ?></option>
89
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'de' ) { echo 'selected'; } ?> value="de"><?php esc_html_e( 'German', 'weglot' ); ?></option>
90
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'el' ) { echo 'selected'; } ?> value="el"><?php esc_html_e( 'Greek', 'weglot' ); ?></option>
91
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'ht' ) { echo 'selected'; } ?> value="ht"><?php esc_html_e( 'Haitian', 'weglot' ); ?></option>
92
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'he' ) { echo 'selected'; } ?> value="he"><?php esc_html_e( 'Hebrew', 'weglot' ); ?></option>
93
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'hi' ) { echo 'selected'; } ?> value="hi"><?php esc_html_e( 'Hindi', 'weglot' ); ?></option>
94
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'hu' ) { echo 'selected'; } ?> value="hu"><?php esc_html_e( 'Hungarian', 'weglot' ); ?></option>
95
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'is' ) { echo 'selected'; } ?> value="is"><?php esc_html_e( 'Icelandic', 'weglot' ); ?></option>
96
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'id' ) { echo 'selected'; } ?> value="id"><?php esc_html_e( 'Indonesian', 'weglot' ); ?></option>
97
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'ga' ) { echo 'selected'; } ?> value="ga"><?php esc_html_e( 'Irish', 'weglot' ); ?></option>
98
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'it' ) { echo 'selected'; } ?> value="it"><?php esc_html_e( 'Italian', 'weglot' ); ?></option>
99
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'ja' ) { echo 'selected'; } ?> value="ja"><?php esc_html_e( 'Japanese', 'weglot' ); ?></option>
100
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'kk' ) { echo 'selected'; } ?> value="kk"><?php esc_html_e( 'Kazakh', 'weglot' ); ?></option>
101
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'ko' ) { echo 'selected'; } ?> value="ko"><?php esc_html_e( 'Korean', 'weglot' ); ?></option>
102
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'ky' ) { echo 'selected'; } ?> value="ky"><?php esc_html_e( 'Kyrgyz', 'weglot' ); ?></option>
103
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'lv' ) { echo 'selected'; } ?> value="lv"><?php esc_html_e( 'Latvian', 'weglot' ); ?></option>
104
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'lt' ) { echo 'selected'; } ?> value="lt"><?php esc_html_e( 'Lithuanian', 'weglot' ); ?></option>
105
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'mk' ) { echo 'selected'; } ?> value="mk"><?php esc_html_e( 'Macedonian', 'weglot' ); ?></option>
106
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'mg' ) { echo 'selected'; } ?> value="mg"><?php esc_html_e( 'Malagasy', 'weglot' ); ?></option>
107
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'ms' ) { echo 'selected'; } ?> value="ms"><?php esc_html_e( 'Malay', 'weglot' ); ?></option>
108
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'mt' ) { echo 'selected'; } ?> value="mt"><?php esc_html_e( 'Maltese', 'weglot' ); ?></option>
109
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'mn' ) { echo 'selected'; } ?> value="mn"><?php esc_html_e( 'Mongolian', 'weglot' ); ?></option>
110
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'no' ) { echo 'selected'; } ?> value="no"><?php esc_html_e( 'Norwegian', 'weglot' ); ?></option>
111
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'fa' ) { echo 'selected'; } ?> value="fa"><?php esc_html_e( 'Persian', 'weglot' ); ?></option>
112
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'pl' ) { echo 'selected'; } ?> value="pl"><?php esc_html_e( 'Polish', 'weglot' ); ?></option>
113
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'pt' ) { echo 'selected'; } ?> value="pt"><?php esc_html_e( 'Portuguese', 'weglot' ); ?></option>
114
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'ro' ) { echo 'selected'; } ?> value="ro"><?php esc_html_e( 'Romanian', 'weglot' ); ?></option>
115
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'ru' ) { echo 'selected'; } ?> value="ru"><?php esc_html_e( 'Russian', 'weglot' ); ?></option>
116
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'sm' ) { echo 'selected'; } ?> value="sm"><?php esc_html_e( 'Samoan', 'weglot' ); ?></option>
117
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'sr' ) { echo 'selected'; } ?> value="sr"><?php esc_html_e( 'Serbian', 'weglot' ); ?></option>
118
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'sk' ) { echo 'selected'; } ?> value="sk"><?php esc_html_e( 'Slovak', 'weglot' ); ?></option>
119
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'sl' ) { echo 'selected'; } ?> value="sl"><?php esc_html_e( 'Slovenian', 'weglot' ); ?></option>
120
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'es' ) { echo 'selected'; } ?> value="es"><?php esc_html_e( 'Spanish', 'weglot' ); ?></option>
121
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'sw' ) { echo 'selected'; } ?> value="sw"><?php esc_html_e( 'Swahili', 'weglot' ); ?></option>
122
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'sv' ) { echo 'selected'; } ?> value="sv"><?php esc_html_e( 'Swedish', 'weglot' ); ?></option>
123
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'ty' ) { echo 'selected'; } ?> value="ty"><?php esc_html_e( 'Tahitian', 'weglot' ); ?></option>
124
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'tg' ) { echo 'selected'; } ?> value="tg"><?php esc_html_e( 'Tajik', 'weglot' ); ?></option>
125
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'th' ) { echo 'selected'; } ?> value="th"><?php esc_html_e( 'Thai', 'weglot' ); ?></option>
126
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'to' ) { echo 'selected'; } ?> value="to"><?php esc_html_e( 'Tongan', 'weglot' ); ?></option>
127
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'tr' ) { echo 'selected'; } ?> value="tr"><?php esc_html_e( 'Turkish', 'weglot' ); ?></option>
128
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'uk' ) { echo 'selected'; } ?> value="uk"><?php esc_html_e( 'Ukrainian', 'weglot' ); ?></option>
129
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'ur' ) { echo 'selected'; } ?> value="ur"><?php esc_html_e( 'Urdu', 'weglot' ); ?></option>
130
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'uz' ) { echo 'selected'; } ?> value="uz"><?php esc_html_e( 'Uzbek', 'weglot' ); ?></option>
131
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'vi' ) { echo 'selected'; } ?> value="vi"><?php esc_html_e( 'Vietnamese', 'weglot' ); ?></option>
132
+ <option <?php if ( esc_attr( get_option( 'original_l' ) ) == 'cy' ) { echo 'selected'; } ?> value="cy"><?php esc_html_e( 'Welsh', 'weglot' ); ?></option>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  </select>
134
  </td>
135
  </tr>
137
  <th scope="row"><?php esc_html_e( 'Destination Languages', 'weglot' ); ?><p style="font-weight:normal;margin-top:2px;"><?php echo sprintf( esc_html__( 'Choose languages you want to translate into. Supported languages can be found %1$shere%2$s.', 'weglot' ), '<a target="_blank" href="https://weglot.com/translation-api#languages_code">', '</a>' ); ?></p></th>
138
  <td>
139
  <div style="display:inline-block;width:300px; margin-top: 35px;">
140
+ <select id="select-lto" multiple class="demo-default" style="" placeholder="French, German, Italian, Portuguese, …" name="destination_l" > <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'fr' ) !== false ) { echo 'selected'; } ?> value="fr"><?php esc_html_e( 'French', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'en' ) !== false ) { echo 'selected'; } ?> value="en"><?php esc_html_e( 'English', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'zh' ) !== false ) { echo 'selected'; } ?> value="zh"><?php esc_html_e( 'Simplified Chinese', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'tw' ) !== false ) { echo 'selected'; } ?> value="tw"><?php esc_html_e( 'Traditional Chinese', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ru' ) !== false ) { echo 'selected'; } ?> value="ru"><?php esc_html_e( 'Russian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'de' ) !== false ) { echo 'selected'; } ?> value="de"><?php esc_html_e( 'German', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'es' ) !== false ) { echo 'selected'; } ?> value="es"><?php esc_html_e( 'Spanish', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'sq' ) !== false ) { echo 'selected'; } ?> value="sq"><?php esc_html_e( 'Albanian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ar' ) !== false ) { echo 'selected'; } ?> value="ar"><?php esc_html_e( 'Arabic', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'hy' ) !== false ) { echo 'selected'; } ?> value="hy"><?php esc_html_e( 'Armenian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'az' ) !== false ) { echo 'selected'; } ?> value="az"><?php esc_html_e( 'Azerbaijani', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'af' ) !== false ) { echo 'selected'; } ?> value="af"><?php esc_html_e( 'Afrikaans', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'eu' ) !== false ) { echo 'selected'; } ?> value="eu"><?php esc_html_e( 'Basque', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'be' ) !== false ) { echo 'selected'; } ?> value="be"><?php esc_html_e( 'Belarusian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'bg' ) !== false ) { echo 'selected'; } ?> value="bg"><?php esc_html_e( 'Bulgarian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'bs' ) !== false ) { echo 'selected'; } ?> value="bs"><?php esc_html_e( 'Bosnian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'vi' ) !== false ) { echo 'selected'; } ?> value="vi"><?php esc_html_e( 'Vietnamese', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'hu' ) !== false ) { echo 'selected'; } ?> value="hu"><?php esc_html_e( 'Hungarian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ht' ) !== false ) { echo 'selected'; } ?> value="ht"><?php esc_html_e( 'Haitian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'nl' ) !== false ) { echo 'selected'; } ?> value="nl"><?php esc_html_e( 'Dutch', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'el' ) !== false ) { echo 'selected'; } ?> value="el"><?php esc_html_e( 'Greek', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ka' ) !== false ) { echo 'selected'; } ?> value="ka"><?php esc_html_e( 'Georgian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'da' ) !== false ) { echo 'selected'; } ?> value="da"><?php esc_html_e( 'Danish', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'he' ) !== false ) { echo 'selected'; } ?> value="he"><?php esc_html_e( 'Hebrew', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'id' ) !== false ) { echo 'selected'; } ?> value="id"><?php esc_html_e( 'Indonesian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ga' ) !== false ) { echo 'selected'; } ?> value="ga"><?php esc_html_e( 'Irish', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'it' ) !== false ) { echo 'selected'; } ?> value="it"><?php esc_html_e( 'Italian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'is' ) !== false ) { echo 'selected'; } ?> value="is"><?php esc_html_e( 'Icelandic', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'kk' ) !== false ) { echo 'selected'; } ?> value="kk"><?php esc_html_e( 'Kazakh', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ca' ) !== false ) { echo 'selected'; } ?> value="ca"><?php esc_html_e( 'Catalan', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ky' ) !== false ) { echo 'selected'; } ?> value="ky"><?php esc_html_e( 'Kyrgyz', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ko' ) !== false ) { echo 'selected'; } ?> value="ko"><?php esc_html_e( 'Korean', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'lv' ) !== false ) { echo 'selected'; } ?> value="lv"><?php esc_html_e( 'Latvian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'lt' ) !== false ) { echo 'selected'; } ?> value="lt"><?php esc_html_e( 'Lithuanian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'mg' ) !== false ) { echo 'selected'; } ?> value="mg"><?php esc_html_e( 'Malagasy', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ms' ) !== false ) { echo 'selected'; } ?> value="ms"><?php esc_html_e( 'Malay', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'mt' ) !== false ) { echo 'selected'; } ?> value="mt"><?php esc_html_e( 'Maltese', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'mk' ) !== false ) { echo 'selected'; } ?> value="mk"><?php esc_html_e( 'Macedonian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'mn' ) !== false ) { echo 'selected'; } ?> value="mn"><?php esc_html_e( 'Mongolian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'no' ) !== false ) { echo 'selected'; } ?> value="no"><?php esc_html_e( 'Norwegian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'fa' ) !== false ) { echo 'selected'; } ?> value="fa"><?php esc_html_e( 'Persian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'pl' ) !== false ) { echo 'selected'; } ?> value="pl"><?php esc_html_e( 'Polish', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'pt' ) !== false ) { echo 'selected'; } ?> value="pt"><?php esc_html_e( 'Portuguese', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ro' ) !== false ) { echo 'selected'; } ?> value="ro"><?php esc_html_e( 'Romanian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'sr' ) !== false ) { echo 'selected'; } ?> value="sr"><?php esc_html_e( 'Serbian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'sk' ) !== false ) { echo 'selected'; } ?> value="sk"><?php esc_html_e( 'Slovak', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'sl' ) !== false ) { echo 'selected'; } ?> value="sl"><?php esc_html_e( 'Slovenian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'sw' ) !== false ) { echo 'selected'; } ?> value="sw"><?php esc_html_e( 'Swahili', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'tg' ) !== false ) { echo 'selected'; } ?> value="tg"><?php esc_html_e( 'Tajik', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'th' ) !== false ) { echo 'selected'; } ?> value="th"><?php esc_html_e( 'Thai', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'tr' ) !== false ) { echo 'selected'; } ?> value="tr"><?php esc_html_e( 'Turkish', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'uz' ) !== false ) { echo 'selected'; } ?> value="uz"><?php esc_html_e( 'Uzbek', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'uk' ) !== false ) { echo 'selected'; } ?> value="uk"><?php esc_html_e( 'Ukrainian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'fi' ) !== false ) { echo 'selected'; } ?> value="fi"><?php esc_html_e( 'Finnish', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'hr' ) !== false ) { echo 'selected'; } ?> value="hr"><?php esc_html_e( 'Croatian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'cs' ) !== false ) { echo 'selected'; } ?> value="cs"><?php esc_html_e( 'Czech', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'sv' ) !== false ) { echo 'selected'; } ?> value="sv"><?php esc_html_e( 'Swedish', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'et' ) !== false ) { echo 'selected'; } ?> value="et"><?php esc_html_e( 'Estonian', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ja' ) !== false ) { echo 'selected'; } ?> value="ja"><?php esc_html_e( 'Japanese', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'hi' ) !== false ) { echo 'selected'; } ?> value="hi"><?php esc_html_e( 'Hindi', 'weglot' ); ?></option> <option <?php if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'ur' ) !== false ) { echo 'selected'; } ?> value="ur"><?php esc_html_e( 'Urdu', 'weglot' ); ?></option>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
  <option
142
  <?php
143
  if ( strpos( esc_attr( get_option( 'destination_l' ) ) , 'bn' ) !== false ) {
178
  </div>
179
  <input id="destination_input_hidden" type="text" class="wg-input-text" name="destination_l" value="<?php echo esc_attr( get_option( 'destination_l' ) ); ?>" placeholder="en,es" required style="display:none;" />
180
  <?php
181
+ if ( $this->userInfo['plan'] <= 0 ) { ?>
182
+ <p class="wg-fsubtext"><?php echo sprintf( esc_html__( 'On the free plan, you can only choose one language and a maximum of 2000 words. If you want to use more than 1 language and 2000 words, please %1$supgrade your plan%2$s.', 'weglot' ), '<a target="_blank" href="https://weglot.com/change-plan">', '</a>' ); ?></p><?php } ?> <?php if ( $this->userInfo['plan'] >= 18 && $this->userInfo['plan'] <= 19 ) { ?> <p class="wg-fsubtext"><?php echo sprintf( esc_html__( 'On the Starter plan, you can only choose one language. If you want to use more than 1 language, please %1$supgrade your plan%2$s.', 'weglot' ), '<a target="_blank" href="https://weglot.com/change-plan">', '</a>' ); ?></p><?php } ?>
 
 
 
 
 
183
  </td>
184
  </tr>
185
  </table>
191
  <td><input id="id_is_dropdown" type="checkbox" name="is_dropdown"
192
  <?php
193
  if ( esc_attr( get_option( 'is_dropdown' ) ) == 'on' ) {
194
+ echo 'checked';} ?>
 
195
  /><label for="id_is_dropdown" style="font-weight: normal;margin-left: 20px;font-style: italic;display: inline-block;"><?php esc_html_e( 'Check if you want the button to be a dropdown box.', 'weglot' ); ?></label></td>
196
  </tr>
197
  <tr valign="top">
199
  <td><input id="id_with_flags" type="checkbox" name="with_flags"
200
  <?php
201
  if ( esc_attr( get_option( 'with_flags' ) ) == 'on' ) {
202
+ echo 'checked';} ?>
 
203
  /><label for="id_with_flags" style="font-weight: normal;margin-left: 20px;font-style: italic;display: inline-block;"><?php esc_html_e( 'Check if you want flags in the language button.', 'weglot' ); ?></label></td>
204
  </tr>
205
  <tr valign="top">
206
  <th scope="row"><?php esc_html_e( 'Type of flags', 'weglot' ); ?></th>
207
  <td>
208
  <select class="wg-input-select" name="type_flags" style="width :200px;">
209
+ <option <?php if ( esc_attr( get_option( 'type_flags' ) ) == '0' ) { echo 'selected'; } ?> value="0"><?php esc_html_e( 'Rectangle mat', 'weglot' ); ?></option>
210
+ <option <?php if ( esc_attr( get_option( 'type_flags' ) ) == '1' ) { echo 'selected'; } ?> value="1"><?php esc_html_e( 'Rectangle shiny', 'weglot' ); ?></option>
211
+ <option <?php if ( esc_attr( get_option( 'type_flags' ) ) == '2' ) { echo 'selected'; } ?> value="2"><?php esc_html_e( 'Square', 'weglot' ); ?></option>
212
+ <option <?php if ( esc_attr( get_option( 'type_flags' ) ) == '3' ) { echo 'selected'; } ?> value="3"><?php esc_html_e( 'Circle', 'weglot' ); ?></option>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  </select>
214
  <div class="flag-style-openclose"><?php esc_html_e( 'Change country flags','weglot' ); ?></div>
215
  <div class="flag-style-wrapper" style="display:none;">
216
+ <select class="flag-en-type wg-input-select"> <option value=0><?php esc_html_e( 'Choose English flag:','weglot' ); ?></option> <option value=0><?php esc_html_e( 'United Kingdom (default)','weglot' ); ?></option> <option value=1><?php esc_html_e( 'United States','weglot' ); ?></option> <option value=2><?php esc_html_e( 'Australia','weglot' ); ?></option> <option value=3><?php esc_html_e( 'Canada','weglot' ); ?></option> <option value=4><?php esc_html_e( 'New Zealand','weglot' ); ?></option> <option value=5><?php esc_html_e( 'Jamaica','weglot' ); ?></option> <option value=6><?php esc_html_e( 'Ireland','weglot' ); ?></option>
 
 
 
 
 
 
 
 
217
  </select>
218
+ <select class="flag-es-type wg-input-select"> <option value=0><?php esc_html_e( 'Choose Spanish flag:','weglot' ); ?></option> <option value=0><?php esc_html_e( 'Spain (default)','weglot' ); ?></option> <option value=1><?php esc_html_e( 'Mexico','weglot' ); ?></option> <option value=2><?php esc_html_e( 'Argentina','weglot' ); ?></option> <option value=3><?php esc_html_e( 'Colombia','weglot' ); ?></option> <option value=4><?php esc_html_e( 'Peru','weglot' ); ?></option> <option value=5><?php esc_html_e( 'Bolivia','weglot' ); ?></option> <option value=6 ><?php esc_html_e( 'Uruguay','weglot' ); ?></option> <option value=7 ><?php esc_html_e( 'Venezuela','weglot' ); ?></option> <option value=8 ><?php esc_html_e( 'Chile','weglot' ); ?></option> <option value=9 ><?php esc_html_e( 'Ecuador','weglot' ); ?></option> <option value=10><?php esc_html_e( 'Guatemala','weglot' ); ?></option> <option value=11><?php esc_html_e( 'Cuba','weglot' ); ?></option> <option value=12><?php esc_html_e( 'Dominican Republic','weglot' ); ?></option> <option value=13><?php esc_html_e( 'Honduras','weglot' ); ?></option> <option value=14><?php esc_html_e( 'Paraguay','weglot' ); ?></option> <option value=15><?php esc_html_e( 'El Salvador','weglot' ); ?></option> <option value=16><?php esc_html_e( 'Nicaragua','weglot' ); ?></option> <option value=17><?php esc_html_e( 'Costa Rica','weglot' ); ?></option> <option value=18><?php esc_html_e( 'Puerto Rico','weglot' ); ?></option> <option value=19><?php esc_html_e( 'Panama','weglot' ); ?></option>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
  </select>
220
+ <select class="flag-pt-type wg-input-select"> <option value=0><?php esc_html_e( 'Choose Portuguese flag:','weglot' ); ?></option> <option value=0><?php esc_html_e( 'Brazil (default)','weglot' ); ?></option> <option value=1><?php esc_html_e( 'Portugal','weglot' ); ?></option>
 
 
 
221
  </select>
222
+ <select class="flag-fr-type wg-input-select"> <option value=0><?php esc_html_e( 'Choose French flag:','weglot' ); ?></option> <option value=0><?php esc_html_e( 'France (default)','weglot' ); ?></option> <option value=1><?php esc_html_e( 'Belgium','weglot' ); ?></option> <option value=2><?php esc_html_e( 'Canada','weglot' ); ?></option> <option value=3><?php esc_html_e( 'Switzerland','weglot' ); ?></option> <option value=4><?php esc_html_e( 'Luxemburg','weglot' ); ?></option>
 
 
 
 
 
 
223
  </select>
224
+ <select class="flag-ar-type wg-input-select"> <option value=0><?php esc_html_e( 'Choose Arabic flag:','weglot' ); ?></option> <option value=0><?php esc_html_e( 'Saudi Arabia (default)','weglot' ); ?></option> <option value=1><?php esc_html_e( 'Algeria','weglot' ); ?></option> <option value=2><?php esc_html_e( 'Egypt','weglot' ); ?></option> <option value=3><?php esc_html_e( 'Iraq','weglot' ); ?></option> <option value=4><?php esc_html_e( 'Jordan','weglot' ); ?></option> <option value=5><?php esc_html_e( 'Kuwait','weglot' ); ?></option> <option value=6><?php esc_html_e( 'Lebanon','weglot' ); ?></option> <option value=7><?php esc_html_e( 'Libya','weglot' ); ?></option> <option value=8><?php esc_html_e( 'Morocco','weglot' ); ?></option> <option value=9><?php esc_html_e( 'Qatar','weglot' ); ?></option> <option value=10><?php esc_html_e( 'Syria','weglot' ); ?></option> <option value=11><?php esc_html_e( 'Tunisia','weglot' ); ?></option> <option value=12><?php esc_html_e( 'United Arab Emirates','weglot' ); ?></option> <option value=13><?php esc_html_e( 'Yemen','weglot' ); ?></option>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
  </select>
226
  <p><?php esc_html_e( 'If you want to use a different flag, just ask us.','weglot' ); ?></p>
227
  </div>
232
  <td><input id="id_with_name" type="checkbox" name="with_name"
233
  <?php
234
  if ( esc_attr( get_option( 'with_name' ) ) == 'on' ) {
235
+ echo 'checked';} ?>
 
236
  /><label for="id_with_name" style="font-weight: normal;margin-left: 20px;font-style: italic;display: inline-block;"><?php esc_html_e( 'Check if you want to display the name of languages.', 'weglot' ); ?></label></td>
237
  </tr>
238
  <tr valign="top">
240
  <td><input id="id_is_fullname" type="checkbox" name="is_fullname"
241
  <?php
242
  if ( esc_attr( get_option( 'is_fullname' ) ) == 'on' ) {
243
+ echo 'checked';} ?>
 
244
  /><label for="id_is_fullname" style="font-weight: normal;margin-left: 20px;font-style: italic;display: inline-block;"><?php esc_html_e( 'Check if you want the name of the languge. Don\'t check if you want the language code.', 'weglot' ); ?></label></td>
245
  </tr>
246
  <tr valign="top">
262
  <td><input id="id_is_menu" type="checkbox" name="is_menu"
263
  <?php
264
  if ( esc_attr( get_option( 'is_menu' ) ) == 'on' ) {
265
+ echo 'checked';} ?>
 
266
  /><label for="id_is_menu" style="font-weight: normal;margin-left: 20px;font-style: italic;display: inline-block;"><?php esc_html_e( 'Check if you want to display the button in the navigation menu.', 'weglot' ); ?></label></td>
267
  </tr>
268
  <tr valign="top">
306
  <td><input id="id_auto_switch" type="checkbox" name="wg_auto_switch"
307
  <?php
308
  if ( esc_attr( get_option( 'wg_auto_switch' ) ) == 'on' ) {
309
+ echo 'checked';} ?>
 
310
  /><label for="id_auto_switch" style="font-weight: normal;margin-left: 20px;font-style: italic;display: inline-block;"><?php esc_html_e( 'Check if you want to redirect users based on their browser language.', 'weglot' ); ?></label></td>
311
  </tr>
312
  </table>
333
  <?php submit_button(); ?>
334
  </form>
335
  <?php
336
+ if ( esc_attr( get_option( 'show_box' ) ) == 'off' ) { ?>
 
337
  <div class="wginfobox">
338
  <h3><?php esc_html_e( 'Where are my translations?','weglot' ); ?></h3>
339
  <div>
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: remyb92
3
  Tags: translate,translation,language,multilingual,bilingual,international,localization,multilanguage,multi language,translations,translator,multilangues,traduction,traducteur,ubersetzung,mehrsprachig,traduccion,traduzione,vertaling,vertaler,meertalig
4
  Requires at least: 4.5
5
  Tested up to: 4.9
6
- Stable tag: 1.8.2
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -76,7 +76,7 @@ Weglot Translate is easy to set up:
76
 
77
  == Frequently Asked Questions ==
78
  = Is Weglot Translate free? =
79
- Weglot Translate is a freemium plugin: it is free for small websites (under 2000 words) with one translation language. If you need more, you can upgrade. Details of our pricing can be found [here]: (https://weglot.com/pricing)
80
 
81
  In any case, you can try Weglot free for 10 days.
82
  = Edit my translations =
@@ -147,6 +147,11 @@ See changelog for upgrade changes.
147
 
148
  == Changelog ==
149
 
 
 
 
 
 
150
  = 1.8.2 =
151
  * Fix pb when permalinks has no ending slash
152
  * Add notif when plugin is not congigured
3
  Tags: translate,translation,language,multilingual,bilingual,international,localization,multilanguage,multi language,translations,translator,multilangues,traduction,traducteur,ubersetzung,mehrsprachig,traduccion,traduzione,vertaling,vertaler,meertalig
4
  Requires at least: 4.5
5
  Tested up to: 4.9
6
+ Stable tag: 1.9
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
76
 
77
  == Frequently Asked Questions ==
78
  = Is Weglot Translate free? =
79
+ Weglot Translate is a freemium plugin: it is free for small websites (under 2000 words) with one translation language. If you need more, you can upgrade. Details of our pricing can be found [here](https://weglot.com/pricing)
80
 
81
  In any case, you can try Weglot free for 10 days.
82
  = Edit my translations =
147
 
148
  == Changelog ==
149
 
150
+ = 1.9 =
151
+ * Fix login redirection
152
+ * Add translation for Town, cities and other dynamic fields in WC checkout
153
+ * exclude URL now accepts full URL and any blank separator
154
+
155
  = 1.8.2 =
156
  * Fix pb when permalinks has no ending slash
157
  * Add notif when plugin is not congigured
weglot.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * @package Weglot
4
- * @version 1.8.2
5
  */
6
 
7
  /*
@@ -12,7 +12,7 @@ Author: Weglot Translate team
12
  Author URI: https://weglot.com/
13
  Text Domain: weglot
14
  Domain Path: /languages/
15
- Version: 1.8.2
16
  */
17
 
18
  /*
@@ -83,7 +83,7 @@ do_action( 'weg_fs_loaded' );
83
 
84
 
85
 
86
- define( 'WEGLOT_VERSION', '1.8.2' );
87
  define( 'WEGLOT_DIR', dirname( __FILE__ ) );
88
  define( 'WEGLOT_BNAME', plugin_basename( __FILE__ ) );
89
  define( 'WEGLOT_DIRURL', plugin_dir_url( __FILE__ ) );
@@ -178,6 +178,10 @@ class Weglot {
178
  add_filter( 'woocommerce_get_checkout_url' , array( &$this,'filter_woocommerce_get_cart_url'));
179
  add_filter( 'woocommerce_get_checkout_order_received_url', array( &$this,'filter_woocommerce_get_checkout_order_received_url'));
180
 
 
 
 
 
181
  //add_filter( 'wp_mail' , array( &$this, 'translate_emails'), 10,1);
182
 
183
  $apikey = get_option( 'project_key' );
@@ -220,6 +224,9 @@ class Weglot {
220
  }
221
  }
222
  }
 
 
 
223
  }
224
 
225
  // Get our only instance of Weglot class
@@ -344,6 +351,22 @@ class Weglot {
344
  }
345
  }
346
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
347
  public function translate_emails($args){
348
 
349
  $messageAndSubject = "<p>".$args['subject']."</p>".$args['message'];
@@ -370,6 +393,10 @@ class Weglot {
370
  echo wp_kses( $button, $this->getAllowedTags());
371
  }
372
 
 
 
 
 
373
 
374
 
375
  public function init_function() {
@@ -776,7 +803,7 @@ class Weglot {
776
  }
777
 
778
  public function isLinkAFile($current_url) {
779
- $files = array('pdf','rar','doc','docx','jpg','jpeg','png','ppt','pptx','xls','zip','mp4');
780
  foreach ($files as $file) {
781
  if ( WGUtils::endsWith( $current_url,'.'.$file )) {
782
  return true;
@@ -854,7 +881,20 @@ class Weglot {
854
  public function isEligibleURL( $url ) {
855
  $url = $this->URLToRelative( $url );
856
 
857
- $exclusions = preg_replace( '#\s+#',',',get_option( 'exclude_url' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
858
  $exclusions = $exclusions == '' ? '/amp(/)?$' : $exclusions . ',/amp(/)?$';
859
  $regex = explode( ',',$exclusions );
860
 
1
  <?php
2
  /**
3
  * @package Weglot
4
+ * @version 1.9
5
  */
6
 
7
  /*
12
  Author URI: https://weglot.com/
13
  Text Domain: weglot
14
  Domain Path: /languages/
15
+ Version: 1.9
16
  */
17
 
18
  /*
83
 
84
 
85
 
86
+ define( 'WEGLOT_VERSION', '1.9' );
87
  define( 'WEGLOT_DIR', dirname( __FILE__ ) );
88
  define( 'WEGLOT_BNAME', plugin_basename( __FILE__ ) );
89
  define( 'WEGLOT_DIRURL', plugin_dir_url( __FILE__ ) );
178
  add_filter( 'woocommerce_get_checkout_url' , array( &$this,'filter_woocommerce_get_cart_url'));
179
  add_filter( 'woocommerce_get_checkout_order_received_url', array( &$this,'filter_woocommerce_get_checkout_order_received_url'));
180
 
181
+ add_filter('woocommerce_login_redirect', array( &$this,'wg_log_redirect'));
182
+ add_filter( 'login_redirect', array( &$this,'wg_log_redirect'), 10, 3 );
183
+ add_filter( 'logout_redirect', array( &$this,'wg_log_redirect'), 10, 3 );
184
+
185
  //add_filter( 'wp_mail' , array( &$this, 'translate_emails'), 10,1);
186
 
187
  $apikey = get_option( 'project_key' );
224
  }
225
  }
226
  }
227
+ else {
228
+ add_shortcode( 'weglot_switcher', array( &$this, 'wg_switcher_creation_empty' ) );
229
+ }
230
  }
231
 
232
  // Get our only instance of Weglot class
351
  }
352
  }
353
 
354
+ public function wg_log_redirect( $redirect_to, $request, $user ) {
355
+
356
+ if($this->currentlang != $this->original_l) {
357
+ return $this->replaceUrl($redirect_to, $this->currentlang);
358
+ }
359
+ else {
360
+ if(isset($_SERVER['HTTP_REFERER'])) {
361
+ $l = $this->getLangFromUrl($this->URLToRelative( $_SERVER['HTTP_REFERER']));
362
+ if($l && $l != $this->original_l) {
363
+ return $this->replaceUrl($redirect_to, $l);
364
+ }
365
+ }
366
+ return $redirect_to;
367
+ }
368
+ }
369
+
370
  public function translate_emails($args){
371
 
372
  $messageAndSubject = "<p>".$args['subject']."</p>".$args['message'];
393
  echo wp_kses( $button, $this->getAllowedTags());
394
  }
395
 
396
+ public function wg_switcher_creation_empty() {
397
+ echo wp_kses( "", $this->getAllowedTags());
398
+ }
399
+
400
 
401
 
402
  public function init_function() {
803
  }
804
 
805
  public function isLinkAFile($current_url) {
806
+ $files = array('pdf','rar','doc','docx','jpg','jpeg','png','ppt','pptx','xls','zip','mp4','xlsx');
807
  foreach ($files as $file) {
808
  if ( WGUtils::endsWith( $current_url,'.'.$file )) {
809
  return true;
881
  public function isEligibleURL( $url ) {
882
  $url = $this->URLToRelative( $url );
883
 
884
+
885
+ //Format exclude URL
886
+ $excludeURL = get_option('exclude_url');
887
+ if(!empty($excludeURL)) {
888
+ $excludeURL = preg_replace('#\s+#',',',trim($excludeURL));
889
+ $excluded_urls = explode(',',$excludeURL);
890
+ foreach ($excluded_urls as &$ex_url) {
891
+ $ex_url = $this->URLToRelative($ex_url);
892
+ }
893
+ $excludeURL = implode(',',$excluded_urls);
894
+ }
895
+
896
+
897
+ $exclusions = preg_replace( '#\s+#',',',$excludeURL );
898
  $exclusions = $exclusions == '' ? '/amp(/)?$' : $exclusions . ',/amp(/)?$';
899
  $regex = explode( ',',$exclusions );
900