Weglot Translate – Translate your WP website - Version 3.3.5

Version Description

(12/04/2021) = * Add url from canonical if existing * Add vip code review * Increase timeout when updating setting and disable submit button * Adding message to tell user to purge cache from cache plugin after editing translation

Download this release

Release Info

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

Code changes from version 3.3.4 to 3.3.5

app/javascripts/settings/admin-button-preview.js CHANGED
@@ -15,8 +15,6 @@ const init_admin_button_preview = function () {
15
  return destination_languages.indexOf(itm.external_code) >= 0;
16
  })
17
 
18
- console.log(weglot_desination_languages)
19
-
20
  $("#weglot-css-inline").text(weglot_css.inline);
21
 
22
  // Change dropdown
@@ -44,7 +42,7 @@ const init_admin_button_preview = function () {
44
  );
45
  const is_fullname = $("#is_fullname").is(":checked");
46
 
47
- const label = is_fullname ? label_language.local : label_language.code.toUpperCase();
48
 
49
  $(".country-selector label a, .country-selector label span").text(label);
50
 
@@ -53,7 +51,7 @@ const init_admin_button_preview = function () {
53
  (lang) => lang.internal_code === $(itm).data("code-language")
54
  );
55
 
56
- const label = is_fullname ? li_language.local : li_language.code.toUpperCase();
57
 
58
  $(itm)
59
  .find("a")
15
  return destination_languages.indexOf(itm.external_code) >= 0;
16
  })
17
 
 
 
18
  $("#weglot-css-inline").text(weglot_css.inline);
19
 
20
  // Change dropdown
42
  );
43
  const is_fullname = $("#is_fullname").is(":checked");
44
 
45
+ const label = is_fullname ? label_language.local : label_language.internal_code.toUpperCase();
46
 
47
  $(".country-selector label a, .country-selector label span").text(label);
48
 
51
  (lang) => lang.internal_code === $(itm).data("code-language")
52
  );
53
 
54
+ const label = is_fullname ? li_language.local : li_language.internal_code.toUpperCase();
55
 
56
  $(itm)
57
  .find("a")
app/javascripts/settings/admin-check-api-key.js CHANGED
@@ -63,6 +63,11 @@ const init_admin_button_preview = function () {
63
  unvalidApiKey()
64
  });
65
  });
 
 
 
 
 
66
  }
67
 
68
  document.addEventListener('DOMContentLoaded', () => {
63
  unvalidApiKey()
64
  });
65
  });
66
+
67
+ $( ".toplevel_page_weglot-settings form" ).submit(function( event ) {
68
+ $("#wrap-weglot #submit").prop("disabled", true);
69
+ });
70
+
71
  }
72
 
73
  document.addEventListener('DOMContentLoaded', () => {
app/styles/flags.css DELETED
@@ -1,3 +0,0 @@
1
- .wg-flag,.wg-flag-square{width:22px;height:16px;display:inline-block !important;vertical-align:middle;background-size:cover;background-position-y:center;background-repeat:no-repeat;background-image:linear-gradient(#b0b3b8, #b0b3b8)}.wg-flag.wg-flag-af,.wg-flag-af.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/za.svg")}.wg-flag.wg-flag-am,.wg-flag-am.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/et.svg")}.wg-flag.wg-flag-ar,.wg-flag-ar.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/sa.svg")}.wg-flag.wg-flag-az,.wg-flag-az.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/az.svg")}.wg-flag.wg-flag-ba,.wg-flag-ba.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ru.svg")}.wg-flag.wg-flag-be,.wg-flag-be.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/by.svg")}.wg-flag.wg-flag-bg,.wg-flag-bg.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/bg.svg")}.wg-flag.wg-flag-bn,.wg-flag-bn.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/bd.svg")}.wg-flag.wg-flag-br,.wg-flag-br.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/br.svg")}.wg-flag.wg-flag-bs,.wg-flag-bs.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ba.svg")}.wg-flag.wg-flag-ca,.wg-flag-ca.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/es-ca.svg")}.wg-flag.wg-flag-co,.wg-flag-co.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flags/4x3/co.svg")}.wg-flag.wg-flag-cs,.wg-flag-cs.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/cz.svg")}.wg-flag.wg-flag-cy,.wg-flag-cy.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/gb-wls.svg")}.wg-flag.wg-flag-da,.wg-flag-da.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/dk.svg")}.wg-flag.wg-flag-de,.wg-flag-de.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/de.svg")}.wg-flag.wg-flag-el,.wg-flag-el.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/gr.svg")}.wg-flag.wg-flag-en,.wg-flag-en.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/gb.svg")}.wg-flag.wg-flag-eo,.wg-flag-eo.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flags/4x3/eo.svg")}.wg-flag.wg-flag-es,.wg-flag-es.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/es.svg")}.wg-flag.wg-flag-et,.wg-flag-et.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ee.svg")}.wg-flag.wg-flag-eu,.wg-flag-eu.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flags/4x3/eu.svg")}.wg-flag.wg-flag-fa,.wg-flag-fa.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ir.svg")}.wg-flag.wg-flag-fi,.wg-flag-fi.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/fi.svg")}.wg-flag.wg-flag-fj,.wg-flag-fj.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/fj.svg")}.wg-flag.wg-flag-fl,.wg-flag-fl.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ph.svg")}.wg-flag.wg-flag-fr,.wg-flag-fr.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/fr.svg")}.wg-flag.wg-flag-fy,.wg-flag-fy.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/nl.svg")}.wg-flag.wg-flag-ga,.wg-flag-ga.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ie.svg")}.wg-flag.wg-flag-gd,.wg-flag-gd.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/gb-sct.svg")}.wg-flag.wg-flag-gl,.wg-flag-gl.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/es-ga.svg")}.wg-flag.wg-flag-gu,.wg-flag-gu.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/in.svg")}.wg-flag.wg-flag-ha,.wg-flag-ha.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ne.svg")}.wg-flag.wg-flag-he,.wg-flag-he.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/il.svg")}.wg-flag.wg-flag-hi,.wg-flag-hi.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/in.svg")}.wg-flag.wg-flag-hr,.wg-flag-hr.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/hr.svg")}.wg-flag.wg-flag-ht,.wg-flag-ht.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ht.svg")}.wg-flag.wg-flag-hu,.wg-flag-hu.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/hu.svg")}.wg-flag.wg-flag-hw,.wg-flag-hw.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flags/4x3/hw.svg")}.wg-flag.wg-flag-hy,.wg-flag-hy.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/am.svg")}.wg-flag.wg-flag-id,.wg-flag-id.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/id.svg")}.wg-flag.wg-flag-ig,.wg-flag-ig.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ne.svg")}.wg-flag.wg-flag-is,.wg-flag-is.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/is.svg")}.wg-flag.wg-flag-it,.wg-flag-it.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/it.svg")}.wg-flag.wg-flag-ja,.wg-flag-ja.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/jp.svg")}.wg-flag.wg-flag-jv,.wg-flag-jv.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/id.svg")}.wg-flag.wg-flag-ka,.wg-flag-ka.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ge.svg")}.wg-flag.wg-flag-kk,.wg-flag-kk.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/kz.svg")}.wg-flag.wg-flag-km,.wg-flag-km.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/kh.svg")}.wg-flag.wg-flag-kn,.wg-flag-kn.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/in.svg")}.wg-flag.wg-flag-ko,.wg-flag-ko.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/kr.svg")}.wg-flag.wg-flag-ku,.wg-flag-ku.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/iq.svg")}.wg-flag.wg-flag-ky,.wg-flag-ky.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/kg.svg")}.wg-flag.wg-flag-la,.wg-flag-la.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/it.svg")}.wg-flag.wg-flag-lb,.wg-flag-lb.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/lu.svg")}.wg-flag.wg-flag-lo,.wg-flag-lo.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/la.svg")}.wg-flag.wg-flag-lt,.wg-flag-lt.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/lt.svg")}.wg-flag.wg-flag-lv,.wg-flag-lv.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/lv.svg")}.wg-flag.wg-flag-mg,.wg-flag-mg.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/mg.svg")}.wg-flag.wg-flag-mi,.wg-flag-mi.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/nz.svg")}.wg-flag.wg-flag-mk,.wg-flag-mk.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/mk.svg")}.wg-flag.wg-flag-ml,.wg-flag-ml.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/in.svg")}.wg-flag.wg-flag-mn,.wg-flag-mn.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/mn.svg")}.wg-flag.wg-flag-mr,.wg-flag-mr.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/in.svg")}.wg-flag.wg-flag-ms,.wg-flag-ms.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/my.svg")}.wg-flag.wg-flag-mt,.wg-flag-mt.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/mt.svg")}.wg-flag.wg-flag-my,.wg-flag-my.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/mm.svg")}.wg-flag.wg-flag-ne,.wg-flag-ne.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/np.svg")}.wg-flag.wg-flag-nl,.wg-flag-nl.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/nl.svg")}.wg-flag.wg-flag-no,.wg-flag-no.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/no.svg")}.wg-flag.wg-flag-ny,.wg-flag-ny.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/mw.svg")}.wg-flag.wg-flag-pa,.wg-flag-pa.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/in.svg")}.wg-flag.wg-flag-pl,.wg-flag-pl.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/pl.svg")}.wg-flag.wg-flag-ps,.wg-flag-ps.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/af.svg")}.wg-flag.wg-flag-pt,.wg-flag-pt.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/pt.svg")}.wg-flag.wg-flag-ro,.wg-flag-ro.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ro.svg")}.wg-flag.wg-flag-ru,.wg-flag-ru.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ru.svg")}.wg-flag.wg-flag-sd,.wg-flag-sd.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/pk.svg")}.wg-flag.wg-flag-si,.wg-flag-si.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/lk.svg")}.wg-flag.wg-flag-sk,.wg-flag-sk.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/sk.svg")}.wg-flag.wg-flag-sl,.wg-flag-sl.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/si.svg")}.wg-flag.wg-flag-sm,.wg-flag-sm.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ws.svg")}.wg-flag.wg-flag-sn,.wg-flag-sn.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/zw.svg")}.wg-flag.wg-flag-so,.wg-flag-so.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/so.svg")}.wg-flag.wg-flag-sq,.wg-flag-sq.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/al.svg")}.wg-flag.wg-flag-sr,.wg-flag-sr.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/rs.svg")}.wg-flag.wg-flag-st,.wg-flag-st.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ng.svg")}.wg-flag.wg-flag-su,.wg-flag-su.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/sd.svg")}.wg-flag.wg-flag-sv,.wg-flag-sv.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/se.svg")}.wg-flag.wg-flag-sw,.wg-flag-sw.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ke.svg")}.wg-flag.wg-flag-ta,.wg-flag-ta.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/in.svg")}.wg-flag.wg-flag-te,.wg-flag-te.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/in.svg")}.wg-flag.wg-flag-tg,.wg-flag-tg.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/tj.svg")}.wg-flag.wg-flag-th,.wg-flag-th.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/th.svg")}.wg-flag.wg-flag-tl,.wg-flag-tl.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/in.svg")}.wg-flag.wg-flag-to,.wg-flag-to.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/to.svg")}.wg-flag.wg-flag-tr,.wg-flag-tr.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/tr.svg")}.wg-flag.wg-flag-tt,.wg-flag-tt.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/tr.svg")}.wg-flag.wg-flag-tw,.wg-flag-tw.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/tw.svg")}.wg-flag.wg-flag-ty,.wg-flag-ty.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/pf.svg")}.wg-flag.wg-flag-uk,.wg-flag-uk.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ua.svg")}.wg-flag.wg-flag-ur,.wg-flag-ur.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/pk.svg")}.wg-flag.wg-flag-uz,.wg-flag-uz.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/uz.svg")}.wg-flag.wg-flag-vi,.wg-flag-vi.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/vn.svg")}.wg-flag.wg-flag-xh,.wg-flag-xh.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/za.svg")}.wg-flag.wg-flag-yi,.wg-flag-yi.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/il.svg")}.wg-flag.wg-flag-yo,.wg-flag-yo.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ng.svg")}.wg-flag.wg-flag-zh,.wg-flag-zh.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/cn.svg")}.wg-flag.wg-flag-zu,.wg-flag-zu.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/za.svg")}.wg-flag.wg-flag-hm,.wg-flag-hm.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flags/4x3/hm.svg")}.wg-flag.wg-flag-cb,.wg-flag-cb.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ph.svg")}.wg-flag.wg-flag-or,.wg-flag-or.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/in.svg")}.wg-flag.wg-flag-tk,.wg-flag-tk.wg-flag-square{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/tr.svg")}.wg-flag-square{width:16px}.wg-flag-square.wg-flag-af{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/za.svg")}.wg-flag-square.wg-flag-af{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/za.svg")}.wg-flag-square.wg-flag-am{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/et.svg")}.wg-flag-square.wg-flag-am{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/et.svg")}.wg-flag-square.wg-flag-ar{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/sa.svg")}.wg-flag-square.wg-flag-ar{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/sa.svg")}.wg-flag-square.wg-flag-az{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/az.svg")}.wg-flag-square.wg-flag-az{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/az.svg")}.wg-flag-square.wg-flag-ba{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ru.svg")}.wg-flag-square.wg-flag-ba{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/ru.svg")}.wg-flag-square.wg-flag-be{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/by.svg")}.wg-flag-square.wg-flag-be{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/by.svg")}.wg-flag-square.wg-flag-bg{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/bg.svg")}.wg-flag-square.wg-flag-bg{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/bg.svg")}.wg-flag-square.wg-flag-bn{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/bd.svg")}.wg-flag-square.wg-flag-bn{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/bd.svg")}.wg-flag-square.wg-flag-br{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/br.svg")}.wg-flag-square.wg-flag-br{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/br.svg")}.wg-flag-square.wg-flag-bs{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ba.svg")}.wg-flag-square.wg-flag-bs{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/ba.svg")}.wg-flag-square.wg-flag-ca{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/es-ca.svg")}.wg-flag-square.wg-flag-ca{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/es-ca.svg")}.wg-flag-square.wg-flag-co{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flags/4x3/co.svg")}.wg-flag-square.wg-flag-co{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flags/1x1/co.svg")}.wg-flag-square.wg-flag-cs{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/cz.svg")}.wg-flag-square.wg-flag-cs{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/cz.svg")}.wg-flag-square.wg-flag-cy{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/gb-wls.svg")}.wg-flag-square.wg-flag-cy{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/gb-wls.svg")}.wg-flag-square.wg-flag-da{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/dk.svg")}.wg-flag-square.wg-flag-da{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/dk.svg")}.wg-flag-square.wg-flag-de{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/de.svg")}.wg-flag-square.wg-flag-de{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/de.svg")}.wg-flag-square.wg-flag-el{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/gr.svg")}.wg-flag-square.wg-flag-el{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/gr.svg")}.wg-flag-square.wg-flag-en{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/gb.svg")}.wg-flag-square.wg-flag-en{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/gb.svg")}.wg-flag-square.wg-flag-eo{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flags/4x3/eo.svg")}.wg-flag-square.wg-flag-eo{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flags/1x1/eo.svg")}.wg-flag-square.wg-flag-es{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/es.svg")}.wg-flag-square.wg-flag-es{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/es.svg")}.wg-flag-square.wg-flag-et{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ee.svg")}.wg-flag-square.wg-flag-et{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/ee.svg")}.wg-flag-square.wg-flag-eu{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flags/4x3/eu.svg")}.wg-flag-square.wg-flag-eu{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flags/1x1/eu.svg")}.wg-flag-square.wg-flag-fa{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ir.svg")}.wg-flag-square.wg-flag-fa{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/ir.svg")}.wg-flag-square.wg-flag-fi{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/fi.svg")}.wg-flag-square.wg-flag-fi{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/fi.svg")}.wg-flag-square.wg-flag-fj{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/fj.svg")}.wg-flag-square.wg-flag-fj{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/fj.svg")}.wg-flag-square.wg-flag-fl{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ph.svg")}.wg-flag-square.wg-flag-fl{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/ph.svg")}.wg-flag-square.wg-flag-fr{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/fr.svg")}.wg-flag-square.wg-flag-fr{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/fr.svg")}.wg-flag-square.wg-flag-fy{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/nl.svg")}.wg-flag-square.wg-flag-fy{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/nl.svg")}.wg-flag-square.wg-flag-ga{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ie.svg")}.wg-flag-square.wg-flag-ga{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/ie.svg")}.wg-flag-square.wg-flag-gd{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/gb-sct.svg")}.wg-flag-square.wg-flag-gd{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/gb-sct.svg")}.wg-flag-square.wg-flag-gl{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/es-ga.svg")}.wg-flag-square.wg-flag-gl{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/es-ga.svg")}.wg-flag-square.wg-flag-gu{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/in.svg")}.wg-flag-square.wg-flag-gu{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/in.svg")}.wg-flag-square.wg-flag-ha{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ne.svg")}.wg-flag-square.wg-flag-ha{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/ne.svg")}.wg-flag-square.wg-flag-he{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/il.svg")}.wg-flag-square.wg-flag-he{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/il.svg")}.wg-flag-square.wg-flag-hi{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/in.svg")}.wg-flag-square.wg-flag-hi{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/in.svg")}.wg-flag-square.wg-flag-hr{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/hr.svg")}.wg-flag-square.wg-flag-hr{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/hr.svg")}.wg-flag-square.wg-flag-ht{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ht.svg")}.wg-flag-square.wg-flag-ht{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/ht.svg")}.wg-flag-square.wg-flag-hu{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/hu.svg")}.wg-flag-square.wg-flag-hu{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/hu.svg")}.wg-flag-square.wg-flag-hw{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flags/4x3/hw.svg")}.wg-flag-square.wg-flag-hw{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flags/1x1/hw.svg")}.wg-flag-square.wg-flag-hy{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/am.svg")}.wg-flag-square.wg-flag-hy{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/am.svg")}.wg-flag-square.wg-flag-id{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/id.svg")}.wg-flag-square.wg-flag-id{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/id.svg")}.wg-flag-square.wg-flag-ig{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ne.svg")}.wg-flag-square.wg-flag-ig{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/ne.svg")}.wg-flag-square.wg-flag-is{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/is.svg")}.wg-flag-square.wg-flag-is{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/is.svg")}.wg-flag-square.wg-flag-it{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/it.svg")}.wg-flag-square.wg-flag-it{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/it.svg")}.wg-flag-square.wg-flag-ja{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/jp.svg")}.wg-flag-square.wg-flag-ja{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/jp.svg")}.wg-flag-square.wg-flag-jv{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/id.svg")}.wg-flag-square.wg-flag-jv{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/id.svg")}.wg-flag-square.wg-flag-ka{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ge.svg")}.wg-flag-square.wg-flag-ka{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/ge.svg")}.wg-flag-square.wg-flag-kk{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/kz.svg")}.wg-flag-square.wg-flag-kk{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/kz.svg")}.wg-flag-square.wg-flag-km{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/kh.svg")}.wg-flag-square.wg-flag-km{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/kh.svg")}.wg-flag-square.wg-flag-kn{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/in.svg")}.wg-flag-square.wg-flag-kn{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/in.svg")}.wg-flag-square.wg-flag-ko{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/kr.svg")}.wg-flag-square.wg-flag-ko{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/kr.svg")}.wg-flag-square.wg-flag-ku{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/iq.svg")}.wg-flag-square.wg-flag-ku{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/iq.svg")}.wg-flag-square.wg-flag-ky{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/kg.svg")}.wg-flag-square.wg-flag-ky{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/kg.svg")}.wg-flag-square.wg-flag-la{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/it.svg")}.wg-flag-square.wg-flag-la{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/it.svg")}.wg-flag-square.wg-flag-lb{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/lu.svg")}.wg-flag-square.wg-flag-lb{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/lu.svg")}.wg-flag-square.wg-flag-lo{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/la.svg")}.wg-flag-square.wg-flag-lo{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/la.svg")}.wg-flag-square.wg-flag-lt{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/lt.svg")}.wg-flag-square.wg-flag-lt{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/lt.svg")}.wg-flag-square.wg-flag-lv{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/lv.svg")}.wg-flag-square.wg-flag-lv{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/lv.svg")}.wg-flag-square.wg-flag-mg{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/mg.svg")}.wg-flag-square.wg-flag-mg{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/mg.svg")}.wg-flag-square.wg-flag-mi{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/nz.svg")}.wg-flag-square.wg-flag-mi{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/nz.svg")}.wg-flag-square.wg-flag-mk{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/mk.svg")}.wg-flag-square.wg-flag-mk{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/mk.svg")}.wg-flag-square.wg-flag-ml{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/in.svg")}.wg-flag-square.wg-flag-ml{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/in.svg")}.wg-flag-square.wg-flag-mn{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/mn.svg")}.wg-flag-square.wg-flag-mn{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/mn.svg")}.wg-flag-square.wg-flag-mr{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/in.svg")}.wg-flag-square.wg-flag-mr{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/in.svg")}.wg-flag-square.wg-flag-ms{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/my.svg")}.wg-flag-square.wg-flag-ms{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/my.svg")}.wg-flag-square.wg-flag-mt{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/mt.svg")}.wg-flag-square.wg-flag-mt{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/mt.svg")}.wg-flag-square.wg-flag-my{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/mm.svg")}.wg-flag-square.wg-flag-my{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/mm.svg")}.wg-flag-square.wg-flag-ne{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/np.svg")}.wg-flag-square.wg-flag-ne{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/np.svg")}.wg-flag-square.wg-flag-nl{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/nl.svg")}.wg-flag-square.wg-flag-nl{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/nl.svg")}.wg-flag-square.wg-flag-no{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/no.svg")}.wg-flag-square.wg-flag-no{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/no.svg")}.wg-flag-square.wg-flag-ny{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/mw.svg")}.wg-flag-square.wg-flag-ny{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/mw.svg")}.wg-flag-square.wg-flag-pa{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/in.svg")}.wg-flag-square.wg-flag-pa{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/in.svg")}.wg-flag-square.wg-flag-pl{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/pl.svg")}.wg-flag-square.wg-flag-pl{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/pl.svg")}.wg-flag-square.wg-flag-ps{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/af.svg")}.wg-flag-square.wg-flag-ps{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/af.svg")}.wg-flag-square.wg-flag-pt{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/pt.svg")}.wg-flag-square.wg-flag-pt{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/pt.svg")}.wg-flag-square.wg-flag-ro{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ro.svg")}.wg-flag-square.wg-flag-ro{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/ro.svg")}.wg-flag-square.wg-flag-ru{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ru.svg")}.wg-flag-square.wg-flag-ru{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/ru.svg")}.wg-flag-square.wg-flag-sd{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/pk.svg")}.wg-flag-square.wg-flag-sd{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/pk.svg")}.wg-flag-square.wg-flag-si{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/lk.svg")}.wg-flag-square.wg-flag-si{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/lk.svg")}.wg-flag-square.wg-flag-sk{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/sk.svg")}.wg-flag-square.wg-flag-sk{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/sk.svg")}.wg-flag-square.wg-flag-sl{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/si.svg")}.wg-flag-square.wg-flag-sl{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/si.svg")}.wg-flag-square.wg-flag-sm{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ws.svg")}.wg-flag-square.wg-flag-sm{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/ws.svg")}.wg-flag-square.wg-flag-sn{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/zw.svg")}.wg-flag-square.wg-flag-sn{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/zw.svg")}.wg-flag-square.wg-flag-so{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/so.svg")}.wg-flag-square.wg-flag-so{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/so.svg")}.wg-flag-square.wg-flag-sq{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/al.svg")}.wg-flag-square.wg-flag-sq{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/al.svg")}.wg-flag-square.wg-flag-sr{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/rs.svg")}.wg-flag-square.wg-flag-sr{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/rs.svg")}.wg-flag-square.wg-flag-st{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ng.svg")}.wg-flag-square.wg-flag-st{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/ng.svg")}.wg-flag-square.wg-flag-su{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/sd.svg")}.wg-flag-square.wg-flag-su{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/sd.svg")}.wg-flag-square.wg-flag-sv{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/se.svg")}.wg-flag-square.wg-flag-sv{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/se.svg")}.wg-flag-square.wg-flag-sw{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ke.svg")}.wg-flag-square.wg-flag-sw{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/ke.svg")}.wg-flag-square.wg-flag-ta{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/in.svg")}.wg-flag-square.wg-flag-ta{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/in.svg")}.wg-flag-square.wg-flag-te{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/in.svg")}.wg-flag-square.wg-flag-te{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/in.svg")}.wg-flag-square.wg-flag-tg{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/tj.svg")}.wg-flag-square.wg-flag-tg{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/tj.svg")}.wg-flag-square.wg-flag-th{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/th.svg")}.wg-flag-square.wg-flag-th{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/th.svg")}.wg-flag-square.wg-flag-tl{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/in.svg")}.wg-flag-square.wg-flag-tl{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/in.svg")}.wg-flag-square.wg-flag-to{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/to.svg")}.wg-flag-square.wg-flag-to{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/to.svg")}.wg-flag-square.wg-flag-tr{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/tr.svg")}.wg-flag-square.wg-flag-tr{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/tr.svg")}.wg-flag-square.wg-flag-tt{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/tr.svg")}.wg-flag-square.wg-flag-tt{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/tr.svg")}.wg-flag-square.wg-flag-tw{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/tw.svg")}.wg-flag-square.wg-flag-tw{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/tw.svg")}.wg-flag-square.wg-flag-ty{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/pf.svg")}.wg-flag-square.wg-flag-ty{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/pf.svg")}.wg-flag-square.wg-flag-uk{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ua.svg")}.wg-flag-square.wg-flag-uk{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/ua.svg")}.wg-flag-square.wg-flag-ur{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/pk.svg")}.wg-flag-square.wg-flag-ur{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/pk.svg")}.wg-flag-square.wg-flag-uz{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/uz.svg")}.wg-flag-square.wg-flag-uz{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/uz.svg")}.wg-flag-square.wg-flag-vi{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/vn.svg")}.wg-flag-square.wg-flag-vi{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/vn.svg")}.wg-flag-square.wg-flag-xh{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/za.svg")}.wg-flag-square.wg-flag-xh{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/za.svg")}.wg-flag-square.wg-flag-yi{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/il.svg")}.wg-flag-square.wg-flag-yi{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/il.svg")}.wg-flag-square.wg-flag-yo{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ng.svg")}.wg-flag-square.wg-flag-yo{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/ng.svg")}.wg-flag-square.wg-flag-zh{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/cn.svg")}.wg-flag-square.wg-flag-zh{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/cn.svg")}.wg-flag-square.wg-flag-zu{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/za.svg")}.wg-flag-square.wg-flag-zu{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/za.svg")}.wg-flag-square.wg-flag-hm{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flags/4x3/hm.svg")}.wg-flag-square.wg-flag-hm{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flags/1x1/hm.svg")}.wg-flag-square.wg-flag-cb{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/ph.svg")}.wg-flag-square.wg-flag-cb{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/ph.svg")}.wg-flag-square.wg-flag-or{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/in.svg")}.wg-flag-square.wg-flag-or{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/in.svg")}.wg-flag-square.wg-flag-tk{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/4x3/tr.svg")}.wg-flag-square.wg-flag-tk{background-image:url("https://cdn.jsdelivr.net/gh/weglot/languages@1.6.0/images/flag-icon-css/1x1/tr.svg")}.wg-flag-merge{position:relative}.wg-flag-merge .wg-flag,.wg-flag-merge .wg-flag-square{position:absolute;left:0}.wg-flag-merge .wg-flag:last-child,.wg-flag-merge .wg-flag-square:last-child{-webkit-clip-path:polygon(100% 0%, 0% 100%, 100% 100%);clip-path:polygon(100% 0%, 0% 100%, 100% 100%)}
2
-
3
- /*# sourceMappingURL=styles.css.map */
 
 
 
dist/admin-js.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function o(a){if(t[a])return t[a].exports;var l=t[a]={i:a,l:!1,exports:{}};return e[a].call(l.exports,l,l.exports,o),l.l=!0,l.exports}o.m=e,o.c=t,o.d=function(e,t,a){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(o.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var l in e)o.d(a,l,function(t){return e[t]}.bind(null,l));return a},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/dist/",o(o.s=4)}([,function(e,t){Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),o=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var a=arguments[1],l=0;l<o;){var n=t[l];if(e.call(a,n,l,t))return n;l++}},configurable:!0,writable:!0})},function(e,t){Array.prototype.filter||(Array.prototype.filter=function(e,t){"use strict";if("Function"!=typeof e&&"function"!=typeof e||!this)throw new TypeError;var o=this.length>>>0,a=new Array(o),l=this,n=0,r=-1;if(void 0===t)for(;++r!==o;)r in this&&e(l[r],r,l)&&(a[n++]=l[r]);else for(;++r!==o;)r in this&&e.call(t,l[r],r,l)&&(a[n++]=l[r]);return a.length=n,a})},,function(e,t,o){"use strict";o.r(t);var a=function(){const e=jQuery;let t;const o=()=>{let o=e("#original_language").val();e("#original_language").on("change",(function(a){const l=o,n=o;o=a.target.value,t[0].selectize.removeOption(o);const r=weglot_languages.available.find(e=>e.internal_code===n),s=weglot_languages.available.find(e=>e.internal_code===o);t[0].selectize.addOption(r);const i=e("#is_fullname").is(":checked");let c="";e("#with_name").is(":checked")&&(c=i?s.local:s.internal_code.toUpperCase()),e(".wgcurrent.wg-li").removeClass(l).addClass(o).attr("data-code-language",o).find("span").text(c)})),t=e(".weglot-select-destination").selectize({delimiter:"|",persist:!1,valueField:"internal_code",labelField:"local",searchField:["internal_code","english","local"],sortField:[{field:"english",direction:"asc"}],maxItems:weglot_languages.limit,plugins:["remove_button"],options:weglot_languages.available.filter(e=>e.internal_code!==weglot_languages.original),render:{option:function(e,t){return`<div class="weglot__choice__language"><span class="weglot__choice__language--english">${t(e.english)}</span><span class="weglot__choice__language--local">${t(e.local)}[${t(e.external_code)}]</span></div>`}}}).on("change",o=>{const a=t[0].selectize.getValue(),l=e("#li-button-tpl");if(0===l.length)return;const n=e("#is_fullname").is(":checked"),r=e("#with_name").is(":checked"),s=e("#with_flags").is(":checked");let i="";s&&(i="weglot-flags");let c="";a.forEach(e=>{const t=weglot_languages.available.find(t=>t.internal_code===e);let o="";r&&(o=n?t.local:e.toUpperCase()),c+=l.html().replace("{LABEL_LANGUAGE}",o).replace(new RegExp("{CODE_LANGUAGE}","g"),e).replace("{CLASSES}",i)}),e(".country-selector ul").html(c)}),window.addEventListener("weglotCheckApi",e=>{let o=1e3;const a=e.detail.plan;a<=0||weglot_languages.plans.starter_free.ids.indexOf(a)>=0?o=weglot_languages.plans.starter_free.limit_language:weglot_languages.plans.business.ids.indexOf(a)>=0&&(o=weglot_languages.plans.business.limit_language),t[0].selectize.settings.maxItems=o})};document.addEventListener("DOMContentLoaded",()=>{o()})};var l=function(){const e=jQuery;document.addEventListener("DOMContentLoaded",()=>{e("#weglot-box-first-settings .weglot-btn-close").on("click",(function(t){t.preventDefault(),e("#weglot-box-first-settings").hide()}))})};var n=function(){const e=()=>{document.querySelector("#tpl-exclusion-url");const e=document.querySelector("#tpl-exclusion-block"),t=document.querySelector("#container-exclude_blocks");function o(e){e.preventDefault(),this.parentNode.remove()}document.querySelector("#js-add-exclude-block")&&document.querySelector("#js-add-exclude-block").addEventListener("click",a=>{a.preventDefault(),t.insertAdjacentHTML("beforeend",e.innerHTML),document.querySelector("#container-exclude_blocks .item-exclude:last-child .js-btn-remove-exclude").addEventListener("click",o)});document.querySelectorAll(".js-btn-remove").forEach(e=>{e.addEventListener("click",o)})};document.addEventListener("DOMContentLoaded",()=>{e()})};var r=function(){const e=jQuery,t=()=>{let t=e("#type_flags option:selected").data("value"),o=[];o.push(e(".country-selector label").data("code-language")),e(".country-selector li").each((t,a)=>{o.push(e(a).data("code-language"))});const a=weglot_languages.available.filter(e=>o.indexOf(e.external_code)>=0);console.log(a),e("#weglot-css-inline").text(weglot_css.inline),e("#is_dropdown").on("change",(function(){e(".country-selector").toggleClass("weglot-inline"),e(".country-selector").toggleClass("weglot-dropdown")})),e("#with_flags").on("change",(function(){e(".country-selector label, .country-selector li").toggleClass("weglot-flags")})),e("#type_flags").on("change",(function(o){e(".country-selector label, .country-selector li").removeClass("flag-"+t);const a=e(":selected",this).data("value");e(".country-selector label, .country-selector li").addClass("flag-"+a),t=a}));const l=()=>{const t=a.find(t=>t.external_code===e(".country-selector label").data("code-language")),o=e("#is_fullname").is(":checked"),l=o?t.local:t.code.toUpperCase();e(".country-selector label a, .country-selector label span").text(l),e(".country-selector li").each((t,l)=>{const n=a.find(t=>t.internal_code===e(l).data("code-language")),r=o?n.local:n.code.toUpperCase();e(l).find("a").text(r)})};e("#with_name").on("change",(function(t){t.target.checked?l():(e(".country-selector label a, .country-selector label span").text(""),e(".country-selector li a, .country-selector li span").each((t,o)=>{e(o).text("")}))})),e("#is_fullname").on("change",(function(t){if(e("#with_name").is(":checked"))if(t.target.checked)l();else{const t=a.find(t=>t.internal_code===e(".country-selector label").data("code-language"));e(".country-selector label a, .country-selector label span").text(t.internal_code.toUpperCase()),e(".country-selector li").each((t,o)=>{const l=a.find(t=>t.internal_code===e(o).data("code-language"));e(o).find("a").text(l.internal_code.toUpperCase()),e(o).find("span").text(l.internal_code.toUpperCase())})}})),e("#override_css").on("keyup",(function(t){e("#weglot-css-inline").text(t.target.value)}))};document.addEventListener("DOMContentLoaded",()=>{0!==e(".weglot-preview").length&&t()})};var s=function(){const e=jQuery,t=()=>{e("#api_key_private").blur((function(){var t=e(this).val();if(0===t.length)return e(".weglot-keyres").remove(),e("#api_key_private").after('<span class="weglot-keyres weglot-nokkey"></span>'),void e("#wrap-weglot #submit").prop("disabled",!0);function o(){e(".weglot-keyres").remove(),e("#api_key_private").after('<span class="weglot-keyres weglot-nokkey"></span><p class="weglot-keyres">Make sure you enter a valid Weglot API key. If the key is still not validating, you can contact your host provider and ask if it\'s possible to whitelist api.weglot.com and weglot.com</p>'),e("#wrap-weglot #submit").prop("disabled",!0)}e(".weglot-keyres").remove(),e("#api_key_private").after('<span class="weglot-keyres weglot-ckeckkey"></span>'),e.ajax({method:"POST",url:ajaxurl,data:{action:"get_user_info",api_key:t},success:({data:t,success:a})=>{e(".weglot-keyres").remove(),a?function(t){e(".weglot-keyres").remove(),e("#api_key_private").after('<span class="weglot-keyres weglot-okkey"></span>'),e("#wrap-weglot #submit").prop("disabled",!1);const o=new CustomEvent("weglotCheckApi",{detail:t});window.dispatchEvent(o)}(t):o()}}).fail((function(){o()}))}))};document.addEventListener("DOMContentLoaded",()=>{t()})};var i=function(){jQuery;document.addEventListener("DOMContentLoaded",()=>{jQuery(document).ready((function(e){wp.codeEditor.initialize(e("#override_css"),cm_settings)}))})};var c=function(){const e=jQuery;"undefined"!=typeof weglot_css&&e("#weglot-css-flag-css").text(weglot_css.flag_css);const t=()=>{e(".flag-style-openclose").on("click",(function(){e(".flag-style-wrapper").toggle()})),e(".old-flag-style").on("click",(function(){e(".old-flag-wrapper").toggle()})),e("select.flag-en-type, select.flag-es-type, select.flag-pt-type, select.flag-fr-type, select.flag-ar-type, select.flag-tw-type, select.flag-zh-type").on("change",(function(){!function(){var t=new Array,o=new Array,a=new Array,l=new Array,n=new Array,r=new Array,s=new Array;t[1]=[3570,7841,48,2712],t[2]=[3720,449,3048,4440],t[3]=[3840,1281,2712,4224],t[4]=[3240,5217,1224,2112],t[5]=[4050,3585,1944,2496],t[6]=[2340,3457,2016,2016],o[1]=[4320,4641,3144,3552],o[2]=[3750,353,2880,4656],o[3]=[4200,1601,2568,3192],o[4]=[3990,5793,1032,2232],o[5]=[5460,897,4104,3120],o[6]=[3810,7905,216,3888],o[7]=[3630,8065,192,2376],o[8]=[3780,1473,2496,4104],o[9]=[6120,2145,4680,2568],o[10]=[4440,3009,3240,1176],o[11]=[5280,1825,3936,2976],o[12]=[4770,2081,3624,1008],o[13]=[4080,3201,2160,2544],o[14]=[4590,5761,3432,624],o[15]=[4350,2209,3360,2688],o[16]=[5610,5249,3168,528],o[17]=[5070,1729,3792,2952],o[18]=[6870,5953,96,3408],o[19]=[4020,5697,1056,1224],a[1]=[2760,736,2856,4416],a[2]=[3840,1280,2712,4224],a[3]=[5700,7201,5016,2400],a[4]=[2220,4160,1632,1944],l[1]=[1830,129,3096,5664],l[2]=[5100,2177,3840,2904],l[3]=[4890,3425,3648,2136],l[4]=[1320,3681,1896,4080],l[5]=[1260,3841,1824,1200],l[6]=[1020,3969,1608,312],l[7]=[4800,4065,3600,72],l[8]=[4710,4865,3504,480],l[9]=[6720,5984,5112,3792],l[10]=[4500,7233,3288,1800],l[11]=[720,7522,384,3936],l[12]=[690,7745,336,1104],l[13]=[600,8225,120,1272],l[14]=[660,5569,840,576],n[1]=[3690,1505,2592,3240],n[2]=[3600,3233,2112,48],r[1]=[2970,6369,3408,4008],r[2]=[3600,3233,2112,48],s[1]=[6630,993,2784,4344];var i=e("select.flag-en-type").val(),c=e("select.flag-es-type").val(),g=e("select.flag-fr-type").val(),f=e("select.flag-ar-type").val(),p=e("select.flag-tw-type").val(),d=e("select.flag-zh-type").val(),u=e("select.flag-pt-type").val(),w=i<=0?"":".weglot-flags.en > a:before, .weglot-flags.en > span:before { background-position: -"+t[i][0]+"px 0 !important; } .weglot-flags.flag-1.en > a:before, .weglot-flags.flag-1.en > span:before { background-position: -"+t[i][1]+"px 0 !important; } .weglot-flags.flag-2.en > a:before, .weglot-flags.flag-2.en > span:before { background-position: -"+t[i][2]+"px 0 !important; } .weglot-flags.flag-3.en > a:before, .weglot-flags.flag-3.en > span:before { background-position: -"+t[i][3]+"px 0 !important; } ",b=c<=0?"":".weglot-flags.es > a:before, .weglot-flags.es > span:before { background-position: -"+o[c][0]+"px 0 !important; } .weglot-flags.flag-1.es > a:before, .weglot-flags.flag-1.es > span:before { background-position: -"+o[c][1]+"px 0 !important; } .weglot-flags.flag-2.es > a:before, .weglot-flags.flag-2.es > span:before { background-position: -"+o[c][2]+"px 0 !important; } .weglot-flags.flag-3.es > a:before, .weglot-flags.flag-3.es > span:before { background-position: -"+o[c][3]+"px 0 !important; } ",y=g<=0?"":".weglot-flags.fr > a:before, .weglot-flags.fr > span:before { background-position: -"+a[g][0]+"px 0 !important; } .weglot-flags.flag-1.fr > a:before, .weglot-flags.flag-1.fr > span:before { background-position: -"+a[g][1]+"px 0 !important; } .weglot-flags.flag-2.fr > a:before, .weglot-flags.flag-2.fr > span:before { background-position: -"+a[g][2]+"px 0 !important; } .weglot-flags.flag-3.fr > a:before, .weglot-flags.flag-3.fr > span:before { background-position: -"+a[g][3]+"px 0 !important; } ",m=f<=0?"":".weglot-flags.ar > a:before, .weglot-flags.ar > span:before { background-position: -"+l[f][0]+"px 0 !important; } .weglot-flags.flag-1.ar > a:before, .weglot-flags.flag-1.ar > span:before { background-position: -"+l[f][1]+"px 0 !important; } .weglot-flags.flag-2.ar > a:before, .weglot-flags.flag-2.ar > span:before { background-position: -"+l[f][2]+"px 0 !important; } .weglot-flags.flag-3.ar > a:before, .weglot-flags.flag-3.ar > span:before { background-position: -"+l[f][3]+"px 0 !important; } ",v=p<=0?"":".weglot-flags.tw > a:before, .weglot-flags.tw > span:before { background-position: -"+n[p][0]+"px 0 !important; } .weglot-flags.flag-1.tw > a:before, .weglot-flags.flag-1.tw > span:before { background-position: -"+n[p][1]+"px 0 !important; } .weglot-flags.flag-2.tw > a:before, .weglot-flags.flag-2.tw > span:before { background-position: -"+n[p][2]+"px 0 !important; } .weglot-flags.flag-3.tw > a:before, .weglot-flags.flag-3.tw > span:before { background-position: -"+n[p][3]+"px 0 !important; } ",_=d<=0?"":".weglot-flags.zh > a:before, .weglot-flags.zh > span:before { background-position: -"+r[d][0]+"px 0 !important; } .weglot-flags.flag-1.zh > a:before, .weglot-flags.flag-1.zh > span:before { background-position: -"+r[d][1]+"px 0 !important; } .weglot-flags.flag-2.zh > a:before, .weglot-flags.flag-2.zh > span:before { background-position: -"+r[d][2]+"px 0 !important; } .weglot-flags.flag-3.zh > a:before, .weglot-flags.flag-3.zh > span:before { background-position: -"+r[d][3]+"px 0 !important; } ",h=u<=0?"":".weglot-flags.pt > a:before, .weglot-flags.pt > span:before { background-position: -"+s[u][0]+"px 0 !important; } .weglot-flags.flag-1.pt > a:before, .weglot-flags.flag-1.pt > span:before { background-position: -"+s[u][1]+"px 0 !important; } .weglot-flags.flag-2.pt > a:before, .weglot-flags.flag-2.pt > span:before { background-position: -"+s[u][2]+"px 0 !important; } .weglot-flags.flag-3.pt > a:before, .weglot-flags.flag-3.pt > span:before { background-position: -"+s[u][3]+"px 0 !important; } ";e("#flag_css, #weglot-css-flag-css").text(w+b+y+m+v+_+h)}()}));var t=e("#flag_css").text();t.trim()&&e("#weglot-css-flag-css").text(t)};document.addEventListener("DOMContentLoaded",()=>{t()})};var g=function(){jQuery;document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelector("#private_mode");e&&0!=e.length&&(document.querySelector("#private_mode").addEventListener("change",(function(e){document.querySelectorAll(".private-mode-lang--input").forEach(t=>{t.checked=e.target.checked})})),document.querySelectorAll(".private-mode-lang--input").forEach(e=>{e.addEventListener("change",(function(e){0===document.querySelectorAll(".private-mode-lang--input:checked").length&&(document.querySelector("#private_mode").checked=!1)}))}))})};o(1),o(2);a(),n(),l(),r(),s(),i(),c(),g()}]);
1
+ !function(e){var t={};function o(a){if(t[a])return t[a].exports;var n=t[a]={i:a,l:!1,exports:{}};return e[a].call(n.exports,n,n.exports,o),n.l=!0,n.exports}o.m=e,o.c=t,o.d=function(e,t,a){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(o.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(a,n,function(t){return e[t]}.bind(null,n));return a},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/dist/",o(o.s=4)}([,function(e,t){Array.prototype.find||Object.defineProperty(Array.prototype,"find",{value:function(e){if(null==this)throw new TypeError('"this" is null or not defined');var t=Object(this),o=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var a=arguments[1],n=0;n<o;){var l=t[n];if(e.call(a,l,n,t))return l;n++}},configurable:!0,writable:!0})},function(e,t){Array.prototype.filter||(Array.prototype.filter=function(e,t){"use strict";if("Function"!=typeof e&&"function"!=typeof e||!this)throw new TypeError;var o=this.length>>>0,a=new Array(o),n=this,l=0,r=-1;if(void 0===t)for(;++r!==o;)r in this&&e(n[r],r,n)&&(a[l++]=n[r]);else for(;++r!==o;)r in this&&e.call(t,n[r],r,n)&&(a[l++]=n[r]);return a.length=l,a})},,function(e,t,o){"use strict";o.r(t);var a=function(){const e=jQuery;let t;const o=()=>{let o=e("#original_language").val();e("#original_language").on("change",(function(a){const n=o,l=o;o=a.target.value,t[0].selectize.removeOption(o);const r=weglot_languages.available.find(e=>e.internal_code===l),s=weglot_languages.available.find(e=>e.internal_code===o);t[0].selectize.addOption(r);const i=e("#is_fullname").is(":checked");let c="";e("#with_name").is(":checked")&&(c=i?s.local:s.internal_code.toUpperCase()),e(".wgcurrent.wg-li").removeClass(n).addClass(o).attr("data-code-language",o).find("span").text(c)})),t=e(".weglot-select-destination").selectize({delimiter:"|",persist:!1,valueField:"internal_code",labelField:"local",searchField:["internal_code","english","local"],sortField:[{field:"english",direction:"asc"}],maxItems:weglot_languages.limit,plugins:["remove_button"],options:weglot_languages.available.filter(e=>e.internal_code!==weglot_languages.original),render:{option:function(e,t){return`<div class="weglot__choice__language"><span class="weglot__choice__language--english">${t(e.english)}</span><span class="weglot__choice__language--local">${t(e.local)}[${t(e.external_code)}]</span></div>`}}}).on("change",o=>{const a=t[0].selectize.getValue(),n=e("#li-button-tpl");if(0===n.length)return;const l=e("#is_fullname").is(":checked"),r=e("#with_name").is(":checked"),s=e("#with_flags").is(":checked");let i="";s&&(i="weglot-flags");let c="";a.forEach(e=>{const t=weglot_languages.available.find(t=>t.internal_code===e);let o="";r&&(o=l?t.local:e.toUpperCase()),c+=n.html().replace("{LABEL_LANGUAGE}",o).replace(new RegExp("{CODE_LANGUAGE}","g"),e).replace("{CLASSES}",i)}),e(".country-selector ul").html(c)}),window.addEventListener("weglotCheckApi",e=>{let o=1e3;const a=e.detail.plan;a<=0||weglot_languages.plans.starter_free.ids.indexOf(a)>=0?o=weglot_languages.plans.starter_free.limit_language:weglot_languages.plans.business.ids.indexOf(a)>=0&&(o=weglot_languages.plans.business.limit_language),t[0].selectize.settings.maxItems=o})};document.addEventListener("DOMContentLoaded",()=>{o()})};var n=function(){const e=jQuery;document.addEventListener("DOMContentLoaded",()=>{e("#weglot-box-first-settings .weglot-btn-close").on("click",(function(t){t.preventDefault(),e("#weglot-box-first-settings").hide()}))})};var l=function(){const e=()=>{document.querySelector("#tpl-exclusion-url");const e=document.querySelector("#tpl-exclusion-block"),t=document.querySelector("#container-exclude_blocks");function o(e){e.preventDefault(),this.parentNode.remove()}document.querySelector("#js-add-exclude-block")&&document.querySelector("#js-add-exclude-block").addEventListener("click",a=>{a.preventDefault(),t.insertAdjacentHTML("beforeend",e.innerHTML),document.querySelector("#container-exclude_blocks .item-exclude:last-child .js-btn-remove-exclude").addEventListener("click",o)});document.querySelectorAll(".js-btn-remove").forEach(e=>{e.addEventListener("click",o)})};document.addEventListener("DOMContentLoaded",()=>{e()})};var r=function(){const e=jQuery,t=()=>{let t=e("#type_flags option:selected").data("value"),o=[];o.push(e(".country-selector label").data("code-language")),e(".country-selector li").each((t,a)=>{o.push(e(a).data("code-language"))});const a=weglot_languages.available.filter(e=>o.indexOf(e.external_code)>=0);e("#weglot-css-inline").text(weglot_css.inline),e("#is_dropdown").on("change",(function(){e(".country-selector").toggleClass("weglot-inline"),e(".country-selector").toggleClass("weglot-dropdown")})),e("#with_flags").on("change",(function(){e(".country-selector label, .country-selector li").toggleClass("weglot-flags")})),e("#type_flags").on("change",(function(o){e(".country-selector label, .country-selector li").removeClass("flag-"+t);const a=e(":selected",this).data("value");e(".country-selector label, .country-selector li").addClass("flag-"+a),t=a}));const n=()=>{const t=a.find(t=>t.external_code===e(".country-selector label").data("code-language")),o=e("#is_fullname").is(":checked"),n=o?t.local:t.internal_code.toUpperCase();e(".country-selector label a, .country-selector label span").text(n),e(".country-selector li").each((t,n)=>{const l=a.find(t=>t.internal_code===e(n).data("code-language")),r=o?l.local:l.internal_code.toUpperCase();e(n).find("a").text(r)})};e("#with_name").on("change",(function(t){t.target.checked?n():(e(".country-selector label a, .country-selector label span").text(""),e(".country-selector li a, .country-selector li span").each((t,o)=>{e(o).text("")}))})),e("#is_fullname").on("change",(function(t){if(e("#with_name").is(":checked"))if(t.target.checked)n();else{const t=a.find(t=>t.internal_code===e(".country-selector label").data("code-language"));e(".country-selector label a, .country-selector label span").text(t.internal_code.toUpperCase()),e(".country-selector li").each((t,o)=>{const n=a.find(t=>t.internal_code===e(o).data("code-language"));e(o).find("a").text(n.internal_code.toUpperCase()),e(o).find("span").text(n.internal_code.toUpperCase())})}})),e("#override_css").on("keyup",(function(t){e("#weglot-css-inline").text(t.target.value)}))};document.addEventListener("DOMContentLoaded",()=>{0!==e(".weglot-preview").length&&t()})};var s=function(){const e=jQuery,t=()=>{e("#api_key_private").blur((function(){var t=e(this).val();if(0===t.length)return e(".weglot-keyres").remove(),e("#api_key_private").after('<span class="weglot-keyres weglot-nokkey"></span>'),void e("#wrap-weglot #submit").prop("disabled",!0);function o(){e(".weglot-keyres").remove(),e("#api_key_private").after('<span class="weglot-keyres weglot-nokkey"></span><p class="weglot-keyres">Make sure you enter a valid Weglot API key. If the key is still not validating, you can contact your host provider and ask if it\'s possible to whitelist api.weglot.com and weglot.com</p>'),e("#wrap-weglot #submit").prop("disabled",!0)}e(".weglot-keyres").remove(),e("#api_key_private").after('<span class="weglot-keyres weglot-ckeckkey"></span>'),e.ajax({method:"POST",url:ajaxurl,data:{action:"get_user_info",api_key:t},success:({data:t,success:a})=>{e(".weglot-keyres").remove(),a?function(t){e(".weglot-keyres").remove(),e("#api_key_private").after('<span class="weglot-keyres weglot-okkey"></span>'),e("#wrap-weglot #submit").prop("disabled",!1);const o=new CustomEvent("weglotCheckApi",{detail:t});window.dispatchEvent(o)}(t):o()}}).fail((function(){o()}))})),e(".toplevel_page_weglot-settings form").submit((function(t){e("#wrap-weglot #submit").prop("disabled",!0)}))};document.addEventListener("DOMContentLoaded",()=>{t()})};var i=function(){jQuery;document.addEventListener("DOMContentLoaded",()=>{jQuery(document).ready((function(e){wp.codeEditor.initialize(e("#override_css"),cm_settings)}))})};var c=function(){const e=jQuery;"undefined"!=typeof weglot_css&&e("#weglot-css-flag-css").text(weglot_css.flag_css);const t=()=>{e(".flag-style-openclose").on("click",(function(){e(".flag-style-wrapper").toggle()})),e(".old-flag-style").on("click",(function(){e(".old-flag-wrapper").toggle()})),e("select.flag-en-type, select.flag-es-type, select.flag-pt-type, select.flag-fr-type, select.flag-ar-type, select.flag-tw-type, select.flag-zh-type").on("change",(function(){!function(){var t=new Array,o=new Array,a=new Array,n=new Array,l=new Array,r=new Array,s=new Array;t[1]=[3570,7841,48,2712],t[2]=[3720,449,3048,4440],t[3]=[3840,1281,2712,4224],t[4]=[3240,5217,1224,2112],t[5]=[4050,3585,1944,2496],t[6]=[2340,3457,2016,2016],o[1]=[4320,4641,3144,3552],o[2]=[3750,353,2880,4656],o[3]=[4200,1601,2568,3192],o[4]=[3990,5793,1032,2232],o[5]=[5460,897,4104,3120],o[6]=[3810,7905,216,3888],o[7]=[3630,8065,192,2376],o[8]=[3780,1473,2496,4104],o[9]=[6120,2145,4680,2568],o[10]=[4440,3009,3240,1176],o[11]=[5280,1825,3936,2976],o[12]=[4770,2081,3624,1008],o[13]=[4080,3201,2160,2544],o[14]=[4590,5761,3432,624],o[15]=[4350,2209,3360,2688],o[16]=[5610,5249,3168,528],o[17]=[5070,1729,3792,2952],o[18]=[6870,5953,96,3408],o[19]=[4020,5697,1056,1224],a[1]=[2760,736,2856,4416],a[2]=[3840,1280,2712,4224],a[3]=[5700,7201,5016,2400],a[4]=[2220,4160,1632,1944],n[1]=[1830,129,3096,5664],n[2]=[5100,2177,3840,2904],n[3]=[4890,3425,3648,2136],n[4]=[1320,3681,1896,4080],n[5]=[1260,3841,1824,1200],n[6]=[1020,3969,1608,312],n[7]=[4800,4065,3600,72],n[8]=[4710,4865,3504,480],n[9]=[6720,5984,5112,3792],n[10]=[4500,7233,3288,1800],n[11]=[720,7522,384,3936],n[12]=[690,7745,336,1104],n[13]=[600,8225,120,1272],n[14]=[660,5569,840,576],l[1]=[3690,1505,2592,3240],l[2]=[3600,3233,2112,48],r[1]=[2970,6369,3408,4008],r[2]=[3600,3233,2112,48],s[1]=[6630,993,2784,4344];var i=e("select.flag-en-type").val(),c=e("select.flag-es-type").val(),g=e("select.flag-fr-type").val(),f=e("select.flag-ar-type").val(),p=e("select.flag-tw-type").val(),d=e("select.flag-zh-type").val(),u=e("select.flag-pt-type").val(),w=i<=0?"":".weglot-flags.en > a:before, .weglot-flags.en > span:before { background-position: -"+t[i][0]+"px 0 !important; } .weglot-flags.flag-1.en > a:before, .weglot-flags.flag-1.en > span:before { background-position: -"+t[i][1]+"px 0 !important; } .weglot-flags.flag-2.en > a:before, .weglot-flags.flag-2.en > span:before { background-position: -"+t[i][2]+"px 0 !important; } .weglot-flags.flag-3.en > a:before, .weglot-flags.flag-3.en > span:before { background-position: -"+t[i][3]+"px 0 !important; } ",b=c<=0?"":".weglot-flags.es > a:before, .weglot-flags.es > span:before { background-position: -"+o[c][0]+"px 0 !important; } .weglot-flags.flag-1.es > a:before, .weglot-flags.flag-1.es > span:before { background-position: -"+o[c][1]+"px 0 !important; } .weglot-flags.flag-2.es > a:before, .weglot-flags.flag-2.es > span:before { background-position: -"+o[c][2]+"px 0 !important; } .weglot-flags.flag-3.es > a:before, .weglot-flags.flag-3.es > span:before { background-position: -"+o[c][3]+"px 0 !important; } ",y=g<=0?"":".weglot-flags.fr > a:before, .weglot-flags.fr > span:before { background-position: -"+a[g][0]+"px 0 !important; } .weglot-flags.flag-1.fr > a:before, .weglot-flags.flag-1.fr > span:before { background-position: -"+a[g][1]+"px 0 !important; } .weglot-flags.flag-2.fr > a:before, .weglot-flags.flag-2.fr > span:before { background-position: -"+a[g][2]+"px 0 !important; } .weglot-flags.flag-3.fr > a:before, .weglot-flags.flag-3.fr > span:before { background-position: -"+a[g][3]+"px 0 !important; } ",m=f<=0?"":".weglot-flags.ar > a:before, .weglot-flags.ar > span:before { background-position: -"+n[f][0]+"px 0 !important; } .weglot-flags.flag-1.ar > a:before, .weglot-flags.flag-1.ar > span:before { background-position: -"+n[f][1]+"px 0 !important; } .weglot-flags.flag-2.ar > a:before, .weglot-flags.flag-2.ar > span:before { background-position: -"+n[f][2]+"px 0 !important; } .weglot-flags.flag-3.ar > a:before, .weglot-flags.flag-3.ar > span:before { background-position: -"+n[f][3]+"px 0 !important; } ",_=p<=0?"":".weglot-flags.tw > a:before, .weglot-flags.tw > span:before { background-position: -"+l[p][0]+"px 0 !important; } .weglot-flags.flag-1.tw > a:before, .weglot-flags.flag-1.tw > span:before { background-position: -"+l[p][1]+"px 0 !important; } .weglot-flags.flag-2.tw > a:before, .weglot-flags.flag-2.tw > span:before { background-position: -"+l[p][2]+"px 0 !important; } .weglot-flags.flag-3.tw > a:before, .weglot-flags.flag-3.tw > span:before { background-position: -"+l[p][3]+"px 0 !important; } ",v=d<=0?"":".weglot-flags.zh > a:before, .weglot-flags.zh > span:before { background-position: -"+r[d][0]+"px 0 !important; } .weglot-flags.flag-1.zh > a:before, .weglot-flags.flag-1.zh > span:before { background-position: -"+r[d][1]+"px 0 !important; } .weglot-flags.flag-2.zh > a:before, .weglot-flags.flag-2.zh > span:before { background-position: -"+r[d][2]+"px 0 !important; } .weglot-flags.flag-3.zh > a:before, .weglot-flags.flag-3.zh > span:before { background-position: -"+r[d][3]+"px 0 !important; } ",h=u<=0?"":".weglot-flags.pt > a:before, .weglot-flags.pt > span:before { background-position: -"+s[u][0]+"px 0 !important; } .weglot-flags.flag-1.pt > a:before, .weglot-flags.flag-1.pt > span:before { background-position: -"+s[u][1]+"px 0 !important; } .weglot-flags.flag-2.pt > a:before, .weglot-flags.flag-2.pt > span:before { background-position: -"+s[u][2]+"px 0 !important; } .weglot-flags.flag-3.pt > a:before, .weglot-flags.flag-3.pt > span:before { background-position: -"+s[u][3]+"px 0 !important; } ";e("#flag_css, #weglot-css-flag-css").text(w+b+y+m+_+v+h)}()}));var t=e("#flag_css").text();t.trim()&&e("#weglot-css-flag-css").text(t)};document.addEventListener("DOMContentLoaded",()=>{t()})};var g=function(){jQuery;document.addEventListener("DOMContentLoaded",()=>{const e=document.querySelector("#private_mode");e&&0!=e.length&&(document.querySelector("#private_mode").addEventListener("change",(function(e){document.querySelectorAll(".private-mode-lang--input").forEach(t=>{t.checked=e.target.checked})})),document.querySelectorAll(".private-mode-lang--input").forEach(e=>{e.addEventListener("change",(function(e){0===document.querySelectorAll(".private-mode-lang--input:checked").length&&(document.querySelector("#private_mode").checked=!1)}))}))})};o(1),o(2);a(),l(),n(),r(),s(),i(),c(),g()}]);
readme.txt CHANGED
@@ -186,6 +186,13 @@ See changelog for upgrade changes.
186
 
187
 
188
  == Changelog ==
 
 
 
 
 
 
 
189
  = 3.3.4 (22/03/2021) =
190
  * Check if curl_exec is enable
191
  * Fix js problem on admin on preview
186
 
187
 
188
  == Changelog ==
189
+
190
+ = 3.3.5 (12/04/2021) =
191
+ * Add url from canonical if existing
192
+ * Add vip code review
193
+ * Increase timeout when updating setting and disable submit button
194
+ * Adding message to tell user to purge cache from cache plugin after editing translation
195
+
196
  = 3.3.4 (22/03/2021) =
197
  * Check if curl_exec is enable
198
  * Fix js problem on admin on preview
src/actions/admin/class-admin-enqueue-weglot.php CHANGED
@@ -102,7 +102,6 @@ class Admin_Enqueue_Weglot implements Hooks_Interface_Weglot {
102
  );
103
 
104
  wp_enqueue_style( 'weglot-admin-css', WEGLOT_URL_DIST . '/css/admin-css.css', array(), WEGLOT_VERSION );
105
- //wp_enqueue_style( 'weglot-repo-flag', WEGLOT_DIRURL . '/app/styles/flags.css', array(), WEGLOT_VERSION );
106
 
107
  wp_enqueue_style( 'weglot-css', WEGLOT_URL_DIST . '/css/front-css.css', array(), WEGLOT_VERSION );
108
  wp_localize_script(
102
  );
103
 
104
  wp_enqueue_style( 'weglot-admin-css', WEGLOT_URL_DIST . '/css/admin-css.css', array(), WEGLOT_VERSION );
 
105
 
106
  wp_enqueue_style( 'weglot-css', WEGLOT_URL_DIST . '/css/front-css.css', array(), WEGLOT_VERSION );
107
  wp_localize_script(
src/actions/admin/class-options-weglot.php CHANGED
@@ -92,7 +92,7 @@ class Options_Weglot implements Hooks_Interface_Weglot {
92
  $options = $this->sanitize_options_settings( $options, $has_first_settings );
93
  $response = $this->option_services->save_options_to_weglot( $options, $has_first_settings );
94
 
95
- if ( $response['success'] ) {
96
  delete_transient( 'weglot_cache_cdn' );
97
 
98
  $api_key_private = $this->option_services->get_api_key_private();
92
  $options = $this->sanitize_options_settings( $options, $has_first_settings );
93
  $response = $this->option_services->save_options_to_weglot( $options, $has_first_settings );
94
 
95
+ if ( $response['success'] && is_array($response['result']) ) {
96
  delete_transient( 'weglot_cache_cdn' );
97
 
98
  $api_key_private = $this->option_services->get_api_key_private();
src/actions/class-migration-weglot.php CHANGED
@@ -34,6 +34,11 @@ class Migration_Weglot implements Hooks_Interface_Weglot {
34
  public function hooks() {
35
  if ( ! defined( 'WEGLOT_LATEST_VERSION' ) && ! defined( 'WEGLOT_VERSION' ) ) {
36
  return;
 
 
 
 
 
37
  }
38
 
39
  $weglot_version = get_option( 'weglot_version' );
34
  public function hooks() {
35
  if ( ! defined( 'WEGLOT_LATEST_VERSION' ) && ! defined( 'WEGLOT_VERSION' ) ) {
36
  return;
37
+
38
+ if(1 == 1)
39
+ {
40
+
41
+ }
42
  }
43
 
44
  $weglot_version = get_option( 'weglot_version' );
src/actions/front/class-front-menu-weglot.php CHANGED
@@ -57,6 +57,10 @@ class Front_Menu_Weglot implements Hooks_Interface_Weglot {
57
  return;
58
  }
59
 
 
 
 
 
60
  add_filter( 'wp_get_nav_menu_items', array( $this, 'weglot_wp_get_nav_menu_items' ), 20 );
61
  add_filter( 'nav_menu_link_attributes', array( $this, 'add_nav_menu_link_attributes' ), 10, 2 );
62
  add_filter( 'wp_nav_menu_objects', array( $this, 'wp_nav_menu_objects' ) );
57
  return;
58
  }
59
 
60
+ if ( ! $this->option_services->get_option( 'api_key' ) ) {
61
+ return;
62
+ }
63
+
64
  add_filter( 'wp_get_nav_menu_items', array( $this, 'weglot_wp_get_nav_menu_items' ), 20 );
65
  add_filter( 'nav_menu_link_attributes', array( $this, 'add_nav_menu_link_attributes' ), 10, 2 );
66
  add_filter( 'wp_nav_menu_objects', array( $this, 'wp_nav_menu_objects' ) );
src/actions/front/class-translate-page-weglot.php CHANGED
@@ -105,20 +105,20 @@ class Translate_Page_Weglot implements Hooks_Interface_Weglot {
105
  $action_ajax_no_translate = apply_filters(
106
  'weglot_ajax_no_translate',
107
  array(
108
- 'add-menu-item', // WP Core
109
- 'query-attachments', // WP Core
110
- 'avia_ajax_switch_menu_walker', // Enfold theme
111
- 'query-themes', // WP Core
112
- 'wpestate_ajax_check_booking_valability_internal', // WP Estate theme
113
- 'wpestate_ajax_add_booking', // WP Estate theme
114
- 'wpestate_ajax_check_booking_valability', // WP Estate theme
115
- 'mailster_get_template', // Mailster Pro,
116
- 'mmp_map_settings', // MMP Map,
117
- 'elementor_ajax', // Elementor since 2.5
118
- 'ct_get_svg_icon_sets', // Oxygen
119
- 'oxy_render_nav_menu', // Oxygen
120
- 'hotel_booking_ajax_add_to_cart', // Hotel booking plugin
121
- 'imagify_get_admin_bar_profile', // Imagify Admin Bar
122
  )
123
  );
124
 
@@ -143,20 +143,20 @@ class Translate_Page_Weglot implements Hooks_Interface_Weglot {
143
  public function weglot_init() {
144
  do_action( 'weglot_init_start' );
145
 
146
- //We refresh the current language as now the wp_doing_ajax is valid
147
  $this->current_language = $this->request_url_services->get_current_language();
148
 
149
  if ( ! $this->option_services->get_option( 'original_language' ) ) {
150
  return;
151
  }
152
 
153
- if($this->request_url_services->is_allowed_private()) {
154
- if(!isset($_COOKIE['weglot_allow_private'])) {
155
  setcookie("weglot_allow_private" , true, time() + 86400 * 2, '/' ); //phpcs:ignore
156
  }
157
  }
158
 
159
- // URL not eligible
160
  if ( ! $this->request_url_services->is_eligible_url() ) {
161
  return;
162
  }
@@ -198,15 +198,14 @@ class Translate_Page_Weglot implements Hooks_Interface_Weglot {
198
  * @return void
199
  * @throws Exception
200
  * @since 2.0
201
- *
202
  */
203
  public function check_need_to_redirect() {
204
  if (
205
- ! wp_doing_ajax() && // no ajax
206
- $this->request_url_services->get_weglot_url()->getPath() === '/' && // front_page
207
- ! $this->redirect_services->get_no_redirect() && // No force redirect
208
  ! Server::detectBot( $_SERVER ) !== BotType::OTHER && //phpcs:ignore
209
- $this->option_services->get_option( 'auto_redirect' ) // have option redirect
210
  ) {
211
  $this->redirect_services->auto_redirect();
212
  }
@@ -227,9 +226,17 @@ class Translate_Page_Weglot implements Hooks_Interface_Weglot {
227
  return;
228
  }
229
 
230
- //If we are not in the original language, but the URL is not available in the current language, we redirect to original
231
- if ( ! $this->request_url_services->get_weglot_url()->getForLanguage($this->current_language) ) {
232
- wp_redirect( $this->request_url_services->get_weglot_url()->getForLanguage($this->language_services->get_original_language()) );
 
 
 
 
 
 
 
 
233
  exit;
234
  }
235
 
105
  $action_ajax_no_translate = apply_filters(
106
  'weglot_ajax_no_translate',
107
  array(
108
+ 'add-menu-item', // WP Core.
109
+ 'query-attachments', // WP Core.
110
+ 'avia_ajax_switch_menu_walker', // Enfold theme.
111
+ 'query-themes', // WP Core.
112
+ 'wpestate_ajax_check_booking_valability_internal', // WP Estate theme.
113
+ 'wpestate_ajax_add_booking', // WP Estate theme.
114
+ 'wpestate_ajax_check_booking_valability', // WP Estate theme.
115
+ 'mailster_get_template', // Mailster Pro.
116
+ 'mmp_map_settings', // MMP Map.
117
+ 'elementor_ajax', // Elementor since 2.5.
118
+ 'ct_get_svg_icon_sets', // Oxygen.
119
+ 'oxy_render_nav_menu', // Oxygen.
120
+ 'hotel_booking_ajax_add_to_cart', // Hotel booking plugin.
121
+ 'imagify_get_admin_bar_profile', // Imagify Admin Bar.
122
  )
123
  );
124
 
143
  public function weglot_init() {
144
  do_action( 'weglot_init_start' );
145
 
146
+ // We refresh the current language as now the wp_doing_ajax is valid.
147
  $this->current_language = $this->request_url_services->get_current_language();
148
 
149
  if ( ! $this->option_services->get_option( 'original_language' ) ) {
150
  return;
151
  }
152
 
153
+ if ( $this->request_url_services->is_allowed_private() ) {
154
+ if ( ! isset( $_COOKIE['weglot_allow_private'] ) ) {
155
  setcookie("weglot_allow_private" , true, time() + 86400 * 2, '/' ); //phpcs:ignore
156
  }
157
  }
158
 
159
+ // URL not eligible.
160
  if ( ! $this->request_url_services->is_eligible_url() ) {
161
  return;
162
  }
198
  * @return void
199
  * @throws Exception
200
  * @since 2.0
 
201
  */
202
  public function check_need_to_redirect() {
203
  if (
204
+ ! wp_doing_ajax() && // no ajax.
205
+ $this->request_url_services->get_weglot_url()->getPath() === '/' && // front_page.
206
+ ! $this->redirect_services->get_no_redirect() && // No force redirect.
207
  ! Server::detectBot( $_SERVER ) !== BotType::OTHER && //phpcs:ignore
208
+ $this->option_services->get_option( 'auto_redirect' ) // have option redirect.
209
  ) {
210
  $this->redirect_services->auto_redirect();
211
  }
226
  return;
227
  }
228
 
229
+ // If we are not in the original language, but the URL is not available in the current language, we redirect to original.
230
+ if ( ! $this->request_url_services->get_weglot_url()->getForLanguage( $this->current_language )
231
+ && ! strpos( $this->request_url_services->get_weglot_url()->getForLanguage( $this->language_services->get_original_language() ), 'wp-comments-post.php' ) !== false ) {
232
+ wp_redirect( $this->request_url_services->get_weglot_url()->getForLanguage( $this->language_services->get_original_language() ), 301 );
233
+ exit;
234
+ }
235
+
236
+ // //If we receive a not translated slug we return a 301. For example if we have /fr/products but should have /fr/produits we should redirect to /fr/produits.
237
+ if ( strpos( $this->request_url_services->get_weglot_url()->getPathAndQuery(), '301_' ) !== false ) {
238
+ $redirect_to = str_replace( '301_', '', $this->request_url_services->get_weglot_url()->getPathAndQuery() );
239
+ wp_redirect( '/' . $this->current_language->getExternalCode() . $redirect_to, 301 );
240
  exit;
241
  }
242
 
src/services/class-href-lang-service-weglot.php CHANGED
@@ -36,8 +36,8 @@ class Href_Lang_Service_Weglot {
36
 
37
  $urls = $this->request_url_services->get_weglot_url()->getAllUrls();
38
 
39
- foreach ($urls as $url) {
40
- $render .= '<link rel="alternate" href="' . esc_url( $url['url'] ) . '" hreflang="' . $url['language']->getExternalCode() . '"/>'."\n";
41
  }
42
 
43
  return apply_filters( 'weglot_href_lang', $render );
36
 
37
  $urls = $this->request_url_services->get_weglot_url()->getAllUrls();
38
 
39
+ foreach ( $urls as $url ) {
40
+ $render .= '<link rel="alternate" href="' . esc_url( $url['url'] ) . '" hreflang="' . $url['language']->getExternalCode() . '"/>' . "\n";
41
  }
42
 
43
  return apply_filters( 'weglot_href_lang', $render );
src/services/class-option-service-weglot.php CHANGED
@@ -152,7 +152,7 @@ class Option_Service_Weglot {
152
  /**
153
  * @since 3.0.0
154
  * @param string $api_key
155
- * @param array $destinations_languages
156
  * @return array
157
  */
158
  protected function get_slugs_from_cache_with_api_key( $api_key, $destinations_languages ) {
@@ -212,7 +212,7 @@ class Option_Service_Weglot {
212
  try {
213
  $body = json_decode( $response['body'], true );
214
 
215
- if ( null === $body || !is_array($body)) {
216
  return array(
217
  'success' => false,
218
  'result' => $this->get_options_default(),
@@ -240,7 +240,7 @@ class Option_Service_Weglot {
240
  }
241
 
242
  /**
243
- * @param string $api_key
244
  * @param $destinations_languages
245
  * @return array
246
  * @since 3.0.0
@@ -364,6 +364,11 @@ class Option_Service_Weglot {
364
  $options['api_key_private'] = $api_key_private;
365
  }
366
 
 
 
 
 
 
367
  $options = apply_filters( 'weglot_get_options', array_merge( $this->options_bdd_default, $this->get_options_bdd_v3(), $options ) );
368
  $options = (array) Morphism::map( 'WeglotWP\Models\Schema_Option_V3', $options );
369
 
@@ -420,7 +425,8 @@ class Option_Service_Weglot {
420
  $response = wp_remote_post( // phpcs:ignore
421
  sprintf( '%s/projects/settings?api_key=%s', Helper_API::get_api_url(), $options['api_key_private'] ),
422
  array(
423
- 'body' => wp_json_encode( $options ), //phpcs: ignore
 
424
  'headers' => array(
425
  'technology' => 'wordpress',
426
  'Content-Type' => 'application/json; charset=utf-8',
@@ -529,7 +535,7 @@ class Option_Service_Weglot {
529
 
530
  // Plugin Woocommerce
531
  $exclude_blocks[] = '.mini-cart-counter';
532
- $exclude_blocks[] = '.amount'; //Added to prevent prices to pass
533
  $exclude_blocks[] = 'address';
534
 
535
  // Plugin SecuPress
@@ -559,7 +565,7 @@ class Option_Service_Weglot {
559
  * @since 2.0
560
  */
561
  public function get_exclude_urls() {
562
- $list_exclude_urls = $this->get_option( 'exclude_urls' );
563
  /** @var $request_url_services Request_Url_Service_Weglot */
564
  $request_url_services = weglot_get_service( 'Request_Url_Service_Weglot' );
565
  $exclude_urls = array();
@@ -599,7 +605,6 @@ class Option_Service_Weglot {
599
  * @return string
600
  * @throws Exception
601
  * @since 2.0
602
- *
603
  */
604
  public function get_css_custom_inline() {
605
  return apply_filters( 'weglot_css_custom_inline', $this->get_option( 'override_css' ) );
@@ -609,7 +614,6 @@ class Option_Service_Weglot {
609
  * @return string
610
  * @throws Exception
611
  * @since 2.0
612
- *
613
  */
614
  public function get_flag_css() {
615
  return apply_filters( 'weglot_flag_css', $this->get_option( 'flag_css' ) );
@@ -652,12 +656,12 @@ class Option_Service_Weglot {
652
  /**
653
  *
654
  * @param string $key
655
- * @param mixed $value
656
  * @return Option_Service_Weglot
657
  */
658
  public function set_option_by_key( $key, $value ) {
659
 
660
- $options = $this->get_options_bdd_v3();
661
 
662
  $options[ $key ] = $value;
663
 
152
  /**
153
  * @since 3.0.0
154
  * @param string $api_key
155
+ * @param array $destinations_languages
156
  * @return array
157
  */
158
  protected function get_slugs_from_cache_with_api_key( $api_key, $destinations_languages ) {
212
  try {
213
  $body = json_decode( $response['body'], true );
214
 
215
+ if ( null === $body || ! is_array( $body ) ) {
216
  return array(
217
  'success' => false,
218
  'result' => $this->get_options_default(),
240
  }
241
 
242
  /**
243
+ * @param string $api_key
244
  * @param $destinations_languages
245
  * @return array
246
  * @since 3.0.0
364
  $options['api_key_private'] = $api_key_private;
365
  }
366
 
367
+ if ( ! isset( $options['api_key'] ) ) {
368
+ return $options;
369
+ }
370
+
371
+
372
  $options = apply_filters( 'weglot_get_options', array_merge( $this->options_bdd_default, $this->get_options_bdd_v3(), $options ) );
373
  $options = (array) Morphism::map( 'WeglotWP\Models\Schema_Option_V3', $options );
374
 
425
  $response = wp_remote_post( // phpcs:ignore
426
  sprintf( '%s/projects/settings?api_key=%s', Helper_API::get_api_url(), $options['api_key_private'] ),
427
  array(
428
+ 'body' => wp_json_encode( $options ), // phpcs:ignore.
429
+ 'timeout' => 60, // phpcs:ignore
430
  'headers' => array(
431
  'technology' => 'wordpress',
432
  'Content-Type' => 'application/json; charset=utf-8',
535
 
536
  // Plugin Woocommerce
537
  $exclude_blocks[] = '.mini-cart-counter';
538
+ $exclude_blocks[] = '.amount'; // Added to prevent prices to pass
539
  $exclude_blocks[] = 'address';
540
 
541
  // Plugin SecuPress
565
  * @since 2.0
566
  */
567
  public function get_exclude_urls() {
568
+ $list_exclude_urls = $this->get_option( 'exclude_urls' );
569
  /** @var $request_url_services Request_Url_Service_Weglot */
570
  $request_url_services = weglot_get_service( 'Request_Url_Service_Weglot' );
571
  $exclude_urls = array();
605
  * @return string
606
  * @throws Exception
607
  * @since 2.0
 
608
  */
609
  public function get_css_custom_inline() {
610
  return apply_filters( 'weglot_css_custom_inline', $this->get_option( 'override_css' ) );
614
  * @return string
615
  * @throws Exception
616
  * @since 2.0
 
617
  */
618
  public function get_flag_css() {
619
  return apply_filters( 'weglot_flag_css', $this->get_option( 'flag_css' ) );
656
  /**
657
  *
658
  * @param string $key
659
+ * @param mixed $value
660
  * @return Option_Service_Weglot
661
  */
662
  public function set_option_by_key( $key, $value ) {
663
 
664
+ $options = $this->get_options_bdd_v3();
665
 
666
  $options[ $key ] = $value;
667
 
src/services/class-translate-service-weglot.php CHANGED
@@ -8,6 +8,7 @@ if ( ! defined( 'ABSPATH' ) ) {
8
 
9
  use Weglot\Client\Api\Exception\ApiError;
10
  use Weglot\Client\Api\LanguageEntry;
 
11
  use WeglotWP\Helpers\Helper_Json_Inline_Weglot;
12
  use WeglotWP\Helpers\Helper_Keys_Json_Weglot;
13
 
@@ -48,6 +49,7 @@ class Translate_Service_Weglot {
48
  * @var Generate_Switcher_Service_Weglot
49
  */
50
  private $generate_switcher_service;
 
51
 
52
 
53
  /**
@@ -155,9 +157,10 @@ class Translate_Service_Weglot {
155
 
156
 
157
  /**
158
- * @since 2.3.0
159
  *
160
- * @param string $html
 
161
  * @return string
162
  */
163
  private function remove_comments( $html ) {
@@ -166,18 +169,34 @@ class Translate_Service_Weglot {
166
 
167
 
168
  /**
 
 
169
  * @since 2.3.0
170
- * @param string $dom
171
  * @return string
172
  */
173
  public function weglot_render_dom( $dom ) {
174
  $dom = $this->generate_switcher_service->generate_switcher_from_dom( $dom );
175
 
176
- // We only need this on translated page
177
  if ( $this->current_language !== $this->original_language ) {
178
  $dom = $this->replace_url_services->replace_link_in_dom( $dom );
179
  }
180
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  return apply_filters( 'weglot_render_dom', $dom );
182
  }
183
  }
8
 
9
  use Weglot\Client\Api\Exception\ApiError;
10
  use Weglot\Client\Api\LanguageEntry;
11
+ use Weglot\Util\Url;
12
  use WeglotWP\Helpers\Helper_Json_Inline_Weglot;
13
  use WeglotWP\Helpers\Helper_Keys_Json_Weglot;
14
 
49
  * @var Generate_Switcher_Service_Weglot
50
  */
51
  private $generate_switcher_service;
52
+ private $href_lang_services;
53
 
54
 
55
  /**
157
 
158
 
159
  /**
160
+ * Remove comments from HTML.
161
  *
162
+ * @since 2.3.0
163
+ * @param string $html the HTML string.
164
  * @return string
165
  */
166
  private function remove_comments( $html ) {
169
 
170
 
171
  /**
172
+ * Replace links and add switcher on the final HTML.
173
+ *
174
  * @since 2.3.0
175
+ * @param string $dom the final translated HTML.
176
  * @return string
177
  */
178
  public function weglot_render_dom( $dom ) {
179
  $dom = $this->generate_switcher_service->generate_switcher_from_dom( $dom );
180
 
181
+ // We only need this on translated page.
182
  if ( $this->current_language !== $this->original_language ) {
183
  $dom = $this->replace_url_services->replace_link_in_dom( $dom );
184
  }
185
 
186
+ preg_match( '/<link rel="canonical"(.*?)?href=(\"|\')([^\s\>]+?)(\"|\')/', $dom, $matches );
187
+ if ( isset( $matches[3] ) && ! empty( $matches[3] ) ) {
188
+ $canonical = $matches[3];
189
+ $canonical_url = $this->request_url_services->create_url_object( $canonical );
190
+ if ( isset( $canonical_url ) && $canonical_url instanceof Url ) {
191
+ foreach ( $canonical_url->getAllUrls() as $url ) {
192
+ preg_match( '/href=(\"|\')([^\s\>]+?)(\"|\') hreflang=(\"|\')' . $url['language']->getExternalCode() . '(\"|\')/', $dom, $matches );
193
+ if ( isset( $matches[0] ) && ! empty( $matches[0] ) ) {
194
+ $dom = preg_replace( '/href=(\"|\')([^\s\>]+?)(\"|\') hreflang=(\"|\')' . $url['language']->getExternalCode() . '(\"|\')/', 'href=$1' . esc_url( $url['url'] ) . '$3 hreflang="' . $url['language']->getExternalCode() . '"', $dom );
195
+ }
196
+ }
197
+ }
198
+ }
199
+
200
  return apply_filters( 'weglot_render_dom', $dom );
201
  }
202
  }
templates/admin/pages/settings.php CHANGED
@@ -79,6 +79,9 @@ $url_form = wp_nonce_url(
79
  <a href="<?php echo esc_url( 'https://dashboard.weglot.com/translations/', 'weglot' ); ?>" target="_blank" class="weglot-editbtn">
80
  <?php esc_html_e( 'Edit my translations', 'weglot' ); ?>
81
  </a>
 
 
 
82
  </div>
83
  </div>
84
  <?php
79
  <a href="<?php echo esc_url( 'https://dashboard.weglot.com/translations/', 'weglot' ); ?>" target="_blank" class="weglot-editbtn">
80
  <?php esc_html_e( 'Edit my translations', 'weglot' ); ?>
81
  </a>
82
+ <p><span class="wp-menu-image dashicons-before dashicons-welcome-comments"></span><?php esc_html_e( 'When you edit your translations in Weglot, remember to clear your cache (if you have a cache plugin) to make sure you see the latest version of your page)', 'weglot' ); ?></p>
83
+
84
+
85
  </div>
86
  </div>
87
  <?php
templates/admin/pages/tabs/settings.php CHANGED
@@ -161,7 +161,7 @@ $plans = $this->user_api_services->get_plans();
161
 
162
 
163
  <?php if ( ! $this->options['has_first_settings'] && $this->options['show_box_first_settings'] ) : ?>
164
- <?php $this->option_services->set_option_by_key( 'show_box_first_settings', false ); // remove showbox ?>
165
  <div id="weglot-box-first-settings" class="weglot-box-overlay">
166
  <div class="weglot-box">
167
  <a class="weglot-btn-close"><?php esc_html_e( 'Close', 'weglot' ); ?></a>
@@ -178,7 +178,7 @@ $plans = $this->user_api_services->get_plans();
178
  ?>
179
  <iframe
180
  style="visibility:hidden;"
181
- src="<?php echo esc_url( sprintf( '%s/%s', home_url(), $this->options[ $options_available['languages']['key'] ][0] ) ); ?>/" width="1" height="1">
182
  </iframe>
183
  <?php endif; ?>
184
  <?php endif; ?>
161
 
162
 
163
  <?php if ( ! $this->options['has_first_settings'] && $this->options['show_box_first_settings'] ) : ?>
164
+ <?php $this->option_services->set_option_by_key( 'show_box_first_settings', false ); ?>
165
  <div id="weglot-box-first-settings" class="weglot-box-overlay">
166
  <div class="weglot-box">
167
  <a class="weglot-btn-close"><?php esc_html_e( 'Close', 'weglot' ); ?></a>
178
  ?>
179
  <iframe
180
  style="visibility:hidden;"
181
+ src="<?php echo esc_url( sprintf( '%s/%s', home_url(), $this->options[ $options_available['languages']['key'] ][0]['language_to'] ) ); ?>/" width="1" height="1">
182
  </iframe>
183
  <?php endif; ?>
184
  <?php endif; ?>
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInita86ac28430354e53ea2f3405156e5657::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInitd52bbb336ecfa182085a37bec21ca20c::getLoader();
vendor/composer/InstalledVersions.php CHANGED
@@ -30,7 +30,7 @@ private static $installed = array (
30
  'aliases' =>
31
  array (
32
  ),
33
- 'reference' => '1e8d0d564e5cd079f033a24ae84e5d31793d1db4',
34
  'name' => 'weglot/translate-wordpress',
35
  ),
36
  'versions' =>
@@ -69,7 +69,7 @@ private static $installed = array (
69
  'aliases' =>
70
  array (
71
  ),
72
- 'reference' => '1e8d0d564e5cd079f033a24ae84e5d31793d1db4',
73
  ),
74
  'weglot/translation-definitions' =>
75
  array (
@@ -82,12 +82,12 @@ private static $installed = array (
82
  ),
83
  'weglot/weglot-php' =>
84
  array (
85
- 'pretty_version' => '1.1.9',
86
- 'version' => '1.1.9.0',
87
  'aliases' =>
88
  array (
89
  ),
90
- 'reference' => '2c21bb2cce28c9215a567f99e0fb3c7bd04a35d6',
91
  ),
92
  ),
93
  );
30
  'aliases' =>
31
  array (
32
  ),
33
+ 'reference' => '19f1be41e48260d1a412c6083ba581b7455e909d',
34
  'name' => 'weglot/translate-wordpress',
35
  ),
36
  'versions' =>
69
  'aliases' =>
70
  array (
71
  ),
72
+ 'reference' => '19f1be41e48260d1a412c6083ba581b7455e909d',
73
  ),
74
  'weglot/translation-definitions' =>
75
  array (
82
  ),
83
  'weglot/weglot-php' =>
84
  array (
85
+ 'pretty_version' => '1.1.10',
86
+ 'version' => '1.1.10.0',
87
  'aliases' =>
88
  array (
89
  ),
90
+ 'reference' => '6b2f1abd63aec7ace158a842ae7f76938b3084d3',
91
  ),
92
  ),
93
  );
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInita86ac28430354e53ea2f3405156e5657
6
  {
7
  private static $loader;
8
 
@@ -24,15 +24,15 @@ class ComposerAutoloaderInita86ac28430354e53ea2f3405156e5657
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
- spl_autoload_register(array('ComposerAutoloaderInita86ac28430354e53ea2f3405156e5657', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
- spl_autoload_unregister(array('ComposerAutoloaderInita86ac28430354e53ea2f3405156e5657', 'loadClassLoader'));
30
 
31
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
  if ($useStaticLoader) {
33
  require __DIR__ . '/autoload_static.php';
34
 
35
- call_user_func(\Composer\Autoload\ComposerStaticInita86ac28430354e53ea2f3405156e5657::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
@@ -53,19 +53,19 @@ class ComposerAutoloaderInita86ac28430354e53ea2f3405156e5657
53
  $loader->register(true);
54
 
55
  if ($useStaticLoader) {
56
- $includeFiles = Composer\Autoload\ComposerStaticInita86ac28430354e53ea2f3405156e5657::$files;
57
  } else {
58
  $includeFiles = require __DIR__ . '/autoload_files.php';
59
  }
60
  foreach ($includeFiles as $fileIdentifier => $file) {
61
- composerRequirea86ac28430354e53ea2f3405156e5657($fileIdentifier, $file);
62
  }
63
 
64
  return $loader;
65
  }
66
  }
67
 
68
- function composerRequirea86ac28430354e53ea2f3405156e5657($fileIdentifier, $file)
69
  {
70
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
71
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInitd52bbb336ecfa182085a37bec21ca20c
6
  {
7
  private static $loader;
8
 
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
+ spl_autoload_register(array('ComposerAutoloaderInitd52bbb336ecfa182085a37bec21ca20c', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
+ spl_autoload_unregister(array('ComposerAutoloaderInitd52bbb336ecfa182085a37bec21ca20c', 'loadClassLoader'));
30
 
31
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
32
  if ($useStaticLoader) {
33
  require __DIR__ . '/autoload_static.php';
34
 
35
+ call_user_func(\Composer\Autoload\ComposerStaticInitd52bbb336ecfa182085a37bec21ca20c::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
53
  $loader->register(true);
54
 
55
  if ($useStaticLoader) {
56
+ $includeFiles = Composer\Autoload\ComposerStaticInitd52bbb336ecfa182085a37bec21ca20c::$files;
57
  } else {
58
  $includeFiles = require __DIR__ . '/autoload_files.php';
59
  }
60
  foreach ($includeFiles as $fileIdentifier => $file) {
61
+ composerRequired52bbb336ecfa182085a37bec21ca20c($fileIdentifier, $file);
62
  }
63
 
64
  return $loader;
65
  }
66
  }
67
 
68
+ function composerRequired52bbb336ecfa182085a37bec21ca20c($fileIdentifier, $file)
69
  {
70
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
71
  require $file;
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInita86ac28430354e53ea2f3405156e5657
8
  {
9
  public static $files = array (
10
  '6c200413eed8aeea54dbaf934a31b127' => __DIR__ . '/..' . '/weglot/simplehtmldom/src/simple_html_dom.php',
@@ -66,10 +66,10 @@ class ComposerStaticInita86ac28430354e53ea2f3405156e5657
66
  public static function getInitializer(ClassLoader $loader)
67
  {
68
  return \Closure::bind(function () use ($loader) {
69
- $loader->prefixLengthsPsr4 = ComposerStaticInita86ac28430354e53ea2f3405156e5657::$prefixLengthsPsr4;
70
- $loader->prefixDirsPsr4 = ComposerStaticInita86ac28430354e53ea2f3405156e5657::$prefixDirsPsr4;
71
- $loader->prefixesPsr0 = ComposerStaticInita86ac28430354e53ea2f3405156e5657::$prefixesPsr0;
72
- $loader->classMap = ComposerStaticInita86ac28430354e53ea2f3405156e5657::$classMap;
73
 
74
  }, null, ClassLoader::class);
75
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInitd52bbb336ecfa182085a37bec21ca20c
8
  {
9
  public static $files = array (
10
  '6c200413eed8aeea54dbaf934a31b127' => __DIR__ . '/..' . '/weglot/simplehtmldom/src/simple_html_dom.php',
66
  public static function getInitializer(ClassLoader $loader)
67
  {
68
  return \Closure::bind(function () use ($loader) {
69
+ $loader->prefixLengthsPsr4 = ComposerStaticInitd52bbb336ecfa182085a37bec21ca20c::$prefixLengthsPsr4;
70
+ $loader->prefixDirsPsr4 = ComposerStaticInitd52bbb336ecfa182085a37bec21ca20c::$prefixDirsPsr4;
71
+ $loader->prefixesPsr0 = ComposerStaticInitd52bbb336ecfa182085a37bec21ca20c::$prefixesPsr0;
72
+ $loader->classMap = ComposerStaticInitd52bbb336ecfa182085a37bec21ca20c::$classMap;
73
 
74
  }, null, ClassLoader::class);
75
  }
vendor/composer/installed.json CHANGED
@@ -190,17 +190,17 @@
190
  },
191
  {
192
  "name": "weglot/weglot-php",
193
- "version": "1.1.9",
194
- "version_normalized": "1.1.9.0",
195
  "source": {
196
  "type": "git",
197
  "url": "git@github.com:weglot/weglot-php.git",
198
- "reference": "2c21bb2cce28c9215a567f99e0fb3c7bd04a35d6"
199
  },
200
  "dist": {
201
  "type": "zip",
202
- "url": "https://api.github.com/repos/weglot/weglot-php/zipball/2c21bb2cce28c9215a567f99e0fb3c7bd04a35d6",
203
- "reference": "2c21bb2cce28c9215a567f99e0fb3c7bd04a35d6",
204
  "shasum": ""
205
  },
206
  "require": {
@@ -213,7 +213,7 @@
213
  "codeception/codeception": "^2.4",
214
  "vlucas/phpdotenv": "^2.4"
215
  },
216
- "time": "2021-03-17T16:43:09+00:00",
217
  "type": "library",
218
  "installation-source": "dist",
219
  "autoload": {
190
  },
191
  {
192
  "name": "weglot/weglot-php",
193
+ "version": "1.1.10",
194
+ "version_normalized": "1.1.10.0",
195
  "source": {
196
  "type": "git",
197
  "url": "git@github.com:weglot/weglot-php.git",
198
+ "reference": "6b2f1abd63aec7ace158a842ae7f76938b3084d3"
199
  },
200
  "dist": {
201
  "type": "zip",
202
+ "url": "https://api.github.com/repos/weglot/weglot-php/zipball/6b2f1abd63aec7ace158a842ae7f76938b3084d3",
203
+ "reference": "6b2f1abd63aec7ace158a842ae7f76938b3084d3",
204
  "shasum": ""
205
  },
206
  "require": {
213
  "codeception/codeception": "^2.4",
214
  "vlucas/phpdotenv": "^2.4"
215
  },
216
+ "time": "2021-03-26T16:51:45+00:00",
217
  "type": "library",
218
  "installation-source": "dist",
219
  "autoload": {
vendor/composer/installed.php CHANGED
@@ -6,7 +6,7 @@
6
  'aliases' =>
7
  array (
8
  ),
9
- 'reference' => '1e8d0d564e5cd079f033a24ae84e5d31793d1db4',
10
  'name' => 'weglot/translate-wordpress',
11
  ),
12
  'versions' =>
@@ -45,7 +45,7 @@
45
  'aliases' =>
46
  array (
47
  ),
48
- 'reference' => '1e8d0d564e5cd079f033a24ae84e5d31793d1db4',
49
  ),
50
  'weglot/translation-definitions' =>
51
  array (
@@ -58,12 +58,12 @@
58
  ),
59
  'weglot/weglot-php' =>
60
  array (
61
- 'pretty_version' => '1.1.9',
62
- 'version' => '1.1.9.0',
63
  'aliases' =>
64
  array (
65
  ),
66
- 'reference' => '2c21bb2cce28c9215a567f99e0fb3c7bd04a35d6',
67
  ),
68
  ),
69
  );
6
  'aliases' =>
7
  array (
8
  ),
9
+ 'reference' => '19f1be41e48260d1a412c6083ba581b7455e909d',
10
  'name' => 'weglot/translate-wordpress',
11
  ),
12
  'versions' =>
45
  'aliases' =>
46
  array (
47
  ),
48
+ 'reference' => '19f1be41e48260d1a412c6083ba581b7455e909d',
49
  ),
50
  'weglot/translation-definitions' =>
51
  array (
58
  ),
59
  'weglot/weglot-php' =>
60
  array (
61
+ 'pretty_version' => '1.1.10',
62
+ 'version' => '1.1.10.0',
63
  'aliases' =>
64
  array (
65
  ),
66
+ 'reference' => '6b2f1abd63aec7ace158a842ae7f76938b3084d3',
67
  ),
68
  ),
69
  );
vendor/weglot/weglot-php/src/Util/Url.php CHANGED
@@ -280,20 +280,30 @@ class Url
280
  //We need to change the path to the original path if there are custom URL
281
  if(isset($this->customUrls[$this->currentLanguage->getInternalCode()])) {
282
  $slugs = explode('/', $this->path);
 
 
283
  foreach ($slugs as $k => $slug) {
 
 
284
  if(empty($slug))
285
  continue;
286
 
287
  foreach( $this->customUrls[$this->currentLanguage->getInternalCode()] as $translatedURL => $originalURL ) {
288
  if($slug === $originalURL) {
289
- $slugs[$k] = 404; //If we receive a not translated slug we return a 404. For example if we have /fr/products but should have /fr/produits we should have a 404
 
 
290
  }
291
  if($slug === $translatedURL) {
292
  $slugs[$k] = $originalURL;
293
  }
294
  }
295
  }
296
- $this->path = implode('/' , $slugs);
 
 
 
 
297
  }
298
 
299
  $url = $this->getHost() . $this->getPathPrefix() . $this->getPath();
280
  //We need to change the path to the original path if there are custom URL
281
  if(isset($this->customUrls[$this->currentLanguage->getInternalCode()])) {
282
  $slugs = explode('/', $this->path);
283
+ $fully_translated_slug_array = [];
284
+ $mustRedirect = false;
285
  foreach ($slugs as $k => $slug) {
286
+ $fully_translated_slug_array[] = $slug;
287
+
288
  if(empty($slug))
289
  continue;
290
 
291
  foreach( $this->customUrls[$this->currentLanguage->getInternalCode()] as $translatedURL => $originalURL ) {
292
  if($slug === $originalURL) {
293
+ $mustRedirect = true;
294
+ array_pop($fully_translated_slug_array);
295
+ $fully_translated_slug_array[] = $translatedURL; // = "301_" . $translatedURL; //If we receive a not translated slug we return a 404. For example if we have /fr/products but should have /fr/produits we should have a 404
296
  }
297
  if($slug === $translatedURL) {
298
  $slugs[$k] = $originalURL;
299
  }
300
  }
301
  }
302
+ if($mustRedirect) {
303
+ $this->path = "301_".implode('/' , $fully_translated_slug_array);
304
+ } else {
305
+ $this->path = implode('/' , $slugs);
306
+ }
307
  }
308
 
309
  $url = $this->getHost() . $this->getPathPrefix() . $this->getPath();
weglot-compatibility.php CHANGED
@@ -13,9 +13,10 @@ if ( ! function_exists( 'wp_doing_ajax' ) ) {
13
  /**
14
  * Filters whether the current request is a WordPress Ajax request.
15
  *
 
 
16
  * @since 4.7.0
17
  *
18
- * @param bool $wp_doing_ajax Whether the current request is a WordPress Ajax request.
19
  */
20
  return apply_filters( 'wp_doing_ajax', defined( 'DOING_AJAX' ) && DOING_AJAX );
21
  }
@@ -37,13 +38,14 @@ if ( ! function_exists( 'is_rest' ) ) {
37
  function is_rest() {
38
  $prefix = rest_get_url_prefix();
39
  if ( defined( 'REST_REQUEST' ) && REST_REQUEST // (#1)
40
- || isset( $_GET['rest_route'] ) //phpcs:ignore
41
- && strpos( trim( $_GET['rest_route'], '\\/' ), $prefix, 0 ) === 0) { //phpcs:ignore
42
  return true;
43
  }
44
  // (#3)
45
  $rest_url = wp_parse_url( site_url( $prefix ) );
46
  $current_url = wp_parse_url( add_query_arg( array() ) );
 
47
  return strpos( $current_url['path'], $rest_url['path'], 0 ) === 0;
48
  }
49
  }
@@ -57,6 +59,7 @@ if ( ! function_exists( 'array_column' ) ) {
57
  foreach ( $input as $value ) {
58
  if ( ! array_key_exists( $column_key, $value ) ) {
59
  trigger_error( "Key \"$column_key\" does not exist in array" );
 
60
  return false;
61
  }
62
  if ( is_null( $index_key ) ) {
@@ -64,15 +67,18 @@ if ( ! function_exists( 'array_column' ) ) {
64
  } else {
65
  if ( ! array_key_exists( $index_key, $value ) ) {
66
  trigger_error( "Key \"$index_key\" does not exist in array" );
 
67
  return false;
68
  }
69
  if ( ! is_scalar( $value[ $index_key ] ) ) {
70
  trigger_error( "Key \"$index_key\" does not contain scalar value" );
 
71
  return false;
72
  }
73
  $array[ $value[ $index_key ] ] = $value[ $column_key ];
74
  }
75
  }
 
76
  return $array;
77
  }
78
  }
13
  /**
14
  * Filters whether the current request is a WordPress Ajax request.
15
  *
16
+ * @param bool $wp_doing_ajax Whether the current request is a WordPress Ajax request.
17
+ *
18
  * @since 4.7.0
19
  *
 
20
  */
21
  return apply_filters( 'wp_doing_ajax', defined( 'DOING_AJAX' ) && DOING_AJAX );
22
  }
38
  function is_rest() {
39
  $prefix = rest_get_url_prefix();
40
  if ( defined( 'REST_REQUEST' ) && REST_REQUEST // (#1)
41
+ || isset( $_GET['rest_route'] ) //phpcs:ignore
42
+ && strpos( trim( $_GET['rest_route'], '\\/' ), $prefix, 0 ) === 0 ) { //phpcs:ignore
43
  return true;
44
  }
45
  // (#3)
46
  $rest_url = wp_parse_url( site_url( $prefix ) );
47
  $current_url = wp_parse_url( add_query_arg( array() ) );
48
+
49
  return strpos( $current_url['path'], $rest_url['path'], 0 ) === 0;
50
  }
51
  }
59
  foreach ( $input as $value ) {
60
  if ( ! array_key_exists( $column_key, $value ) ) {
61
  trigger_error( "Key \"$column_key\" does not exist in array" );
62
+
63
  return false;
64
  }
65
  if ( is_null( $index_key ) ) {
67
  } else {
68
  if ( ! array_key_exists( $index_key, $value ) ) {
69
  trigger_error( "Key \"$index_key\" does not exist in array" );
70
+
71
  return false;
72
  }
73
  if ( ! is_scalar( $value[ $index_key ] ) ) {
74
  trigger_error( "Key \"$index_key\" does not contain scalar value" );
75
+
76
  return false;
77
  }
78
  $array[ $value[ $index_key ] ] = $value[ $column_key ];
79
  }
80
  }
81
+
82
  return $array;
83
  }
84
  }
weglot.php CHANGED
@@ -7,7 +7,7 @@ Author: Weglot Translate team
7
  Author URI: https://weglot.com/
8
  Text Domain: weglot
9
  Domain Path: /languages/
10
- Version: 3.3.4
11
  */
12
 
13
  /**
@@ -22,7 +22,7 @@ if ( ! defined( 'ABSPATH' ) ) {
22
  define( 'WEGLOT_NAME', 'Weglot' );
23
  define( 'WEGLOT_SLUG', 'weglot-translate' );
24
  define( 'WEGLOT_OPTION_GROUP', 'group-weglot-translate' );
25
- define( 'WEGLOT_VERSION', '3.3.4' );
26
  define( 'WEGLOT_PHP_MIN', '5.6' );
27
  define( 'WEGLOT_BNAME', plugin_basename( __FILE__ ) );
28
  define( 'WEGLOT_DIR', __DIR__ );
7
  Author URI: https://weglot.com/
8
  Text Domain: weglot
9
  Domain Path: /languages/
10
+ Version: 3.3.5
11
  */
12
 
13
  /**
22
  define( 'WEGLOT_NAME', 'Weglot' );
23
  define( 'WEGLOT_SLUG', 'weglot-translate' );
24
  define( 'WEGLOT_OPTION_GROUP', 'group-weglot-translate' );
25
+ define( 'WEGLOT_VERSION', '3.3.5' );
26
  define( 'WEGLOT_PHP_MIN', '5.6' );
27
  define( 'WEGLOT_BNAME', plugin_basename( __FILE__ ) );
28
  define( 'WEGLOT_DIR', __DIR__ );