Weglot Translate – Translate your WP website - Version 3.7

Version Description

(08/06/2022) = * Add: Translate pdf service * Add: Optimize button accessibility * Add: Pageviews integration * Add: Add switcher editor integration * Add: Woocomerce translate all mail * Add: Do not translate .eps or .txt * Add: Detect if switcher is child of an iframe and if so, don't display it * Add: Reduce api call on wp-admin * Bugfix: Some bug fix

Download this release

Release Info

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

Code changes from version 3.6.1 to 3.7

app/javascripts/front.js CHANGED
@@ -1,5 +1,42 @@
 
1
 
2
- document.addEventListener("DOMContentLoaded", function(event) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
 
4
  function getOffset(element) {
5
  let top = 0, left = 0;
@@ -16,20 +53,179 @@ document.addEventListener("DOMContentLoaded", function(event) {
16
  }
17
 
18
  const button = document.querySelector(".country-selector");
19
- if(!button){
20
  return;
21
  }
22
- const h = getOffset( button ).top;
23
- const body = document.body,html = document.documentElement;
24
- const page_height = Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight );
25
-
26
- const position = window.getComputedStyle( button ).getPropertyValue( "position" );
27
- const bottom = window.getComputedStyle( button ).getPropertyValue( "bottom" );
28
- const top = window.getComputedStyle( button ).getPropertyValue( "top" );
29
-
30
- if ((position !== "fixed" && h > page_height / 2) || (position === "fixed" && h > 100)) {
31
- button.className += " weglot-invert";
32
- }
33
- return false;
34
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ //find and place wg-ajax-button-switcher
2
 
3
+ function switcherPlacement() {
4
+ const button_switcher_ajax = document.querySelectorAll(".weglot-custom-switcher-ajax")
5
+ Array.prototype.forEach.call(button_switcher_ajax, function (el, i) {
6
+ let button_target = document.querySelector(el.getAttribute('data-wg-target'))
7
+ let button_sibling = document.querySelector(el.getAttribute('data-wg-sibling'))
8
+
9
+ if (button_target && button_sibling) {
10
+ button_target.insertBefore(el, button_sibling)
11
+ el.classList.remove("weglot-custom-switcher-ajax")
12
+ } else if (button_target) {
13
+ button_target.insertBefore(el, button_target.firstChild)
14
+ el.classList.remove("weglot-custom-switcher-ajax")
15
+ } else if (button_sibling) {
16
+ button_sibling.parentNode.insertBefore(el, button_sibling)
17
+ el.classList.remove("weglot-custom-switcher-ajax")
18
+ }
19
+ })
20
+ }
21
+
22
+ //detect iframe
23
+ function inFrame() {
24
+ try {
25
+ return window.frameElement || window.self !== window.top;
26
+ } catch (_) {
27
+ return false;
28
+ }
29
+ }
30
+
31
+ if (document.readyState === "loading") {
32
+ document.addEventListener("DOMContentLoaded", () =>
33
+ switcherPlacement()
34
+ );
35
+ } else {
36
+ switcherPlacement();
37
+ }
38
+
39
+ document.addEventListener("DOMContentLoaded", function (event) {
40
 
41
  function getOffset(element) {
42
  let top = 0, left = 0;
53
  }
54
 
55
  const button = document.querySelector(".country-selector");
56
+ if (!button) {
57
  return;
58
  }
59
+ const h = getOffset(button).top;
60
+ const body = document.body, html = document.documentElement;
61
+ const page_height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight);
62
+
63
+ const position = window.getComputedStyle(button).getPropertyValue("position");
64
+ const bottom = window.getComputedStyle(button).getPropertyValue("bottom");
65
+ const top = window.getComputedStyle(button).getPropertyValue("top");
66
+
67
+ if ((position !== "fixed" && h > page_height / 2) || (position === "fixed" && h > 100)) {
68
+ button.className += " weglot-invert";
69
+ }
70
+
71
+ //check if your page is load by an iframe
72
+ if (inFrame()) {
73
+ const switchers = document.querySelectorAll('.weglot-dropdown')
74
+ if (switchers !== null) {
75
+ [].forEach.call(switchers, function (switcher) {
76
+ switcher.style.display = "none";
77
+ });
78
+ }
79
+ }
80
+
81
+ const asides = document.getElementsByClassName("country-selector");
82
+ const isOpen = link => !link.className.includes("closed");
83
+ let focusedLang;
84
+ if (asides.length > 0) {
85
+ const selectedLang = document.getElementsByClassName("wgcurrent");
86
+ for (let aside of asides) {
87
+ // accessiblity button
88
+ const KEYCODE = {
89
+ ENTER: 13,
90
+ ESCAPE: 27,
91
+ ARROWUP: 38,
92
+ ARROWDOWN: 40,
93
+ };
94
+
95
+ const isOpenUp = () => {
96
+ // If switcher is in second half of page, set weg-openup class
97
+ const {bottom = 0} = aside.getBoundingClientRect();
98
+ return bottom > window.innerHeight / 2;
99
+ };
100
+
101
+ const openSwitcher = () => {
102
+ aside.classList.remove("closed");
103
+ document.querySelectorAll(".country-selector.weglot-dropdown input").checked = true;
104
+ aside.setAttribute("aria-expanded", "true");
105
+ };
106
 
107
+ const closeSwitcher = () => {
108
+ aside.classList.add("closed");
109
+ document.querySelectorAll(".country-selector.weglot-dropdown input").checked = false
110
+ aside.setAttribute("aria-expanded", "false");
111
+ if (focusedLang) {
112
+ focusedLang.classList.remove("focus");
113
+ focusedLang = null;
114
+ }
115
+ };
116
+
117
+ const setAriaLabel = code => {
118
+ const fullNameLang = getLangNameFromCode(code);
119
+ aside.setAttribute("aria-activedescendant", "weglot-language-" + code);
120
+ aside.setAttribute("aria-label", "Language selected: " + code);
121
+ };
122
+
123
+ const toggleSwitcher = () => {
124
+ if (aside.classList.contains("closed")) {
125
+ openSwitcher();
126
+ } else {
127
+ closeSwitcher();
128
+ }
129
+ if (focusedLang) {
130
+ focusedLang.classList.remove("focus");
131
+ }
132
+ focusedLang = null;
133
+ };
134
+
135
+ // Toggle when focused and keydown ENTER
136
+ aside.addEventListener("keydown", event => {
137
+ if (event.keyCode === KEYCODE.ENTER) {
138
+ //event.preventDefault();
139
+ //selectedLang.click();
140
+ for (var i = 0; i < selectedLang.length; i++) {
141
+ selectedLang[i].click();
142
+ }
143
+ if (focusedLang) {
144
+ const destinationLanguage = focusedLang.getAttribute("data-l");
145
+ setAriaLabel(destinationLanguage);
146
+ aside.focus();
147
+ }
148
+ toggleSwitcher();
149
+ return;
150
+ }
151
+ if (
152
+ event.keyCode === KEYCODE.ARROWDOWN ||
153
+ event.keyCode === KEYCODE.ARROWUP
154
+ ) {
155
+ event.preventDefault();
156
+ moveFocus(event.keyCode);
157
+ return;
158
+ }
159
+ if (event.keyCode === KEYCODE.ESCAPE && isOpen(aside)) {
160
+ // Close switcher
161
+ event.preventDefault();
162
+ closeSwitcher();
163
+ aside.focus();
164
+ }
165
+ });
166
+
167
+ aside.addEventListener("click", event => {
168
+ if (focusedLang) {
169
+ const destinationLanguage = focusedLang.getAttribute("data-l");
170
+ setAriaLabel(destinationLanguage);
171
+ aside.focus();
172
+ }
173
+ toggleSwitcher();
174
+ return;
175
+ });
176
+
177
+ const moveFocus = keyCode => {
178
+ const direction =
179
+ keyCode === KEYCODE.ARROWDOWN ? "nextSibling" : "previousSibling";
180
+ const openUp = isOpenUp();
181
+
182
+ if (!focusedLang || !isOpen(aside)) {
183
+ // Focus the first or last language
184
+ const selector = openUp ? "ul li.wg-li:last-child" : "ul li.wg-li";
185
+
186
+ for (var i = 0; i < selectedLang.length; i++) {
187
+ //selectedLang[i].click();
188
+ focusedLang = selectedLang[i].parentNode.querySelector(selector);
189
+ }
190
+
191
+ if (!focusedLang) {
192
+ return;
193
+ }
194
+ focusedLang.classList.add("focus");
195
+ focusedLang.childNodes[0].focus();
196
+ focusedLang.scrollIntoView({block: "center"});
197
+
198
+ // if right direction, open it
199
+ const needToOpen =
200
+ (keyCode === KEYCODE.ARROWUP && openUp) ||
201
+ (keyCode === KEYCODE.ARROWDOWN && !openUp);
202
+ if (!isOpen(aside) && needToOpen) {
203
+ openSwitcher();
204
+ }
205
+ return;
206
+ }
207
+
208
+ // Focus next or prev language, if exists
209
+ if (!focusedLang[direction]) {
210
+ // if last element, close it
211
+ if (
212
+ (keyCode === KEYCODE.ARROWUP && !openUp) ||
213
+ (keyCode === KEYCODE.ARROWDOWN && openUp)
214
+ ) {
215
+ closeSwitcher();
216
+ aside.focus();
217
+ }
218
+ return;
219
+ }
220
+
221
+ focusedLang.classList.remove("focus");
222
+ focusedLang = focusedLang[direction];
223
+ focusedLang.classList.add("focus");
224
+ focusedLang.childNodes[0].focus();
225
+ focusedLang.scrollIntoView({block: "center"});
226
+ };
227
+ }
228
+ }
229
+
230
+ return false;
231
+ });
app/styles/index.scss CHANGED
@@ -55,6 +55,10 @@ li.weglot-hide,
55
  padding: 0px;
56
  }
57
 
 
 
 
 
58
  &.weglot-dropdown {
59
  background-color: white;
60
 
55
  padding: 0px;
56
  }
57
 
58
+ &.weglot-custom-switcher-ajax{
59
+ display: none;
60
+ }
61
+
62
  &.weglot-dropdown {
63
  background-color: white;
64
 
bootstrap.php CHANGED
@@ -53,6 +53,7 @@ abstract class Context_Weglot
53
  '\WeglotWP\Services\Regex_Checkers_Service_Weglot',
54
  '\WeglotWP\Services\Generate_Switcher_Service_Weglot',
55
  '\WeglotWP\Services\Email_Translate_Service_Weglot',
 
56
  '\WeglotWP\Services\Translate_Service_Weglot',
57
  '\WeglotWP\Services\Private_Language_Service_Weglot',
58
  '\WeglotWP\Services\Href_Lang_Service_Weglot',
@@ -64,6 +65,7 @@ abstract class Context_Weglot
64
  '\WeglotWP\Third\Gravityforms\Gf_Active',
65
  '\WeglotWP\Third\NinjaForms\Ninja_Active',
66
  '\WeglotWP\Third\Woocommerce\Wc_Active',
 
67
  '\WeglotWP\Third\WPForms\Wpforms_Active',
68
  '\WeglotWP\Third\UnderConstructionPage\Ucp_Active',
69
  '\WeglotWP\Third\Maintenance\Maintenance_Active',
@@ -106,6 +108,8 @@ abstract class Context_Weglot
106
  '\WeglotWP\Third\Woocommerce\WC_Filter_Urls_Weglot',
107
  '\WeglotWP\Third\Woocommerce\WC_Cart_Reload_Weglot',
108
  '\WeglotWP\Third\Woocommerce\WC_Mail_Weglot',
 
 
109
  '\WeglotWP\Third\UnderConstructionPage\Ucp_Tracking',
110
  '\WeglotWP\Third\Maintenance\Maintenance_Tracking',
111
  '\WeglotWP\Third\TheEventsCalendar\Theeventscalendar_Words',
@@ -130,6 +134,14 @@ abstract class Context_Weglot
130
  */
131
  function weglot_init()
132
  {
 
 
 
 
 
 
 
 
133
  if (function_exists('apache_get_modules') && !in_array('mod_rewrite', apache_get_modules())) { //phpcs:ignore
134
  add_action('admin_notices', array('\WeglotWP\Notices\Rewrite_Module_Weglot', 'admin_notice'));
135
  }
53
  '\WeglotWP\Services\Regex_Checkers_Service_Weglot',
54
  '\WeglotWP\Services\Generate_Switcher_Service_Weglot',
55
  '\WeglotWP\Services\Email_Translate_Service_Weglot',
56
+ '\WeglotWP\Services\Pdf_Translate_Service_Weglot',
57
  '\WeglotWP\Services\Translate_Service_Weglot',
58
  '\WeglotWP\Services\Private_Language_Service_Weglot',
59
  '\WeglotWP\Services\Href_Lang_Service_Weglot',
65
  '\WeglotWP\Third\Gravityforms\Gf_Active',
66
  '\WeglotWP\Third\NinjaForms\Ninja_Active',
67
  '\WeglotWP\Third\Woocommerce\Wc_Active',
68
+ '\WeglotWP\Third\Woocommercepdf\Wcpdf_Active',
69
  '\WeglotWP\Third\WPForms\Wpforms_Active',
70
  '\WeglotWP\Third\UnderConstructionPage\Ucp_Active',
71
  '\WeglotWP\Third\Maintenance\Maintenance_Active',
108
  '\WeglotWP\Third\Woocommerce\WC_Filter_Urls_Weglot',
109
  '\WeglotWP\Third\Woocommerce\WC_Cart_Reload_Weglot',
110
  '\WeglotWP\Third\Woocommerce\WC_Mail_Weglot',
111
+ '\WeglotWP\Third\Woocommerce\WC_Mail_Weglot',
112
+ '\WeglotWP\Third\Woocommercepdf\WCPDF_Weglot',
113
  '\WeglotWP\Third\UnderConstructionPage\Ucp_Tracking',
114
  '\WeglotWP\Third\Maintenance\Maintenance_Tracking',
115
  '\WeglotWP\Third\TheEventsCalendar\Theeventscalendar_Words',
134
  */
135
  function weglot_init()
136
  {
137
+
138
+ //add filter to prevent load weglot if not needed
139
+ $cancel_init = apply_filters( 'weglot_cancel_init', false );
140
+
141
+ if( $cancel_init ){
142
+ return;
143
+ }
144
+
145
  if (function_exists('apache_get_modules') && !in_array('mod_rewrite', apache_get_modules())) { //phpcs:ignore
146
  add_action('admin_notices', array('\WeglotWP\Notices\Rewrite_Module_Weglot', 'admin_notice'));
147
  }
composer.json CHANGED
@@ -22,7 +22,7 @@
22
  }
23
  ],
24
  "require": {
25
- "weglot/weglot-php": "^1.3",
26
  "gmulti/morphism-php": "^0.3.0"
27
  },
28
  "repositories": [
22
  }
23
  ],
24
  "require": {
25
+ "weglot/weglot-php": "^1.5",
26
  "gmulti/morphism-php": "^0.3.0"
27
  },
28
  "repositories": [
dist/css/front-css.css CHANGED
@@ -1 +1 @@
1
- .weglot-flags.hw>a:before,.weglot-flags.hw>span:before{background-position:-3570px 0 !important}.weglot-flags.af>a:before,.weglot-flags.af>span:before{background-position:-6570px 0 !important}.weglot-flags.fl>a:before,.weglot-flags.fl>span:before{background-position:-3060px 0 !important}.weglot-flags.sq>a:before,.weglot-flags.sq>span:before{background-position:-2580px 0 !important}.weglot-flags.am>a:before,.weglot-flags.am>span:before{background-position:-5130px 0 !important}.weglot-flags.ar>a:before,.weglot-flags.ar>span:before{background-position:-510px 0 !important}.weglot-flags.hy>a:before,.weglot-flags.hy>span:before{background-position:-1800px 0 !important}.weglot-flags.az>a:before,.weglot-flags.az>span:before{background-position:-6840px 0 !important}.weglot-flags.ba>a:before,.weglot-flags.ba>span:before{background-position:-2040px 0 !important}.weglot-flags.eu>a:before,.weglot-flags.eu>span:before{background-position:-7260px 0 !important}.weglot-flags.be>a:before,.weglot-flags.be>span:before{background-position:-5310px 0 !important}.weglot-flags.bn>a:before,.weglot-flags.bn>span:before{background-position:-5400px 0 !important}.weglot-flags.bs>a:before,.weglot-flags.bs>span:before{background-position:-6390px 0 !important}.weglot-flags.bg>a:before,.weglot-flags.bg>span:before{background-position:-2730px 0 !important}.weglot-flags.br>a:before,.weglot-flags.br>span:before{background-position:-6630px 0 !important}.weglot-flags.my>a:before,.weglot-flags.my>span:before{background-position:-3299px 0 !important}.weglot-flags.ca>a:before,.weglot-flags.ca>span:before{background-position:-7230px 0 !important}.weglot-flags.zh>a:before,.weglot-flags.zh>span:before{background-position:-3690px 0 !important}.weglot-flags.tw>a:before,.weglot-flags.tw>span:before{background-position:-2970px 0 !important}.weglot-flags.km>a:before,.weglot-flags.km>span:before{background-position:-6930px 0 !important}.weglot-flags.ny>a:before,.weglot-flags.ny>span:before{background-position:-1140px 0 !important}.weglot-flags.co>a:before,.weglot-flags.co>span:before{background-position:-2520px 0 !important}.weglot-flags.hr>a:before,.weglot-flags.hr>span:before{background-position:-5910px 0 !important}.weglot-flags.cs>a:before,.weglot-flags.cs>span:before{background-position:-2700px 0 !important}.weglot-flags.da>a:before,.weglot-flags.da>span:before{background-position:-2670px 0 !important}.weglot-flags.nl>a:before,.weglot-flags.nl>span:before{background-position:-2100px 0 !important}.weglot-flags.en>a:before,.weglot-flags.en>span:before{background-position:-1920px 0 !important}.weglot-flags.eo>a:before,.weglot-flags.eo>span:before{background-position:-1920px 0 !important}.weglot-flags.et>a:before,.weglot-flags.et>span:before{background-position:-2640px 0 !important}.weglot-flags.fj>a:before,.weglot-flags.fj>span:before{background-position:-1710px 0 !important}.weglot-flags.fi>a:before,.weglot-flags.fi>span:before{background-position:-2550px 0 !important}.weglot-flags.fr>a:before,.weglot-flags.fr>span:before{background-position:-2520px 0 !important}.weglot-flags.gl>a:before,.weglot-flags.gl>span:before{background-position:-7290px 0 !important}.weglot-flags.ka>a:before,.weglot-flags.ka>span:before{background-position:-5040px 0 !important}.weglot-flags.de>a:before,.weglot-flags.de>span:before{background-position:-2490px 0 !important}.weglot-flags.el>a:before,.weglot-flags.el>span:before{background-position:-2460px 0 !important}.weglot-flags.gu>a:before,.weglot-flags.gu>span:before{background-position:-1170px 0 !important}.weglot-flags.ht>a:before,.weglot-flags.ht>span:before{background-position:-4650px 0 !important}.weglot-flags.ha>a:before,.weglot-flags.ha>span:before{background-position:-900px 0 !important}.weglot-flags.he>a:before,.weglot-flags.he>span:before{background-position:-1050px 0 !important}.weglot-flags.hi>a:before,.weglot-flags.hi>span:before{background-position:-1170px 0 !important}.weglot-flags.hu>a:before,.weglot-flags.hu>span:before{background-position:-2430px 0 !important}.weglot-flags.is>a:before,.weglot-flags.is>span:before{background-position:-2400px 0 !important}.weglot-flags.ig>a:before,.weglot-flags.ig>span:before{background-position:-870px 0 !important}.weglot-flags.id>a:before,.weglot-flags.id>span:before{background-position:-3510px 0 !important}.weglot-flags.ga>a:before,.weglot-flags.ga>span:before{background-position:-2340px 0 !important}.weglot-flags.it>a:before,.weglot-flags.it>span:before{background-position:-2310px 0 !important}.weglot-flags.ja>a:before,.weglot-flags.ja>span:before{background-position:-3480px 0 !important}.weglot-flags.jv>a:before,.weglot-flags.jv>span:before{background-position:-3360px 0 !important}.weglot-flags.kn>a:before,.weglot-flags.kn>span:before{background-position:-1170px 0 !important}.weglot-flags.kk>a:before,.weglot-flags.kk>span:before{background-position:-3150px 0 !important}.weglot-flags.ko>a:before,.weglot-flags.ko>span:before{background-position:-6990px 0 !important}.weglot-flags.ku>a:before,.weglot-flags.ku>span:before{background-position:-2430px 0 !important}.weglot-flags.ky>a:before,.weglot-flags.ky>span:before{background-position:-3420px 0 !important}.weglot-flags.lo>a:before,.weglot-flags.lo>span:before{background-position:-3450px 0 !important}.weglot-flags.la>a:before,.weglot-flags.la>span:before{background-position:-2310px 0 !important}.weglot-flags.lv>a:before,.weglot-flags.lv>span:before{background-position:-2280px 0 !important}.weglot-flags.lt>a:before,.weglot-flags.lt>span:before{background-position:-2250px 0 !important}.weglot-flags.lb>a:before,.weglot-flags.lb>span:before{background-position:-2220px 0 !important}.weglot-flags.mk>a:before,.weglot-flags.mk>span:before{background-position:-2190px 0 !important}.weglot-flags.mg>a:before,.weglot-flags.mg>span:before{background-position:-1200px 0 !important}.weglot-flags.ms>a:before,.weglot-flags.ms>span:before{background-position:-3360px 0 !important}.weglot-flags.ml>a:before,.weglot-flags.ml>span:before{background-position:-1170px 0 !important}.weglot-flags.mt>a:before,.weglot-flags.mt>span:before{background-position:-2130px 0 !important}.weglot-flags.mi>a:before,.weglot-flags.mi>span:before{background-position:-3240px 0 !important}.weglot-flags.mr>a:before,.weglot-flags.mr>span:before{background-position:-1170px 0 !important}.weglot-flags.mn>a:before,.weglot-flags.mn>span:before{background-position:-6000px 0 !important}.weglot-flags.ne>a:before,.weglot-flags.ne>span:before{background-position:-3270px 0 !important}.weglot-flags.no>a:before,.weglot-flags.no>span:before{background-position:-5850px 0 !important}.weglot-flags.ps>a:before,.weglot-flags.ps>span:before{background-position:-5189px 0 !important}.weglot-flags.fa>a:before,.weglot-flags.fa>span:before{background-position:-6690px 0 !important}.weglot-flags.pl>a:before,.weglot-flags.pl>span:before{background-position:-2160px 0 !important}.weglot-flags.pt>a:before,.weglot-flags.pt>span:before{background-position:-1740px 0 !important}.weglot-flags.pa>a:before,.weglot-flags.pa>span:before{background-position:-3180px 0 !important}.weglot-flags.ro>a:before,.weglot-flags.ro>span:before{background-position:-2070px 0 !important}.weglot-flags.ru>a:before,.weglot-flags.ru>span:before{background-position:-2040px 0 !important}.weglot-flags.sm>a:before,.weglot-flags.sm>span:before{background-position:-4620px 0 !important}.weglot-flags.gd>a:before,.weglot-flags.gd>span:before{background-position:-30px 0 !important}.weglot-flags.sr>a:before,.weglot-flags.sr>span:before{background-position:-4290px 0 !important}.weglot-flags.sn>a:before,.weglot-flags.sn>span:before{background-position:-540px 0 !important}.weglot-flags.sd>a:before,.weglot-flags.sd>span:before{background-position:-3180px 0 !important}.weglot-flags.si>a:before,.weglot-flags.si>span:before{background-position:-2820px 0 !important}.weglot-flags.sk>a:before,.weglot-flags.sk>span:before{background-position:-6810px 0 !important}.weglot-flags.sl>a:before,.weglot-flags.sl>span:before{background-position:-2010px 0 !important}.weglot-flags.so>a:before,.weglot-flags.so>span:before{background-position:-4560px 0 !important}.weglot-flags.st>a:before,.weglot-flags.st>span:before{background-position:-4830px 0 !important}.weglot-flags.es>a:before,.weglot-flags.es>span:before{background-position:-480px 0 !important}.weglot-flags.su>a:before,.weglot-flags.su>span:before{background-position:-4530px 0 !important}.weglot-flags.sw>a:before,.weglot-flags.sw>span:before{background-position:-1290px 0 !important}.weglot-flags.sv>a:before,.weglot-flags.sv>span:before{background-position:-1980px 0 !important}.weglot-flags.tl>a:before,.weglot-flags.tl>span:before{background-position:-3060px 0 !important}.weglot-flags.ty>a:before,.weglot-flags.ty>span:before{background-position:-6270px 0 !important}.weglot-flags.tg>a:before,.weglot-flags.tg>span:before{background-position:-2940px 0 !important}.weglot-flags.ta>a:before,.weglot-flags.ta>span:before{background-position:-1170px 0 !important}.weglot-flags.tt>a:before,.weglot-flags.tt>span:before{background-position:-2040px 0 !important}.weglot-flags.te>a:before,.weglot-flags.te>span:before{background-position:-1170px 0 !important}.weglot-flags.th>a:before,.weglot-flags.th>span:before{background-position:-2910px 0 !important}.weglot-flags.to>a:before,.weglot-flags.to>span:before{background-position:-6540px 0 !important}.weglot-flags.tr>a:before,.weglot-flags.tr>span:before{background-position:-1950px 0 !important}.weglot-flags.uk>a:before,.weglot-flags.uk>span:before{background-position:-1890px 0 !important}.weglot-flags.ur>a:before,.weglot-flags.ur>span:before{background-position:-3180px 0 !important}.weglot-flags.uz>a:before,.weglot-flags.uz>span:before{background-position:-2880px 0 !important}.weglot-flags.vi>a:before,.weglot-flags.vi>span:before{background-position:-2850px 0 !important}.weglot-flags.cy>a:before,.weglot-flags.cy>span:before{background-position:-6420px 0 !important}.weglot-flags.fy>a:before,.weglot-flags.fy>span:before{background-position:-2100px 0 !important}.weglot-flags.xh>a:before,.weglot-flags.xh>span:before{background-position:-6570px 0 !important}.weglot-flags.yi>a:before,.weglot-flags.yi>span:before{background-position:-1050px 0 !important}.weglot-flags.yo>a:before,.weglot-flags.yo>span:before{background-position:-870px 0 !important}.weglot-flags.zu>a:before,.weglot-flags.zu>span:before{background-position:-6570px 0 !important}.weglot-flags.flag-1.hw>a:before,.weglot-flags.flag-1.hw>span:before{background-position:-7840px 0 !important}.weglot-flags.flag-1.fl>a:before,.weglot-flags.flag-1.fl>span:before{background-position:2560px 0 !important}.weglot-flags.flag-1.af>a:before,.weglot-flags.flag-1.af>span:before{background-position:-6848px 0 !important}.weglot-flags.flag-1.sq>a:before,.weglot-flags.flag-1.sq>span:before{background-position:-97px 0 !important}.weglot-flags.flag-1.am>a:before,.weglot-flags.flag-1.am>span:before{background-position:-2369px 0 !important}.weglot-flags.flag-1.ar>a:before,.weglot-flags.flag-1.ar>span:before{background-position:-6465px 0 !important}.weglot-flags.flag-1.hy>a:before,.weglot-flags.flag-1.hy>span:before{background-position:-385px 0 !important}.weglot-flags.flag-1.az>a:before,.weglot-flags.flag-1.az>span:before{background-position:-513px 0 !important}.weglot-flags.flag-1.ba>a:before,.weglot-flags.flag-1.ba>span:before{background-position:-6113px 0 !important}.weglot-flags.flag-1.eu>a:before,.weglot-flags.flag-1.eu>span:before{background-position:-8353px 0 !important}.weglot-flags.flag-1.be>a:before,.weglot-flags.flag-1.be>span:before{background-position:-705px 0 !important}.weglot-flags.flag-1.bn>a:before,.weglot-flags.flag-1.bn>span:before{background-position:-609px 0 !important}.weglot-flags.flag-1.bs>a:before,.weglot-flags.flag-1.bs>span:before{background-position:-929px 0 !important}.weglot-flags.flag-1.bg>a:before,.weglot-flags.flag-1.bg>span:before{background-position:-1121px 0 !important}.weglot-flags.flag-1.br>a:before,.weglot-flags.flag-1.br>span:before{background-position:-993px 0 !important}.weglot-flags.flag-1.my>a:before,.weglot-flags.flag-1.my>span:before{background-position:-4929px 0 !important}.weglot-flags.flag-1.ca>a:before,.weglot-flags.flag-1.ca>span:before{background-position:-8321px 0 !important}.weglot-flags.flag-1.zh>a:before,.weglot-flags.flag-1.zh>span:before{background-position:-1505px 0 !important}.weglot-flags.flag-1.tw>a:before,.weglot-flags.flag-1.tw>span:before{background-position:-6369px 0 !important}.weglot-flags.flag-1.km>a:before,.weglot-flags.flag-1.km>span:before{background-position:-1217px 0 !important}.weglot-flags.flag-1.ny>a:before,.weglot-flags.flag-1.ny>span:before{background-position:-4289px 0 !important}.weglot-flags.flag-1.co>a:before,.weglot-flags.flag-1.co>span:before{background-position:-2561px 0 !important}.weglot-flags.flag-1.hr>a:before,.weglot-flags.flag-1.hr>span:before{background-position:-1793px 0 !important}.weglot-flags.flag-1.cs>a:before,.weglot-flags.flag-1.cs>span:before{background-position:-1921px 0 !important}.weglot-flags.flag-1.da>a:before,.weglot-flags.flag-1.da>span:before{background-position:-1985px 0 !important}.weglot-flags.flag-1.nl>a:before,.weglot-flags.flag-1.nl>span:before{background-position:-5121px 0 !important}.weglot-flags.flag-1.en>a:before,.weglot-flags.flag-1.en>span:before{background-position:-7777px 0 !important}.weglot-flags.flag-1.eo>a:before,.weglot-flags.flag-1.eo>span:before{background-position:-7777px 0 !important}.weglot-flags.flag-1.et>a:before,.weglot-flags.flag-1.et>span:before{background-position:-2337px 0 !important}.weglot-flags.flag-1.fj>a:before,.weglot-flags.flag-1.fj>span:before{background-position:-2497px 0 !important}.weglot-flags.flag-1.fi>a:before,.weglot-flags.flag-1.fi>span:before{background-position:-2529px 0 !important}.weglot-flags.flag-1.fr>a:before,.weglot-flags.flag-1.fr>span:before{background-position:-2561px 0 !important}.weglot-flags.flag-1.gl>a:before,.weglot-flags.flag-1.gl>span:before{background-position:-8383px 0 !important}.weglot-flags.flag-1.ka>a:before,.weglot-flags.flag-1.ka>span:before{background-position:-2721px 0 !important}.weglot-flags.flag-1.de>a:before,.weglot-flags.flag-1.de>span:before{background-position:-2753px 0 !important}.weglot-flags.flag-1.el>a:before,.weglot-flags.flag-1.el>span:before{background-position:-2881px 0 !important}.weglot-flags.flag-1.gu>a:before,.weglot-flags.flag-1.gu>span:before{background-position:-3329px 0 !important}.weglot-flags.flag-1.ht>a:before,.weglot-flags.flag-1.ht>span:before{background-position:-3169px 0 !important}.weglot-flags.flag-1.ha>a:before,.weglot-flags.flag-1.ha>span:before{background-position:-5281px 0 !important}.weglot-flags.flag-1.he>a:before,.weglot-flags.flag-1.he>span:before{background-position:-3521px 0 !important}.weglot-flags.flag-1.hi>a:before,.weglot-flags.flag-1.hi>span:before{background-position:-3329px 0 !important}.weglot-flags.flag-1.hu>a:before,.weglot-flags.flag-1.hu>span:before{background-position:-3265px 0 !important}.weglot-flags.flag-1.is>a:before,.weglot-flags.flag-1.is>span:before{background-position:-3297px 0 !important}.weglot-flags.flag-1.ig>a:before,.weglot-flags.flag-1.ig>span:before{background-position:-5313px 0 !important}.weglot-flags.flag-1.id>a:before,.weglot-flags.flag-1.id>span:before{background-position:-3361px 0 !important}.weglot-flags.flag-1.ga>a:before,.weglot-flags.flag-1.ga>span:before{background-position:-3457px 0 !important}.weglot-flags.flag-1.it>a:before,.weglot-flags.flag-1.it>span:before{background-position:-3553px 0 !important}.weglot-flags.flag-1.ja>a:before,.weglot-flags.flag-1.ja>span:before{background-position:-3617px 0 !important}.weglot-flags.flag-1.jv>a:before,.weglot-flags.flag-1.jv>span:before{background-position:-4321px 0 !important}.weglot-flags.flag-1.kn>a:before,.weglot-flags.flag-1.kn>span:before{background-position:-3329px 0 !important}.weglot-flags.flag-1.kk>a:before,.weglot-flags.flag-1.kk>span:before{background-position:-3713px 0 !important}.weglot-flags.flag-1.ko>a:before,.weglot-flags.flag-1.ko>span:before{background-position:-6913px 0 !important}.weglot-flags.flag-1.ku>a:before,.weglot-flags.flag-1.ku>span:before{background-position:-3265px 0 !important}.weglot-flags.flag-1.ky>a:before,.weglot-flags.flag-1.ky>span:before{background-position:-3873px 0 !important}.weglot-flags.flag-1.lo>a:before,.weglot-flags.flag-1.lo>span:before{background-position:-3904px 0 !important}.weglot-flags.flag-1.la>a:before,.weglot-flags.flag-1.la>span:before{background-position:-3553px 0 !important}.weglot-flags.flag-1.lv>a:before,.weglot-flags.flag-1.lv>span:before{background-position:-3937px 0 !important}.weglot-flags.flag-1.lt>a:before,.weglot-flags.flag-1.lt>span:before{background-position:-4129px 0 !important}.weglot-flags.flag-1.lb>a:before,.weglot-flags.flag-1.lb>span:before{background-position:-4161px 0 !important}.weglot-flags.flag-1.mk>a:before,.weglot-flags.flag-1.mk>span:before{background-position:-4225px 0 !important}.weglot-flags.flag-1.mg>a:before,.weglot-flags.flag-1.mg>span:before{background-position:-4257px 0 !important}.weglot-flags.flag-1.ms>a:before,.weglot-flags.flag-1.ms>span:before{background-position:-4321px 0 !important}.weglot-flags.flag-1.ml>a:before,.weglot-flags.flag-1.ml>span:before{background-position:-3329px 0 !important}.weglot-flags.flag-1.mt>a:before,.weglot-flags.flag-1.mt>span:before{background-position:-4417px 0 !important}.weglot-flags.flag-1.mi>a:before,.weglot-flags.flag-1.mi>span:before{background-position:-5217px 0 !important}.weglot-flags.flag-1.mr>a:before,.weglot-flags.flag-1.mr>span:before{background-position:-3329px 0 !important}.weglot-flags.flag-1.mn>a:before,.weglot-flags.flag-1.mn>span:before{background-position:-4769px 0 !important}.weglot-flags.flag-1.ne>a:before,.weglot-flags.flag-1.ne>span:before{background-position:-5091px 0 !important}.weglot-flags.flag-1.no>a:before,.weglot-flags.flag-1.no>span:before{background-position:-5505px 0 !important}.weglot-flags.flag-1.ps>a:before,.weglot-flags.flag-1.ps>span:before{background-position:-33px 0 !important}.weglot-flags.flag-1.fa>a:before,.weglot-flags.flag-1.fa>span:before{background-position:-3393px 0 !important}.weglot-flags.flag-1.pl>a:before,.weglot-flags.flag-1.pl>span:before{background-position:-5889px 0 !important}.weglot-flags.flag-1.pt>a:before,.weglot-flags.flag-1.pt>span:before{background-position:-5921px 0 !important}.weglot-flags.flag-1.pa>a:before,.weglot-flags.flag-1.pa>span:before{background-position:-3329px 0 !important}.weglot-flags.flag-1.ro>a:before,.weglot-flags.flag-1.ro>span:before{background-position:-6081px 0 !important}.weglot-flags.flag-1.ru>a:before,.weglot-flags.flag-1.ru>span:before{background-position:-6113px 0 !important}.weglot-flags.flag-1.sm>a:before,.weglot-flags.flag-1.sm>span:before{background-position:-6369px 0 !important}.weglot-flags.flag-1.gd>a:before,.weglot-flags.flag-1.gd>span:before{background-position:-6497px 0 !important}.weglot-flags.flag-1.sr>a:before,.weglot-flags.flag-1.sr>span:before{background-position:-6561px 0 !important}.weglot-flags.flag-1.sn>a:before,.weglot-flags.flag-1.sn>span:before{background-position:-8287px 0 !important}.weglot-flags.flag-1.sd>a:before,.weglot-flags.flag-1.sd>span:before{background-position:-5601px 0 !important}.weglot-flags.flag-1.si>a:before,.weglot-flags.flag-1.si>span:before{background-position:-7039px 0 !important}.weglot-flags.flag-1.sk>a:before,.weglot-flags.flag-1.sk>span:before{background-position:-6689px 0 !important}.weglot-flags.flag-1.sl>a:before,.weglot-flags.flag-1.sl>span:before{background-position:-6721px 0 !important}.weglot-flags.flag-1.so>a:before,.weglot-flags.flag-1.so>span:before{background-position:-6785px 0 !important}.weglot-flags.flag-1.st>a:before,.weglot-flags.flag-1.st>span:before{background-position:-4001px 0 !important}.weglot-flags.flag-1.es>a:before,.weglot-flags.flag-1.es>span:before{background-position:-7009px 0 !important}.weglot-flags.flag-1.su>a:before,.weglot-flags.flag-1.su>span:before{background-position:-7073px 0 !important}.weglot-flags.flag-1.sw>a:before,.weglot-flags.flag-1.sw>span:before{background-position:-3745px 0 !important}.weglot-flags.flag-1.sv>a:before,.weglot-flags.flag-1.sv>span:before{background-position:-7169px 0 !important}.weglot-flags.flag-1.tl>a:before,.weglot-flags.flag-1.tl>span:before{background-position:-5823px 0 !important}.weglot-flags.flag-1.ty>a:before,.weglot-flags.flag-1.ty>span:before{background-position:-2593px 0 !important}.weglot-flags.flag-1.tg>a:before,.weglot-flags.flag-1.tg>span:before{background-position:-7297px 0 !important}.weglot-flags.flag-1.ta>a:before,.weglot-flags.flag-1.ta>span:before{background-position:-3329px 0 !important}.weglot-flags.flag-1.tt>a:before,.weglot-flags.flag-1.tt>span:before{background-position:-6113px 0 !important}.weglot-flags.flag-1.te>a:before,.weglot-flags.flag-1.te>span:before{background-position:-3329px 0 !important}.weglot-flags.flag-1.th>a:before,.weglot-flags.flag-1.th>span:before{background-position:-7361px 0 !important}.weglot-flags.flag-1.to>a:before,.weglot-flags.flag-1.to>span:before{background-position:-7456px 0 !important}.weglot-flags.flag-1.tr>a:before,.weglot-flags.flag-1.tr>span:before{background-position:-7553px 0 !important}.weglot-flags.flag-1.uk>a:before,.weglot-flags.flag-1.uk>span:before{background-position:-7713px 0 !important}.weglot-flags.flag-1.ur>a:before,.weglot-flags.flag-1.ur>span:before{background-position:-5600px 0 !important}.weglot-flags.flag-1.uz>a:before,.weglot-flags.flag-1.uz>span:before{background-position:-7969px 0 !important}.weglot-flags.flag-1.vi>a:before,.weglot-flags.flag-1.vi>span:before{background-position:-8097px 0 !important}.weglot-flags.flag-1.cy>a:before,.weglot-flags.flag-1.cy>span:before{background-position:-8129px 0 !important}.weglot-flags.flag-1.fy>a:before,.weglot-flags.flag-1.fy>span:before{background-position:-5121px 0 !important}.weglot-flags.flag-1.xh>a:before,.weglot-flags.flag-1.xh>span:before{background-position:-6848px 0 !important}.weglot-flags.flag-1.yi>a:before,.weglot-flags.flag-1.yi>span:before{background-position:-3521px 0 !important}.weglot-flags.flag-1.yo>a:before,.weglot-flags.flag-1.yo>span:before{background-position:-5313px 0 !important}.weglot-flags.flag-1.zu>a:before,.weglot-flags.flag-1.zu>span:before{background-position:-6848px 0 !important}.weglot-flags.flag-2.hw>a:before,.weglot-flags.flag-2.hw>span:before{background-position:-5448px 0 !important}.weglot-flags.flag-2.fl>a:before,.weglot-flags.flag-2.fl>span:before{background-position:-1008px 0 !important}.weglot-flags.flag-2.af>a:before,.weglot-flags.flag-2.af>span:before{background-position:-4968px 0 !important}.weglot-flags.flag-2.sq>a:before,.weglot-flags.flag-2.sq>span:before{background-position:-2976px 0 !important}.weglot-flags.flag-2.am>a:before,.weglot-flags.flag-2.am>span:before{background-position:-3816px 0 !important}.weglot-flags.flag-2.ar>a:before,.weglot-flags.flag-2.ar>span:before{background-position:-768px 0 !important}.weglot-flags.flag-2.hy>a:before,.weglot-flags.flag-2.hy>span:before{background-position:0 0 !important}.weglot-flags.flag-2.az>a:before,.weglot-flags.flag-2.az>span:before{background-position:-5136px 0 !important}.weglot-flags.flag-2.ba>a:before,.weglot-flags.flag-2.ba>span:before{background-position:-936px 0 !important}.weglot-flags.flag-2.eu>a:before,.weglot-flags.flag-2.eu>span:before{background-position:-5376px 0 !important}.weglot-flags.flag-2.be>a:before,.weglot-flags.flag-2.be>span:before{background-position:-4224px 0 !important}.weglot-flags.flag-2.bn>a:before,.weglot-flags.flag-2.bn>span:before{background-position:-4056px 0 !important}.weglot-flags.flag-2.bs>a:before,.weglot-flags.flag-2.bs>span:before{background-position:-3984px 0 !important}.weglot-flags.flag-2.bg>a:before,.weglot-flags.flag-2.bg>span:before{background-position:-5040px 0 !important}.weglot-flags.flag-2.br>a:before,.weglot-flags.flag-2.br>span:before{background-position:-2784px 0 !important}.weglot-flags.flag-2.my>a:before,.weglot-flags.flag-2.my>span:before{background-position:-1248px 0 !important}.weglot-flags.flag-2.ca>a:before,.weglot-flags.flag-2.ca>span:before{background-position:-5352px 0 !important}.weglot-flags.flag-2.zh>a:before,.weglot-flags.flag-2.zh>span:before{background-position:-2592px 0 !important}.weglot-flags.flag-2.tw>a:before,.weglot-flags.flag-2.tw>span:before{background-position:-3408px 0 !important}.weglot-flags.flag-2.km>a:before,.weglot-flags.flag-2.km>span:before{background-position:-5160px 0 !important}.weglot-flags.flag-2.ny>a:before,.weglot-flags.flag-2.ny>span:before{background-position:-1392px 0 !important}.weglot-flags.flag-2.co>a:before,.weglot-flags.flag-2.co>span:before{background-position:-2304px 0 !important}.weglot-flags.flag-2.hr>a:before,.weglot-flags.flag-2.hr>span:before{background-position:-4416px 0 !important}.weglot-flags.flag-2.cs>a:before,.weglot-flags.flag-2.cs>span:before{background-position:-2472px 0 !important}.weglot-flags.flag-2.da>a:before,.weglot-flags.flag-2.da>span:before{background-position:-2448px 0 !important}.weglot-flags.flag-2.nl>a:before,.weglot-flags.flag-2.nl>span:before{background-position:-1296px 0 !important}.weglot-flags.flag-2.en>a:before,.weglot-flags.flag-2.en>span:before{background-position:-312px 0 !important}.weglot-flags.flag-2.eo>a:before,.weglot-flags.flag-2.eo>span:before{background-position:-312px 0 !important}.weglot-flags.flag-2.et>a:before,.weglot-flags.flag-2.et>span:before{background-position:-2424px 0 !important}.weglot-flags.flag-2.fj>a:before,.weglot-flags.flag-2.fj>span:before{background-position:-576px 0 !important}.weglot-flags.flag-2.fi>a:before,.weglot-flags.flag-2.fi>span:before{background-position:-2328px 0 !important}.weglot-flags.flag-2.fr>a:before,.weglot-flags.flag-2.fr>span:before{background-position:-2304px 0 !important}.weglot-flags.flag-2.gl>a:before,.weglot-flags.flag-2.gl>span:before{background-position:-5400px 0 !important}.weglot-flags.flag-2.ka>a:before,.weglot-flags.flag-2.ka>span:before{background-position:-3744px 0 !important}.weglot-flags.flag-2.de>a:before,.weglot-flags.flag-2.de>span:before{background-position:-2256px 0 !important}.weglot-flags.flag-2.el>a:before,.weglot-flags.flag-2.el>span:before{background-position:-2208px 0 !important}.weglot-flags.flag-2.gu>a:before,.weglot-flags.flag-2.gu>span:before{background-position:-1728px 0 !important}.weglot-flags.flag-2.ht>a:before,.weglot-flags.flag-2.ht>span:before{background-position:-3528px 0 !important}.weglot-flags.flag-2.ha>a:before,.weglot-flags.flag-2.ha>span:before{background-position:-1176px 0 !important}.weglot-flags.flag-2.he>a:before,.weglot-flags.flag-2.he>span:before{background-position:-1992px 0 !important}.weglot-flags.flag-2.hi>a:before,.weglot-flags.flag-2.hi>span:before{background-position:-1728px 0 !important}.weglot-flags.flag-2.hu>a:before,.weglot-flags.flag-2.hu>span:before{background-position:-2088px 0 !important}.weglot-flags.flag-2.is>a:before,.weglot-flags.flag-2.is>span:before{background-position:-2064px 0 !important}.weglot-flags.flag-2.ig>a:before,.weglot-flags.flag-2.ig>span:before{background-position:-1103px 0 !important}.weglot-flags.flag-2.id>a:before,.weglot-flags.flag-2.id>span:before{background-position:-2040px 0 !important}.weglot-flags.flag-2.ga>a:before,.weglot-flags.flag-2.ga>span:before{background-position:-2016px 0 !important}.weglot-flags.flag-2.it>a:before,.weglot-flags.flag-2.it>span:before{background-position:-1968px 0 !important}.weglot-flags.flag-2.ja>a:before,.weglot-flags.flag-2.ja>span:before{background-position:-1920px 0 !important}.weglot-flags.flag-2.jv>a:before,.weglot-flags.flag-2.jv>span:before{background-position:-1536px 0 !important}.weglot-flags.flag-2.kn>a:before,.weglot-flags.flag-2.kn>span:before{background-position:-1728px 0 !important}.weglot-flags.flag-2.kk>a:before,.weglot-flags.flag-2.kk>span:before{background-position:-1704px 0 !important}.weglot-flags.flag-2.ko>a:before,.weglot-flags.flag-2.ko>span:before{background-position:-1848px 0 !important}.weglot-flags.flag-2.ku>a:before,.weglot-flags.flag-2.ku>span:before{background-position:-2088px 0 !important}.weglot-flags.flag-2.ky>a:before,.weglot-flags.flag-2.ky>span:before{background-position:-1800px 0 !important}.weglot-flags.flag-2.lo>a:before,.weglot-flags.flag-2.lo>span:before{background-position:-1776px 0 !important}.weglot-flags.flag-2.la>a:before,.weglot-flags.flag-2.la>span:before{background-position:-1968px 0 !important}.weglot-flags.flag-2.lv>a:before,.weglot-flags.flag-2.lv>span:before{background-position:-1752px 0 !important}.weglot-flags.flag-2.lt>a:before,.weglot-flags.flag-2.lt>span:before{background-position:-1656px 0 !important}.weglot-flags.flag-2.lb>a:before,.weglot-flags.flag-2.lb>span:before{background-position:-1632px 0 !important}.weglot-flags.flag-2.mk>a:before,.weglot-flags.flag-2.mk>span:before{background-position:-1440px 0 !important}.weglot-flags.flag-2.mg>a:before,.weglot-flags.flag-2.mg>span:before{background-position:-1560px 0 !important}.weglot-flags.flag-2.ms>a:before,.weglot-flags.flag-2.ms>span:before{background-position:-1536px 0 !important}.weglot-flags.flag-2.ml>a:before,.weglot-flags.flag-2.ml>span:before{background-position:-1728px 0 !important}.weglot-flags.flag-2.mt>a:before,.weglot-flags.flag-2.mt>span:before{background-position:-1200px 0 !important}.weglot-flags.flag-2.mi>a:before,.weglot-flags.flag-2.mi>span:before{background-position:-1224px 0 !important}.weglot-flags.flag-2.mr>a:before,.weglot-flags.flag-2.mr>span:before{background-position:-1728px 0 !important}.weglot-flags.flag-2.mn>a:before,.weglot-flags.flag-2.mn>span:before{background-position:-4800px 0 !important}.weglot-flags.flag-2.ne>a:before,.weglot-flags.flag-2.ne>span:before{background-position:-1320px 0 !important}.weglot-flags.flag-2.no>a:before,.weglot-flags.flag-2.no>span:before{background-position:-4776px 0 !important}.weglot-flags.flag-2.ps>a:before,.weglot-flags.flag-2.ps>span:before{background-position:-4008px 0 !important}.weglot-flags.flag-2.fa>a:before,.weglot-flags.flag-2.fa>span:before{background-position:-5088px 0 !important}.weglot-flags.flag-2.pl>a:before,.weglot-flags.flag-2.pl>span:before{background-position:-984px 0 !important}.weglot-flags.flag-2.pt>a:before,.weglot-flags.flag-2.pt>span:before{background-position:-528px 0 !important}.weglot-flags.flag-2.pa>a:before,.weglot-flags.flag-2.pa>span:before{background-position:-1728px 0 !important}.weglot-flags.flag-2.ro>a:before,.weglot-flags.flag-2.ro>span:before{background-position:-960px 0 !important}.weglot-flags.flag-2.ru>a:before,.weglot-flags.flag-2.ru>span:before{background-position:-936px 0 !important}.weglot-flags.flag-2.sm>a:before,.weglot-flags.flag-2.sm>span:before{background-position:-3408px 0 !important}.weglot-flags.flag-2.gd>a:before,.weglot-flags.flag-2.gd>span:before{background-position:-4872px 0 !important}.weglot-flags.flag-2.sr>a:before,.weglot-flags.flag-2.sr>span:before{background-position:-3120px 0 !important}.weglot-flags.flag-2.sn>a:before,.weglot-flags.flag-2.sn>span:before{background-position:-72px 0 !important}.weglot-flags.flag-2.sd>a:before,.weglot-flags.flag-2.sd>span:before{background-position:-1128px 0 !important}.weglot-flags.flag-2.si>a:before,.weglot-flags.flag-2.si>span:before{background-position:-480px 0 !important}.weglot-flags.flag-2.sk>a:before,.weglot-flags.flag-2.sk>span:before{background-position:-4152px 0 !important}.weglot-flags.flag-2.sl>a:before,.weglot-flags.flag-2.sl>span:before{background-position:-696px 0 !important}.weglot-flags.flag-2.so>a:before,.weglot-flags.flag-2.so>span:before{background-position:-3336px 0 !important}.weglot-flags.flag-2.st>a:before,.weglot-flags.flag-2.st>span:before{background-position:-3552px 0 !important}.weglot-flags.flag-2.es>a:before,.weglot-flags.flag-2.es>span:before{background-position:-96px 0 !important}.weglot-flags.flag-2.su>a:before,.weglot-flags.flag-2.su>span:before{background-position:-3312px 0 !important}.weglot-flags.flag-2.sw>a:before,.weglot-flags.flag-2.sw>span:before{background-position:-1872px 0 !important}.weglot-flags.flag-2.sv>a:before,.weglot-flags.flag-2.sv>span:before{background-position:-552px 0 !important}.weglot-flags.flag-2.tl>a:before,.weglot-flags.flag-2.tl>span:before{background-position:-1008px 0 !important}.weglot-flags.flag-2.ty>a:before,.weglot-flags.flag-2.ty>span:before{background-position:-4512px 0 !important}.weglot-flags.flag-2.tg>a:before,.weglot-flags.flag-2.tg>span:before{background-position:-264px 0 !important}.weglot-flags.flag-2.ta>a:before,.weglot-flags.flag-2.ta>span:before{background-position:-1728px 0 !important}.weglot-flags.flag-2.tt>a:before,.weglot-flags.flag-2.tt>span:before{background-position:-936px 0 !important}.weglot-flags.flag-2.te>a:before,.weglot-flags.flag-2.te>span:before{background-position:-1728px 0 !important}.weglot-flags.flag-2.th>a:before,.weglot-flags.flag-2.th>span:before{background-position:-456px 0 !important}.weglot-flags.flag-2.to>a:before,.weglot-flags.flag-2.to>span:before{background-position:-3264px 0 !important}.weglot-flags.flag-2.tr>a:before,.weglot-flags.flag-2.tr>span:before{background-position:-360px 0 !important}.weglot-flags.flag-2.uk>a:before,.weglot-flags.flag-2.uk>span:before{background-position:-288px 0 !important}.weglot-flags.flag-2.ur>a:before,.weglot-flags.flag-2.ur>span:before{background-position:-1128px 0 !important}.weglot-flags.flag-2.uz>a:before,.weglot-flags.flag-2.uz>span:before{background-position:-240px 0 !important}.weglot-flags.flag-2.vi>a:before,.weglot-flags.flag-2.vi>span:before{background-position:-144px 0 !important}.weglot-flags.flag-2.cy>a:before,.weglot-flags.flag-2.cy>span:before{background-position:-4848px 0 !important}.weglot-flags.flag-2.fy>a:before,.weglot-flags.flag-2.fy>span:before{background-position:-1296px 0 !important}.weglot-flags.flag-2.xh>a:before,.weglot-flags.flag-2.xh>span:before{background-position:-4968px 0 !important}.weglot-flags.flag-2.yi>a:before,.weglot-flags.flag-2.yi>span:before{background-position:-1992px 0 !important}.weglot-flags.flag-2.yo>a:before,.weglot-flags.flag-2.yo>span:before{background-position:-1103px 0 !important}.weglot-flags.flag-2.zu>a:before,.weglot-flags.flag-2.zu>span:before{background-position:-4968px 0 !important}.weglot-flags.flag-3.hw>a:before,.weglot-flags.flag-3.hw>span:before{background-position:-2711px 0 !important}.weglot-flags.flag-3.fl>a:before,.weglot-flags.flag-3.fl>span:before{background-position:-5232px 0 !important}.weglot-flags.flag-3.af>a:before,.weglot-flags.flag-3.af>span:before{background-position:-5496px 0 !important}.weglot-flags.flag-3.sq>a:before,.weglot-flags.flag-3.sq>span:before{background-position:-4776px 0 !important}.weglot-flags.flag-3.am>a:before,.weglot-flags.flag-3.am>span:before{background-position:-192px 0 !important}.weglot-flags.flag-3.ar>a:before,.weglot-flags.flag-3.ar>span:before{background-position:-3336px 0 !important}.weglot-flags.flag-3.hy>a:before,.weglot-flags.flag-3.hy>span:before{background-position:-4632px 0 !important}.weglot-flags.flag-3.az>a:before,.weglot-flags.flag-3.az>span:before{background-position:-4536px 0 !important}.weglot-flags.flag-3.ba>a:before,.weglot-flags.flag-3.ba>span:before{background-position:-2664px 0 !important}.weglot-flags.flag-3.eu>a:before,.weglot-flags.flag-3.eu>span:before{background-position:-5808px 0 !important}.weglot-flags.flag-3.be>a:before,.weglot-flags.flag-3.be>span:before{background-position:-144px 0 !important}.weglot-flags.flag-3.bn>a:before,.weglot-flags.flag-3.bn>span:before{background-position:-4488px 0 !important}.weglot-flags.flag-3.bs>a:before,.weglot-flags.flag-3.bs>span:before{background-position:-4392px 0 !important}.weglot-flags.flag-3.bg>a:before,.weglot-flags.flag-3.bg>span:before{background-position:-4296px 0 !important}.weglot-flags.flag-3.br>a:before,.weglot-flags.flag-3.br>span:before{background-position:-4344px 0 !important}.weglot-flags.flag-3.my>a:before,.weglot-flags.flag-3.my>span:before{background-position:-3769px 0 !important}.weglot-flags.flag-3.ca>a:before,.weglot-flags.flag-3.ca>span:before{background-position:-5784px 0 !important}.weglot-flags.flag-3.zh>a:before,.weglot-flags.flag-3.zh>span:before{background-position:-3240px 0 !important}.weglot-flags.flag-3.tw>a:before,.weglot-flags.flag-3.tw>span:before{background-position:-4008px 0 !important}.weglot-flags.flag-3.km>a:before,.weglot-flags.flag-3.km>span:before{background-position:-4201px 0 !important}.weglot-flags.flag-3.ny>a:before,.weglot-flags.flag-3.ny>span:before{background-position:-384px 0 !important}.weglot-flags.flag-3.co>a:before,.weglot-flags.flag-3.co>span:before{background-position:-2760px 0 !important}.weglot-flags.flag-3.hr>a:before,.weglot-flags.flag-3.hr>span:before{background-position:-3048px 0 !important}.weglot-flags.flag-3.cs>a:before,.weglot-flags.flag-3.cs>span:before{background-position:-5280px 0 !important}.weglot-flags.flag-3.da>a:before,.weglot-flags.flag-3.da>span:before{background-position:-3024px 0 !important}.weglot-flags.flag-3.nl>a:before,.weglot-flags.flag-3.nl>span:before{background-position:-3360px 0 !important}.weglot-flags.flag-3.en>a:before,.weglot-flags.flag-3.en>span:before{background-position:-2520px 0 !important}.weglot-flags.flag-3.eo>a:before,.weglot-flags.flag-3.eo>span:before{background-position:-2520px 0 !important}.weglot-flags.flag-3.et>a:before,.weglot-flags.flag-3.et>span:before{background-position:-2856px 0 !important}.weglot-flags.flag-3.fj>a:before,.weglot-flags.flag-3.fj>span:before{background-position:-0px 0 !important}.weglot-flags.flag-3.fi>a:before,.weglot-flags.flag-3.fi>span:before{background-position:-2784px 0 !important}.weglot-flags.flag-3.fr>a:before,.weglot-flags.flag-3.fr>span:before{background-position:-2760px 0 !important}.weglot-flags.flag-3.gl>a:before,.weglot-flags.flag-3.gl>span:before{background-position:-5832px 0 !important}.weglot-flags.flag-3.ka>a:before,.weglot-flags.flag-3.ka>span:before{background-position:-1536px 0 !important}.weglot-flags.flag-3.de>a:before,.weglot-flags.flag-3.de>span:before{background-position:-1488px 0 !important}.weglot-flags.flag-3.el>a:before,.weglot-flags.flag-3.el>span:before{background-position:-1416px 0 !important}.weglot-flags.flag-3.gu>a:before,.weglot-flags.flag-3.gu>span:before{background-position:-2304px 0 !important}.weglot-flags.flag-3.ht>a:before,.weglot-flags.flag-3.ht>span:before{background-position:-5160px 0 !important}.weglot-flags.flag-3.ha>a:before,.weglot-flags.flag-3.ha>span:before{background-position:-361px 0 !important}.weglot-flags.flag-3.he>a:before,.weglot-flags.flag-3.he>span:before{background-position:-1608px 0 !important}.weglot-flags.flag-3.hi>a:before,.weglot-flags.flag-3.hi>span:before{background-position:-2304px 0 !important}.weglot-flags.flag-3.hu>a:before,.weglot-flags.flag-3.hu>span:before{background-position:-1920px 0 !important}.weglot-flags.flag-3.is>a:before,.weglot-flags.flag-3.is>span:before{background-position:-840px 0 !important}.weglot-flags.flag-3.ig>a:before,.weglot-flags.flag-3.ig>span:before{background-position:-3457px 0 !important}.weglot-flags.flag-3.id>a:before,.weglot-flags.flag-3.id>span:before{background-position:-4992px 0 !important}.weglot-flags.flag-3.ga>a:before,.weglot-flags.flag-3.ga>span:before{background-position:-2016px 0 !important}.weglot-flags.flag-3.it>a:before,.weglot-flags.flag-3.it>span:before{background-position:-336px 0 !important}.weglot-flags.flag-3.ja>a:before,.weglot-flags.flag-3.ja>span:before{background-position:-2448px 0 !important}.weglot-flags.flag-3.jv>a:before,.weglot-flags.flag-3.jv>span:before{background-position:-864px 0 !important}.weglot-flags.flag-3.kn>a:before,.weglot-flags.flag-3.kn>span:before{background-position:-2304px 0 !important}.weglot-flags.flag-3.kk>a:before,.weglot-flags.flag-3.kk>span:before{background-position:-3912px 0 !important}.weglot-flags.flag-3.ko>a:before,.weglot-flags.flag-3.ko>span:before{background-position:-2256px 0 !important}.weglot-flags.flag-3.ku>a:before,.weglot-flags.flag-3.ku>span:before{background-position:-1920px 0 !important}.weglot-flags.flag-3.ky>a:before,.weglot-flags.flag-3.ky>span:before{background-position:-744px 0 !important}.weglot-flags.flag-3.lo>a:before,.weglot-flags.flag-3.lo>span:before{background-position:-3816px 0 !important}.weglot-flags.flag-3.la>a:before,.weglot-flags.flag-3.la>span:before{background-position:-336px 0 !important}.weglot-flags.flag-3.lv>a:before,.weglot-flags.flag-3.lv>span:before{background-position:-216px 0 !important}.weglot-flags.flag-3.lt>a:before,.weglot-flags.flag-3.lt>span:before{background-position:-1776px 0 !important}.weglot-flags.flag-3.lb>a:before,.weglot-flags.flag-3.lb>span:before{background-position:-1945px 0 !important}.weglot-flags.flag-3.mk>a:before,.weglot-flags.flag-3.mk>span:before{background-position:-2208px 0 !important}.weglot-flags.flag-3.mg>a:before,.weglot-flags.flag-3.mg>span:before{background-position:-5064px 0 !important}.weglot-flags.flag-3.ms>a:before,.weglot-flags.flag-3.ms>span:before{background-position:-864px 0 !important}.weglot-flags.flag-3.ml>a:before,.weglot-flags.flag-3.ml>span:before{background-position:-2304px 0 !important}.weglot-flags.flag-3.mt>a:before,.weglot-flags.flag-3.mt>span:before{background-position:-4920px 0 !important}.weglot-flags.flag-3.mi>a:before,.weglot-flags.flag-3.mi>span:before{background-position:-2113px 0 !important}.weglot-flags.flag-3.mr>a:before,.weglot-flags.flag-3.mr>span:before{background-position:-2304px 0 !important}.weglot-flags.flag-3.mn>a:before,.weglot-flags.flag-3.mn>span:before{background-position:-24px 0 !important}.weglot-flags.flag-3.ne>a:before,.weglot-flags.flag-3.ne>span:before{background-position:-5642px 0 !important}.weglot-flags.flag-3.no>a:before,.weglot-flags.flag-3.no>span:before{background-position:-984px 0 !important}.weglot-flags.flag-3.ps>a:before,.weglot-flags.flag-3.ps>span:before{background-position:-4753px 0 !important}.weglot-flags.flag-3.fa>a:before,.weglot-flags.flag-3.fa>span:before{background-position:-816px 0 !important}.weglot-flags.flag-3.pl>a:before,.weglot-flags.flag-3.pl>span:before{background-position:-4944px 0 !important}.weglot-flags.flag-3.pt>a:before,.weglot-flags.flag-3.pt>span:before{background-position:-3504px 0 !important}.weglot-flags.flag-3.pa>a:before,.weglot-flags.flag-3.pa>span:before{background-position:-2304px 0 !important}.weglot-flags.flag-3.ro>a:before,.weglot-flags.flag-3.ro>span:before{background-position:-3744px 0 !important}.weglot-flags.flag-3.ru>a:before,.weglot-flags.flag-3.ru>span:before{background-position:-2664px 0 !important}.weglot-flags.flag-3.sm>a:before,.weglot-flags.flag-3.sm>span:before{background-position:-1248px 0 !important}.weglot-flags.flag-3.gd>a:before,.weglot-flags.flag-3.gd>span:before{background-position:-3841px 0 !important}.weglot-flags.flag-3.sr>a:before,.weglot-flags.flag-3.sr>span:before{background-position:-3312px 0 !important}.weglot-flags.flag-3.sn>a:before,.weglot-flags.flag-3.sn>span:before{background-position:-5521px 0 !important}.weglot-flags.flag-3.sd>a:before,.weglot-flags.flag-3.sd>span:before{background-position:-1993px 0 !important}.weglot-flags.flag-3.si>a:before,.weglot-flags.flag-3.si>span:before{background-position:-2833px 0 !important}.weglot-flags.flag-3.sk>a:before,.weglot-flags.flag-3.sk>span:before{background-position:-552px 0 !important}.weglot-flags.flag-3.sl>a:before,.weglot-flags.flag-3.sl>span:before{background-position:-936px 0 !important}.weglot-flags.flag-3.so>a:before,.weglot-flags.flag-3.so>span:before{background-position:-4032px 0 !important}.weglot-flags.flag-3.st>a:before,.weglot-flags.flag-3.st>span:before{background-position:-3961px 0 !important}.weglot-flags.flag-3.es>a:before,.weglot-flags.flag-3.es>span:before{background-position:-3576px 0 !important}.weglot-flags.flag-3.su>a:before,.weglot-flags.flag-3.su>span:before{background-position:-3985px 0 !important}.weglot-flags.flag-3.sw>a:before,.weglot-flags.flag-3.sw>span:before{background-position:-912px 0 !important}.weglot-flags.flag-3.sv>a:before,.weglot-flags.flag-3.sv>span:before{background-position:-264px 0 !important}.weglot-flags.flag-3.tl>a:before,.weglot-flags.flag-3.tl>span:before{background-position:-5232px 0 !important}.weglot-flags.flag-3.ty>a:before,.weglot-flags.flag-3.ty>span:before{background-position:-1512px 0 !important}.weglot-flags.flag-3.tg>a:before,.weglot-flags.flag-3.tg>span:before{background-position:-3720px 0 !important}.weglot-flags.flag-3.ta>a:before,.weglot-flags.flag-3.ta>span:before{background-position:-2304px 0 !important}.weglot-flags.flag-3.tt>a:before,.weglot-flags.flag-3.tt>span:before{background-position:-2664px 0 !important}.weglot-flags.flag-3.te>a:before,.weglot-flags.flag-3.te>span:before{background-position:-2304px 0 !important}.weglot-flags.flag-3.th>a:before,.weglot-flags.flag-3.th>span:before{background-position:-4848px 0 !important}.weglot-flags.flag-3.to>a:before,.weglot-flags.flag-3.to>span:before{background-position:-1680px 0 !important}.weglot-flags.flag-3.tr>a:before,.weglot-flags.flag-3.tr>span:before{background-position:-432px 0 !important}.weglot-flags.flag-3.uk>a:before,.weglot-flags.flag-3.uk>span:before{background-position:-5736px 0 !important}.weglot-flags.flag-3.ur>a:before,.weglot-flags.flag-3.ur>span:before{background-position:-1992px 0 !important}.weglot-flags.flag-3.uz>a:before,.weglot-flags.flag-3.uz>span:before{background-position:-2160px 0 !important}.weglot-flags.flag-3.vi>a:before,.weglot-flags.flag-3.vi>span:before{background-position:-3384px 0 !important}.weglot-flags.flag-3.cy>a:before,.weglot-flags.flag-3.cy>span:before{background-position:-5040px 0 !important}.weglot-flags.flag-3.fy>a:before,.weglot-flags.flag-3.fy>span:before{background-position:-3360px 0 !important}.weglot-flags.flag-3.xh>a:before,.weglot-flags.flag-3.xh>span:before{background-position:-5496px 0 !important}.weglot-flags.flag-3.yi>a:before,.weglot-flags.flag-3.yi>span:before{background-position:-1608px 0 !important}.weglot-flags.flag-3.yo>a:before,.weglot-flags.flag-3.yo>span:before{background-position:-3457px 0 !important}.weglot-flags.flag-3.zu>a:before,.weglot-flags.flag-3.zu>span:before{background-position:-5496px 0 !important}body div[id^="mega-menu-wrap"] #mega-menu-primary li.mega-menu-item.weglot-flags a.mega-menu-link:before{background-image:url("../images/rect_mate.png") !important;background-size:auto 20px !important;border-radius:0px !important;width:30px !important;height:20px !important;content:"";vertical-align:middle;margin-right:10px;display:inline-block;overflow:hidden}body div[id^="mega-menu-wrap"] #mega-menu-primary li.mega-menu-item.weglot-flags.flag-1 .mega-menu-link:before{background-image:url("../images/rect_bright.png") !important}body div[id^="mega-menu-wrap"] #mega-menu-primary li.mega-menu-item.weglot-flags.flag-2 .mega-menu-link:before{background-image:url("../images/square_flag.png") !important;width:24px !important;height:24px !important;background-size:auto 24px !important}body div[id^="mega-menu-wrap"] #mega-menu-primary li.mega-menu-item.weglot-flags.flag-3 .mega-menu-link:before{background-image:url("../images/circular_flag.png") !important;width:24px !important;height:24px !important;background-size:auto 24px !important}#wp-admin-bar-weglot>.ab-item{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIj48ZyBmaWxsPSIjYTBhNWFhIj48cGF0aCBkPSJNMjEuNzM5IDkyLjU2NWw1MS44MjggMTI5LjczMiAyMy42Ni02MC4yNzkgMjQuMTQ0IDYwLjI3OUwxNzMuMiA5Mi41NjVoLTI4LjAwN2wtMjMuODIyIDU4Ljc1LTIzLjkwMi01OC43NS0yMy45MDIgNTguNzUtMjMuOTAyLTU4Ljc1SDIxLjczOXoiLz48cGF0aCBkPSJNMjEwLjAwNiA5Mi43MWMtMTcuODY2IDAtMzMuMTU3IDYuMzU4LTQ1Ljg3MyAxOS4wNzQtMTIuNzE1IDEyLjcxNi0xOC45OTMgMjguMDA2LTE4Ljk5MyA0NS43OTIgMCAxNy44NjcgNi4yNzggMzMuMTU4IDE4Ljk5MyA0NS44NzMgMTIuNzE2IDEyLjcxNiAyOC4wMDcgMTguOTkzIDQ1Ljg3MyAxOC45OTMgMTcuNzg2IDAgMzMuMDc3LTYuMjc3IDQ1Ljc5My0xOC45OTMgMTIuNzE1LTEyLjcxNSAxOS4wNzMtMjguMDA2IDE5LjA3My00NS44NzMgMC00LjUwNy0uNDgzLTguODUyLTEuMjg4LTEyLjk1N2gtNjMuNTc4djI1LjkxNGgzNi42OTljLTIuNzM3IDcuNTY1LTcuNDg1IDEzLjg0My0xNC4wODQgMTguNjcxLTYuNjggNC44My0xNC4yNDUgNy4yNDQtMjIuNjE1IDcuMjQ0LTEwLjc4NCAwLTE5Ljk1OC0zLjc4My0yNy41MjMtMTEuMzQ4LTcuNTY2LTcuNTY1LTExLjM0OC0xNi43NC0xMS4zNDgtMjcuNTI0IDAtMTAuNjIzIDMuNzgyLTE5Ljc5OCAxMS4zNDgtMjcuNDQzIDcuNTY1LTcuNjQ1IDE2Ljc0LTExLjUwOCAyNy41MjMtMTEuNTA4IDEwLjYyMyAwIDE5Ljc5OCAzLjg2MyAyNy41MjQgMTEuNDI4bDE4LjM1LTE4LjM1YTY3Ljk2MyA2Ny45NjMgMCAwMC0yMC43NjQtMTMuODQyYy03Ljg4Ny0zLjM4LTE2LjI1Ny01LjE1LTI1LjExLTUuMTV6Ii8+PC9nPjwvc3ZnPg==") !important;-webkit-background-size:22px auto !important;background-size:22px auto !important;background-repeat:no-repeat !important;background-position:4px 5px !important;padding-left:30px !important}li.weglot-hide,.weglot-hide{display:none !important}.country-selector{z-index:9999;text-align:left;position:relative;display:inline-block;width:auto}.country-selector a{padding:0 10px;outline:none;text-decoration:none;float:none !important;white-space:nowrap;font-weight:normal;cursor:pointer;color:black;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.country-selector a:focus{outline:none}.country-selector ul{padding:0px;z-index:1010;list-style:none;margin:0}.country-selector li{margin:0px;padding:0px}.country-selector.weglot-dropdown{background-color:white}.country-selector.weglot-dropdown a,.country-selector.weglot-dropdown span{display:block;height:37px;line-height:36px;font-size:13px;padding:0 10px;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;font-weight:normal}.country-selector.weglot-dropdown a:hover,.country-selector.weglot-dropdown span:hover{cursor:pointer}.country-selector.weglot-dropdown .wgcurrent{border:1px solid #e0e0e0;list-style:none;display:block;margin:0}.country-selector.weglot-dropdown .wgcurrent a,.country-selector.weglot-dropdown .wgcurrent span{padding-right:60px}.country-selector.weglot-dropdown .wgcurrent:after{display:inline-block;position:absolute;top:17px;right:8px;width:13px;height:7px;-ms-interpolation-mode:nearest-neighbor;image-rendering:-webkit-optimize-contrast;image-rendering:-moz-crisp-edges;image-rendering:-o-pixelated;image-rendering:pixelated;background:url("../images/wgarrowdown.png") no-repeat;content:"";-webkit-transition:all 200ms;-o-transition:all 200ms;transition:all 200ms;-webkit-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg)}.country-selector.weglot-dropdown ul{position:absolute;min-width:100%;border:1px solid #ebeef0;background:white;left:0;top:initial;-webkit-box-sizing:border-box;box-sizing:border-box;display:none;padding:0}.country-selector.weglot-dropdown input:checked ~ ul{display:block}.country-selector.weglot-dropdown input:checked ~ .wgcurrent:after{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg)}.country-selector.weglot-dropdown li{width:100%}.country-selector.weglot-dropdown.weglot-invert ul{bottom:38px}.country-selector.weglot-dropdown.weglot-invert input:checked ~ .wgcurrent:after{-webkit-transform:rotate(-180deg);-ms-transform:rotate(-180deg);transform:rotate(-180deg)}.country-selector.weglot-default{position:fixed;bottom:0px;right:40px}.country-selector.weglot-inline a:hover{text-decoration:underline;color:#00a0d2}.country-selector.weglot-inline .wgcurrent a{text-decoration:underline}.country-selector.weglot-inline label{margin-bottom:0;display:inline-block;vertical-align:middle}.country-selector.weglot-inline ul{display:inline-block;vertical-align:middle}.country-selector.weglot-inline li{line-height:1 !important;display:inline-block;margin:2px 0px;vertical-align:middle}.country-selector.weglot-inline.weglot-default{bottom:5px}.country-selector input{display:none !important}.navbar .navbar-nav li.weglot-flags a.weglot-lang:before{position:static;-webkit-transform:none;-ms-transform:none;transform:none;-webkit-transition:none;-o-transition:none;transition:none}.js .main-navigation .country-selector ul{display:none}html[dir="rtl"] .weglot-flags a:before,html[dir="rtl"] .weglot-flags span:before{margin-right:0;margin-left:10px}.weglot-flags>a:before,.weglot-flags>span.wglanguage-name:before{background-image:url("../images/rect_mate.png");-webkit-background-size:auto 20px !important;background-size:auto 20px !important;border-radius:0px !important;width:30px !important;height:20px !important;content:"";vertical-align:middle;margin-right:10px;display:inline-block;overflow:hidden}.weglot-flags.flag-1>a:before,.weglot-flags.flag-1>span:before{background-image:url("../images/rect_bright.png")}.weglot-flags.flag-2>a:before,.weglot-flags.flag-2>span:before{background-image:url("../images/square_flag.png");width:24px !important;height:24px !important;-webkit-background-size:auto 24px !important;background-size:auto 24px !important}.weglot-flags.flag-3 a:before,.weglot-flags.flag-3 span:before{background-image:url("../images/circular_flag.png");width:24px !important;height:24px !important;-webkit-background-size:auto 24px !important;background-size:auto 24px !important}.weglot-flags>a span:before{background-image:none !important;display:none !important}.weglot-flags>span a:before{background-image:none !important;display:none !important}
1
+ .weglot-flags.hw>a:before,.weglot-flags.hw>span:before{background-position:-3570px 0 !important}.weglot-flags.af>a:before,.weglot-flags.af>span:before{background-position:-6570px 0 !important}.weglot-flags.fl>a:before,.weglot-flags.fl>span:before{background-position:-3060px 0 !important}.weglot-flags.sq>a:before,.weglot-flags.sq>span:before{background-position:-2580px 0 !important}.weglot-flags.am>a:before,.weglot-flags.am>span:before{background-position:-5130px 0 !important}.weglot-flags.ar>a:before,.weglot-flags.ar>span:before{background-position:-510px 0 !important}.weglot-flags.hy>a:before,.weglot-flags.hy>span:before{background-position:-1800px 0 !important}.weglot-flags.az>a:before,.weglot-flags.az>span:before{background-position:-6840px 0 !important}.weglot-flags.ba>a:before,.weglot-flags.ba>span:before{background-position:-2040px 0 !important}.weglot-flags.eu>a:before,.weglot-flags.eu>span:before{background-position:-7260px 0 !important}.weglot-flags.be>a:before,.weglot-flags.be>span:before{background-position:-5310px 0 !important}.weglot-flags.bn>a:before,.weglot-flags.bn>span:before{background-position:-5400px 0 !important}.weglot-flags.bs>a:before,.weglot-flags.bs>span:before{background-position:-6390px 0 !important}.weglot-flags.bg>a:before,.weglot-flags.bg>span:before{background-position:-2730px 0 !important}.weglot-flags.br>a:before,.weglot-flags.br>span:before{background-position:-6630px 0 !important}.weglot-flags.my>a:before,.weglot-flags.my>span:before{background-position:-3299px 0 !important}.weglot-flags.ca>a:before,.weglot-flags.ca>span:before{background-position:-7230px 0 !important}.weglot-flags.zh>a:before,.weglot-flags.zh>span:before{background-position:-3690px 0 !important}.weglot-flags.tw>a:before,.weglot-flags.tw>span:before{background-position:-2970px 0 !important}.weglot-flags.km>a:before,.weglot-flags.km>span:before{background-position:-6930px 0 !important}.weglot-flags.ny>a:before,.weglot-flags.ny>span:before{background-position:-1140px 0 !important}.weglot-flags.co>a:before,.weglot-flags.co>span:before{background-position:-2520px 0 !important}.weglot-flags.hr>a:before,.weglot-flags.hr>span:before{background-position:-5910px 0 !important}.weglot-flags.cs>a:before,.weglot-flags.cs>span:before{background-position:-2700px 0 !important}.weglot-flags.da>a:before,.weglot-flags.da>span:before{background-position:-2670px 0 !important}.weglot-flags.nl>a:before,.weglot-flags.nl>span:before{background-position:-2100px 0 !important}.weglot-flags.en>a:before,.weglot-flags.en>span:before{background-position:-1920px 0 !important}.weglot-flags.eo>a:before,.weglot-flags.eo>span:before{background-position:-1920px 0 !important}.weglot-flags.et>a:before,.weglot-flags.et>span:before{background-position:-2640px 0 !important}.weglot-flags.fj>a:before,.weglot-flags.fj>span:before{background-position:-1710px 0 !important}.weglot-flags.fi>a:before,.weglot-flags.fi>span:before{background-position:-2550px 0 !important}.weglot-flags.fr>a:before,.weglot-flags.fr>span:before{background-position:-2520px 0 !important}.weglot-flags.gl>a:before,.weglot-flags.gl>span:before{background-position:-7290px 0 !important}.weglot-flags.ka>a:before,.weglot-flags.ka>span:before{background-position:-5040px 0 !important}.weglot-flags.de>a:before,.weglot-flags.de>span:before{background-position:-2490px 0 !important}.weglot-flags.el>a:before,.weglot-flags.el>span:before{background-position:-2460px 0 !important}.weglot-flags.gu>a:before,.weglot-flags.gu>span:before{background-position:-1170px 0 !important}.weglot-flags.ht>a:before,.weglot-flags.ht>span:before{background-position:-4650px 0 !important}.weglot-flags.ha>a:before,.weglot-flags.ha>span:before{background-position:-900px 0 !important}.weglot-flags.he>a:before,.weglot-flags.he>span:before{background-position:-1050px 0 !important}.weglot-flags.hi>a:before,.weglot-flags.hi>span:before{background-position:-1170px 0 !important}.weglot-flags.hu>a:before,.weglot-flags.hu>span:before{background-position:-2430px 0 !important}.weglot-flags.is>a:before,.weglot-flags.is>span:before{background-position:-2400px 0 !important}.weglot-flags.ig>a:before,.weglot-flags.ig>span:before{background-position:-870px 0 !important}.weglot-flags.id>a:before,.weglot-flags.id>span:before{background-position:-3510px 0 !important}.weglot-flags.ga>a:before,.weglot-flags.ga>span:before{background-position:-2340px 0 !important}.weglot-flags.it>a:before,.weglot-flags.it>span:before{background-position:-2310px 0 !important}.weglot-flags.ja>a:before,.weglot-flags.ja>span:before{background-position:-3480px 0 !important}.weglot-flags.jv>a:before,.weglot-flags.jv>span:before{background-position:-3360px 0 !important}.weglot-flags.kn>a:before,.weglot-flags.kn>span:before{background-position:-1170px 0 !important}.weglot-flags.kk>a:before,.weglot-flags.kk>span:before{background-position:-3150px 0 !important}.weglot-flags.ko>a:before,.weglot-flags.ko>span:before{background-position:-6990px 0 !important}.weglot-flags.ku>a:before,.weglot-flags.ku>span:before{background-position:-2430px 0 !important}.weglot-flags.ky>a:before,.weglot-flags.ky>span:before{background-position:-3420px 0 !important}.weglot-flags.lo>a:before,.weglot-flags.lo>span:before{background-position:-3450px 0 !important}.weglot-flags.la>a:before,.weglot-flags.la>span:before{background-position:-2310px 0 !important}.weglot-flags.lv>a:before,.weglot-flags.lv>span:before{background-position:-2280px 0 !important}.weglot-flags.lt>a:before,.weglot-flags.lt>span:before{background-position:-2250px 0 !important}.weglot-flags.lb>a:before,.weglot-flags.lb>span:before{background-position:-2220px 0 !important}.weglot-flags.mk>a:before,.weglot-flags.mk>span:before{background-position:-2190px 0 !important}.weglot-flags.mg>a:before,.weglot-flags.mg>span:before{background-position:-1200px 0 !important}.weglot-flags.ms>a:before,.weglot-flags.ms>span:before{background-position:-3360px 0 !important}.weglot-flags.ml>a:before,.weglot-flags.ml>span:before{background-position:-1170px 0 !important}.weglot-flags.mt>a:before,.weglot-flags.mt>span:before{background-position:-2130px 0 !important}.weglot-flags.mi>a:before,.weglot-flags.mi>span:before{background-position:-3240px 0 !important}.weglot-flags.mr>a:before,.weglot-flags.mr>span:before{background-position:-1170px 0 !important}.weglot-flags.mn>a:before,.weglot-flags.mn>span:before{background-position:-6000px 0 !important}.weglot-flags.ne>a:before,.weglot-flags.ne>span:before{background-position:-3270px 0 !important}.weglot-flags.no>a:before,.weglot-flags.no>span:before{background-position:-5850px 0 !important}.weglot-flags.ps>a:before,.weglot-flags.ps>span:before{background-position:-5189px 0 !important}.weglot-flags.fa>a:before,.weglot-flags.fa>span:before{background-position:-6690px 0 !important}.weglot-flags.pl>a:before,.weglot-flags.pl>span:before{background-position:-2160px 0 !important}.weglot-flags.pt>a:before,.weglot-flags.pt>span:before{background-position:-1740px 0 !important}.weglot-flags.pa>a:before,.weglot-flags.pa>span:before{background-position:-3180px 0 !important}.weglot-flags.ro>a:before,.weglot-flags.ro>span:before{background-position:-2070px 0 !important}.weglot-flags.ru>a:before,.weglot-flags.ru>span:before{background-position:-2040px 0 !important}.weglot-flags.sm>a:before,.weglot-flags.sm>span:before{background-position:-4620px 0 !important}.weglot-flags.gd>a:before,.weglot-flags.gd>span:before{background-position:-30px 0 !important}.weglot-flags.sr>a:before,.weglot-flags.sr>span:before{background-position:-4290px 0 !important}.weglot-flags.sn>a:before,.weglot-flags.sn>span:before{background-position:-540px 0 !important}.weglot-flags.sd>a:before,.weglot-flags.sd>span:before{background-position:-3180px 0 !important}.weglot-flags.si>a:before,.weglot-flags.si>span:before{background-position:-2820px 0 !important}.weglot-flags.sk>a:before,.weglot-flags.sk>span:before{background-position:-6810px 0 !important}.weglot-flags.sl>a:before,.weglot-flags.sl>span:before{background-position:-2010px 0 !important}.weglot-flags.so>a:before,.weglot-flags.so>span:before{background-position:-4560px 0 !important}.weglot-flags.st>a:before,.weglot-flags.st>span:before{background-position:-4830px 0 !important}.weglot-flags.es>a:before,.weglot-flags.es>span:before{background-position:-480px 0 !important}.weglot-flags.su>a:before,.weglot-flags.su>span:before{background-position:-4530px 0 !important}.weglot-flags.sw>a:before,.weglot-flags.sw>span:before{background-position:-1290px 0 !important}.weglot-flags.sv>a:before,.weglot-flags.sv>span:before{background-position:-1980px 0 !important}.weglot-flags.tl>a:before,.weglot-flags.tl>span:before{background-position:-3060px 0 !important}.weglot-flags.ty>a:before,.weglot-flags.ty>span:before{background-position:-6270px 0 !important}.weglot-flags.tg>a:before,.weglot-flags.tg>span:before{background-position:-2940px 0 !important}.weglot-flags.ta>a:before,.weglot-flags.ta>span:before{background-position:-1170px 0 !important}.weglot-flags.tt>a:before,.weglot-flags.tt>span:before{background-position:-2040px 0 !important}.weglot-flags.te>a:before,.weglot-flags.te>span:before{background-position:-1170px 0 !important}.weglot-flags.th>a:before,.weglot-flags.th>span:before{background-position:-2910px 0 !important}.weglot-flags.to>a:before,.weglot-flags.to>span:before{background-position:-6540px 0 !important}.weglot-flags.tr>a:before,.weglot-flags.tr>span:before{background-position:-1950px 0 !important}.weglot-flags.uk>a:before,.weglot-flags.uk>span:before{background-position:-1890px 0 !important}.weglot-flags.ur>a:before,.weglot-flags.ur>span:before{background-position:-3180px 0 !important}.weglot-flags.uz>a:before,.weglot-flags.uz>span:before{background-position:-2880px 0 !important}.weglot-flags.vi>a:before,.weglot-flags.vi>span:before{background-position:-2850px 0 !important}.weglot-flags.cy>a:before,.weglot-flags.cy>span:before{background-position:-6420px 0 !important}.weglot-flags.fy>a:before,.weglot-flags.fy>span:before{background-position:-2100px 0 !important}.weglot-flags.xh>a:before,.weglot-flags.xh>span:before{background-position:-6570px 0 !important}.weglot-flags.yi>a:before,.weglot-flags.yi>span:before{background-position:-1050px 0 !important}.weglot-flags.yo>a:before,.weglot-flags.yo>span:before{background-position:-870px 0 !important}.weglot-flags.zu>a:before,.weglot-flags.zu>span:before{background-position:-6570px 0 !important}.weglot-flags.flag-1.hw>a:before,.weglot-flags.flag-1.hw>span:before{background-position:-7840px 0 !important}.weglot-flags.flag-1.fl>a:before,.weglot-flags.flag-1.fl>span:before{background-position:2560px 0 !important}.weglot-flags.flag-1.af>a:before,.weglot-flags.flag-1.af>span:before{background-position:-6848px 0 !important}.weglot-flags.flag-1.sq>a:before,.weglot-flags.flag-1.sq>span:before{background-position:-97px 0 !important}.weglot-flags.flag-1.am>a:before,.weglot-flags.flag-1.am>span:before{background-position:-2369px 0 !important}.weglot-flags.flag-1.ar>a:before,.weglot-flags.flag-1.ar>span:before{background-position:-6465px 0 !important}.weglot-flags.flag-1.hy>a:before,.weglot-flags.flag-1.hy>span:before{background-position:-385px 0 !important}.weglot-flags.flag-1.az>a:before,.weglot-flags.flag-1.az>span:before{background-position:-513px 0 !important}.weglot-flags.flag-1.ba>a:before,.weglot-flags.flag-1.ba>span:before{background-position:-6113px 0 !important}.weglot-flags.flag-1.eu>a:before,.weglot-flags.flag-1.eu>span:before{background-position:-8353px 0 !important}.weglot-flags.flag-1.be>a:before,.weglot-flags.flag-1.be>span:before{background-position:-705px 0 !important}.weglot-flags.flag-1.bn>a:before,.weglot-flags.flag-1.bn>span:before{background-position:-609px 0 !important}.weglot-flags.flag-1.bs>a:before,.weglot-flags.flag-1.bs>span:before{background-position:-929px 0 !important}.weglot-flags.flag-1.bg>a:before,.weglot-flags.flag-1.bg>span:before{background-position:-1121px 0 !important}.weglot-flags.flag-1.br>a:before,.weglot-flags.flag-1.br>span:before{background-position:-993px 0 !important}.weglot-flags.flag-1.my>a:before,.weglot-flags.flag-1.my>span:before{background-position:-4929px 0 !important}.weglot-flags.flag-1.ca>a:before,.weglot-flags.flag-1.ca>span:before{background-position:-8321px 0 !important}.weglot-flags.flag-1.zh>a:before,.weglot-flags.flag-1.zh>span:before{background-position:-1505px 0 !important}.weglot-flags.flag-1.tw>a:before,.weglot-flags.flag-1.tw>span:before{background-position:-6369px 0 !important}.weglot-flags.flag-1.km>a:before,.weglot-flags.flag-1.km>span:before{background-position:-1217px 0 !important}.weglot-flags.flag-1.ny>a:before,.weglot-flags.flag-1.ny>span:before{background-position:-4289px 0 !important}.weglot-flags.flag-1.co>a:before,.weglot-flags.flag-1.co>span:before{background-position:-2561px 0 !important}.weglot-flags.flag-1.hr>a:before,.weglot-flags.flag-1.hr>span:before{background-position:-1793px 0 !important}.weglot-flags.flag-1.cs>a:before,.weglot-flags.flag-1.cs>span:before{background-position:-1921px 0 !important}.weglot-flags.flag-1.da>a:before,.weglot-flags.flag-1.da>span:before{background-position:-1985px 0 !important}.weglot-flags.flag-1.nl>a:before,.weglot-flags.flag-1.nl>span:before{background-position:-5121px 0 !important}.weglot-flags.flag-1.en>a:before,.weglot-flags.flag-1.en>span:before{background-position:-7777px 0 !important}.weglot-flags.flag-1.eo>a:before,.weglot-flags.flag-1.eo>span:before{background-position:-7777px 0 !important}.weglot-flags.flag-1.et>a:before,.weglot-flags.flag-1.et>span:before{background-position:-2337px 0 !important}.weglot-flags.flag-1.fj>a:before,.weglot-flags.flag-1.fj>span:before{background-position:-2497px 0 !important}.weglot-flags.flag-1.fi>a:before,.weglot-flags.flag-1.fi>span:before{background-position:-2529px 0 !important}.weglot-flags.flag-1.fr>a:before,.weglot-flags.flag-1.fr>span:before{background-position:-2561px 0 !important}.weglot-flags.flag-1.gl>a:before,.weglot-flags.flag-1.gl>span:before{background-position:-8383px 0 !important}.weglot-flags.flag-1.ka>a:before,.weglot-flags.flag-1.ka>span:before{background-position:-2721px 0 !important}.weglot-flags.flag-1.de>a:before,.weglot-flags.flag-1.de>span:before{background-position:-2753px 0 !important}.weglot-flags.flag-1.el>a:before,.weglot-flags.flag-1.el>span:before{background-position:-2881px 0 !important}.weglot-flags.flag-1.gu>a:before,.weglot-flags.flag-1.gu>span:before{background-position:-3329px 0 !important}.weglot-flags.flag-1.ht>a:before,.weglot-flags.flag-1.ht>span:before{background-position:-3169px 0 !important}.weglot-flags.flag-1.ha>a:before,.weglot-flags.flag-1.ha>span:before{background-position:-5281px 0 !important}.weglot-flags.flag-1.he>a:before,.weglot-flags.flag-1.he>span:before{background-position:-3521px 0 !important}.weglot-flags.flag-1.hi>a:before,.weglot-flags.flag-1.hi>span:before{background-position:-3329px 0 !important}.weglot-flags.flag-1.hu>a:before,.weglot-flags.flag-1.hu>span:before{background-position:-3265px 0 !important}.weglot-flags.flag-1.is>a:before,.weglot-flags.flag-1.is>span:before{background-position:-3297px 0 !important}.weglot-flags.flag-1.ig>a:before,.weglot-flags.flag-1.ig>span:before{background-position:-5313px 0 !important}.weglot-flags.flag-1.id>a:before,.weglot-flags.flag-1.id>span:before{background-position:-3361px 0 !important}.weglot-flags.flag-1.ga>a:before,.weglot-flags.flag-1.ga>span:before{background-position:-3457px 0 !important}.weglot-flags.flag-1.it>a:before,.weglot-flags.flag-1.it>span:before{background-position:-3553px 0 !important}.weglot-flags.flag-1.ja>a:before,.weglot-flags.flag-1.ja>span:before{background-position:-3617px 0 !important}.weglot-flags.flag-1.jv>a:before,.weglot-flags.flag-1.jv>span:before{background-position:-4321px 0 !important}.weglot-flags.flag-1.kn>a:before,.weglot-flags.flag-1.kn>span:before{background-position:-3329px 0 !important}.weglot-flags.flag-1.kk>a:before,.weglot-flags.flag-1.kk>span:before{background-position:-3713px 0 !important}.weglot-flags.flag-1.ko>a:before,.weglot-flags.flag-1.ko>span:before{background-position:-6913px 0 !important}.weglot-flags.flag-1.ku>a:before,.weglot-flags.flag-1.ku>span:before{background-position:-3265px 0 !important}.weglot-flags.flag-1.ky>a:before,.weglot-flags.flag-1.ky>span:before{background-position:-3873px 0 !important}.weglot-flags.flag-1.lo>a:before,.weglot-flags.flag-1.lo>span:before{background-position:-3904px 0 !important}.weglot-flags.flag-1.la>a:before,.weglot-flags.flag-1.la>span:before{background-position:-3553px 0 !important}.weglot-flags.flag-1.lv>a:before,.weglot-flags.flag-1.lv>span:before{background-position:-3937px 0 !important}.weglot-flags.flag-1.lt>a:before,.weglot-flags.flag-1.lt>span:before{background-position:-4129px 0 !important}.weglot-flags.flag-1.lb>a:before,.weglot-flags.flag-1.lb>span:before{background-position:-4161px 0 !important}.weglot-flags.flag-1.mk>a:before,.weglot-flags.flag-1.mk>span:before{background-position:-4225px 0 !important}.weglot-flags.flag-1.mg>a:before,.weglot-flags.flag-1.mg>span:before{background-position:-4257px 0 !important}.weglot-flags.flag-1.ms>a:before,.weglot-flags.flag-1.ms>span:before{background-position:-4321px 0 !important}.weglot-flags.flag-1.ml>a:before,.weglot-flags.flag-1.ml>span:before{background-position:-3329px 0 !important}.weglot-flags.flag-1.mt>a:before,.weglot-flags.flag-1.mt>span:before{background-position:-4417px 0 !important}.weglot-flags.flag-1.mi>a:before,.weglot-flags.flag-1.mi>span:before{background-position:-5217px 0 !important}.weglot-flags.flag-1.mr>a:before,.weglot-flags.flag-1.mr>span:before{background-position:-3329px 0 !important}.weglot-flags.flag-1.mn>a:before,.weglot-flags.flag-1.mn>span:before{background-position:-4769px 0 !important}.weglot-flags.flag-1.ne>a:before,.weglot-flags.flag-1.ne>span:before{background-position:-5091px 0 !important}.weglot-flags.flag-1.no>a:before,.weglot-flags.flag-1.no>span:before{background-position:-5505px 0 !important}.weglot-flags.flag-1.ps>a:before,.weglot-flags.flag-1.ps>span:before{background-position:-33px 0 !important}.weglot-flags.flag-1.fa>a:before,.weglot-flags.flag-1.fa>span:before{background-position:-3393px 0 !important}.weglot-flags.flag-1.pl>a:before,.weglot-flags.flag-1.pl>span:before{background-position:-5889px 0 !important}.weglot-flags.flag-1.pt>a:before,.weglot-flags.flag-1.pt>span:before{background-position:-5921px 0 !important}.weglot-flags.flag-1.pa>a:before,.weglot-flags.flag-1.pa>span:before{background-position:-3329px 0 !important}.weglot-flags.flag-1.ro>a:before,.weglot-flags.flag-1.ro>span:before{background-position:-6081px 0 !important}.weglot-flags.flag-1.ru>a:before,.weglot-flags.flag-1.ru>span:before{background-position:-6113px 0 !important}.weglot-flags.flag-1.sm>a:before,.weglot-flags.flag-1.sm>span:before{background-position:-6369px 0 !important}.weglot-flags.flag-1.gd>a:before,.weglot-flags.flag-1.gd>span:before{background-position:-6497px 0 !important}.weglot-flags.flag-1.sr>a:before,.weglot-flags.flag-1.sr>span:before{background-position:-6561px 0 !important}.weglot-flags.flag-1.sn>a:before,.weglot-flags.flag-1.sn>span:before{background-position:-8287px 0 !important}.weglot-flags.flag-1.sd>a:before,.weglot-flags.flag-1.sd>span:before{background-position:-5601px 0 !important}.weglot-flags.flag-1.si>a:before,.weglot-flags.flag-1.si>span:before{background-position:-7039px 0 !important}.weglot-flags.flag-1.sk>a:before,.weglot-flags.flag-1.sk>span:before{background-position:-6689px 0 !important}.weglot-flags.flag-1.sl>a:before,.weglot-flags.flag-1.sl>span:before{background-position:-6721px 0 !important}.weglot-flags.flag-1.so>a:before,.weglot-flags.flag-1.so>span:before{background-position:-6785px 0 !important}.weglot-flags.flag-1.st>a:before,.weglot-flags.flag-1.st>span:before{background-position:-4001px 0 !important}.weglot-flags.flag-1.es>a:before,.weglot-flags.flag-1.es>span:before{background-position:-7009px 0 !important}.weglot-flags.flag-1.su>a:before,.weglot-flags.flag-1.su>span:before{background-position:-7073px 0 !important}.weglot-flags.flag-1.sw>a:before,.weglot-flags.flag-1.sw>span:before{background-position:-3745px 0 !important}.weglot-flags.flag-1.sv>a:before,.weglot-flags.flag-1.sv>span:before{background-position:-7169px 0 !important}.weglot-flags.flag-1.tl>a:before,.weglot-flags.flag-1.tl>span:before{background-position:-5823px 0 !important}.weglot-flags.flag-1.ty>a:before,.weglot-flags.flag-1.ty>span:before{background-position:-2593px 0 !important}.weglot-flags.flag-1.tg>a:before,.weglot-flags.flag-1.tg>span:before{background-position:-7297px 0 !important}.weglot-flags.flag-1.ta>a:before,.weglot-flags.flag-1.ta>span:before{background-position:-3329px 0 !important}.weglot-flags.flag-1.tt>a:before,.weglot-flags.flag-1.tt>span:before{background-position:-6113px 0 !important}.weglot-flags.flag-1.te>a:before,.weglot-flags.flag-1.te>span:before{background-position:-3329px 0 !important}.weglot-flags.flag-1.th>a:before,.weglot-flags.flag-1.th>span:before{background-position:-7361px 0 !important}.weglot-flags.flag-1.to>a:before,.weglot-flags.flag-1.to>span:before{background-position:-7456px 0 !important}.weglot-flags.flag-1.tr>a:before,.weglot-flags.flag-1.tr>span:before{background-position:-7553px 0 !important}.weglot-flags.flag-1.uk>a:before,.weglot-flags.flag-1.uk>span:before{background-position:-7713px 0 !important}.weglot-flags.flag-1.ur>a:before,.weglot-flags.flag-1.ur>span:before{background-position:-5600px 0 !important}.weglot-flags.flag-1.uz>a:before,.weglot-flags.flag-1.uz>span:before{background-position:-7969px 0 !important}.weglot-flags.flag-1.vi>a:before,.weglot-flags.flag-1.vi>span:before{background-position:-8097px 0 !important}.weglot-flags.flag-1.cy>a:before,.weglot-flags.flag-1.cy>span:before{background-position:-8129px 0 !important}.weglot-flags.flag-1.fy>a:before,.weglot-flags.flag-1.fy>span:before{background-position:-5121px 0 !important}.weglot-flags.flag-1.xh>a:before,.weglot-flags.flag-1.xh>span:before{background-position:-6848px 0 !important}.weglot-flags.flag-1.yi>a:before,.weglot-flags.flag-1.yi>span:before{background-position:-3521px 0 !important}.weglot-flags.flag-1.yo>a:before,.weglot-flags.flag-1.yo>span:before{background-position:-5313px 0 !important}.weglot-flags.flag-1.zu>a:before,.weglot-flags.flag-1.zu>span:before{background-position:-6848px 0 !important}.weglot-flags.flag-2.hw>a:before,.weglot-flags.flag-2.hw>span:before{background-position:-5448px 0 !important}.weglot-flags.flag-2.fl>a:before,.weglot-flags.flag-2.fl>span:before{background-position:-1008px 0 !important}.weglot-flags.flag-2.af>a:before,.weglot-flags.flag-2.af>span:before{background-position:-4968px 0 !important}.weglot-flags.flag-2.sq>a:before,.weglot-flags.flag-2.sq>span:before{background-position:-2976px 0 !important}.weglot-flags.flag-2.am>a:before,.weglot-flags.flag-2.am>span:before{background-position:-3816px 0 !important}.weglot-flags.flag-2.ar>a:before,.weglot-flags.flag-2.ar>span:before{background-position:-768px 0 !important}.weglot-flags.flag-2.hy>a:before,.weglot-flags.flag-2.hy>span:before{background-position:0 0 !important}.weglot-flags.flag-2.az>a:before,.weglot-flags.flag-2.az>span:before{background-position:-5136px 0 !important}.weglot-flags.flag-2.ba>a:before,.weglot-flags.flag-2.ba>span:before{background-position:-936px 0 !important}.weglot-flags.flag-2.eu>a:before,.weglot-flags.flag-2.eu>span:before{background-position:-5376px 0 !important}.weglot-flags.flag-2.be>a:before,.weglot-flags.flag-2.be>span:before{background-position:-4224px 0 !important}.weglot-flags.flag-2.bn>a:before,.weglot-flags.flag-2.bn>span:before{background-position:-4056px 0 !important}.weglot-flags.flag-2.bs>a:before,.weglot-flags.flag-2.bs>span:before{background-position:-3984px 0 !important}.weglot-flags.flag-2.bg>a:before,.weglot-flags.flag-2.bg>span:before{background-position:-5040px 0 !important}.weglot-flags.flag-2.br>a:before,.weglot-flags.flag-2.br>span:before{background-position:-2784px 0 !important}.weglot-flags.flag-2.my>a:before,.weglot-flags.flag-2.my>span:before{background-position:-1248px 0 !important}.weglot-flags.flag-2.ca>a:before,.weglot-flags.flag-2.ca>span:before{background-position:-5352px 0 !important}.weglot-flags.flag-2.zh>a:before,.weglot-flags.flag-2.zh>span:before{background-position:-2592px 0 !important}.weglot-flags.flag-2.tw>a:before,.weglot-flags.flag-2.tw>span:before{background-position:-3408px 0 !important}.weglot-flags.flag-2.km>a:before,.weglot-flags.flag-2.km>span:before{background-position:-5160px 0 !important}.weglot-flags.flag-2.ny>a:before,.weglot-flags.flag-2.ny>span:before{background-position:-1392px 0 !important}.weglot-flags.flag-2.co>a:before,.weglot-flags.flag-2.co>span:before{background-position:-2304px 0 !important}.weglot-flags.flag-2.hr>a:before,.weglot-flags.flag-2.hr>span:before{background-position:-4416px 0 !important}.weglot-flags.flag-2.cs>a:before,.weglot-flags.flag-2.cs>span:before{background-position:-2472px 0 !important}.weglot-flags.flag-2.da>a:before,.weglot-flags.flag-2.da>span:before{background-position:-2448px 0 !important}.weglot-flags.flag-2.nl>a:before,.weglot-flags.flag-2.nl>span:before{background-position:-1296px 0 !important}.weglot-flags.flag-2.en>a:before,.weglot-flags.flag-2.en>span:before{background-position:-312px 0 !important}.weglot-flags.flag-2.eo>a:before,.weglot-flags.flag-2.eo>span:before{background-position:-312px 0 !important}.weglot-flags.flag-2.et>a:before,.weglot-flags.flag-2.et>span:before{background-position:-2424px 0 !important}.weglot-flags.flag-2.fj>a:before,.weglot-flags.flag-2.fj>span:before{background-position:-576px 0 !important}.weglot-flags.flag-2.fi>a:before,.weglot-flags.flag-2.fi>span:before{background-position:-2328px 0 !important}.weglot-flags.flag-2.fr>a:before,.weglot-flags.flag-2.fr>span:before{background-position:-2304px 0 !important}.weglot-flags.flag-2.gl>a:before,.weglot-flags.flag-2.gl>span:before{background-position:-5400px 0 !important}.weglot-flags.flag-2.ka>a:before,.weglot-flags.flag-2.ka>span:before{background-position:-3744px 0 !important}.weglot-flags.flag-2.de>a:before,.weglot-flags.flag-2.de>span:before{background-position:-2256px 0 !important}.weglot-flags.flag-2.el>a:before,.weglot-flags.flag-2.el>span:before{background-position:-2208px 0 !important}.weglot-flags.flag-2.gu>a:before,.weglot-flags.flag-2.gu>span:before{background-position:-1728px 0 !important}.weglot-flags.flag-2.ht>a:before,.weglot-flags.flag-2.ht>span:before{background-position:-3528px 0 !important}.weglot-flags.flag-2.ha>a:before,.weglot-flags.flag-2.ha>span:before{background-position:-1176px 0 !important}.weglot-flags.flag-2.he>a:before,.weglot-flags.flag-2.he>span:before{background-position:-1992px 0 !important}.weglot-flags.flag-2.hi>a:before,.weglot-flags.flag-2.hi>span:before{background-position:-1728px 0 !important}.weglot-flags.flag-2.hu>a:before,.weglot-flags.flag-2.hu>span:before{background-position:-2088px 0 !important}.weglot-flags.flag-2.is>a:before,.weglot-flags.flag-2.is>span:before{background-position:-2064px 0 !important}.weglot-flags.flag-2.ig>a:before,.weglot-flags.flag-2.ig>span:before{background-position:-1103px 0 !important}.weglot-flags.flag-2.id>a:before,.weglot-flags.flag-2.id>span:before{background-position:-2040px 0 !important}.weglot-flags.flag-2.ga>a:before,.weglot-flags.flag-2.ga>span:before{background-position:-2016px 0 !important}.weglot-flags.flag-2.it>a:before,.weglot-flags.flag-2.it>span:before{background-position:-1968px 0 !important}.weglot-flags.flag-2.ja>a:before,.weglot-flags.flag-2.ja>span:before{background-position:-1920px 0 !important}.weglot-flags.flag-2.jv>a:before,.weglot-flags.flag-2.jv>span:before{background-position:-1536px 0 !important}.weglot-flags.flag-2.kn>a:before,.weglot-flags.flag-2.kn>span:before{background-position:-1728px 0 !important}.weglot-flags.flag-2.kk>a:before,.weglot-flags.flag-2.kk>span:before{background-position:-1704px 0 !important}.weglot-flags.flag-2.ko>a:before,.weglot-flags.flag-2.ko>span:before{background-position:-1848px 0 !important}.weglot-flags.flag-2.ku>a:before,.weglot-flags.flag-2.ku>span:before{background-position:-2088px 0 !important}.weglot-flags.flag-2.ky>a:before,.weglot-flags.flag-2.ky>span:before{background-position:-1800px 0 !important}.weglot-flags.flag-2.lo>a:before,.weglot-flags.flag-2.lo>span:before{background-position:-1776px 0 !important}.weglot-flags.flag-2.la>a:before,.weglot-flags.flag-2.la>span:before{background-position:-1968px 0 !important}.weglot-flags.flag-2.lv>a:before,.weglot-flags.flag-2.lv>span:before{background-position:-1752px 0 !important}.weglot-flags.flag-2.lt>a:before,.weglot-flags.flag-2.lt>span:before{background-position:-1656px 0 !important}.weglot-flags.flag-2.lb>a:before,.weglot-flags.flag-2.lb>span:before{background-position:-1632px 0 !important}.weglot-flags.flag-2.mk>a:before,.weglot-flags.flag-2.mk>span:before{background-position:-1440px 0 !important}.weglot-flags.flag-2.mg>a:before,.weglot-flags.flag-2.mg>span:before{background-position:-1560px 0 !important}.weglot-flags.flag-2.ms>a:before,.weglot-flags.flag-2.ms>span:before{background-position:-1536px 0 !important}.weglot-flags.flag-2.ml>a:before,.weglot-flags.flag-2.ml>span:before{background-position:-1728px 0 !important}.weglot-flags.flag-2.mt>a:before,.weglot-flags.flag-2.mt>span:before{background-position:-1200px 0 !important}.weglot-flags.flag-2.mi>a:before,.weglot-flags.flag-2.mi>span:before{background-position:-1224px 0 !important}.weglot-flags.flag-2.mr>a:before,.weglot-flags.flag-2.mr>span:before{background-position:-1728px 0 !important}.weglot-flags.flag-2.mn>a:before,.weglot-flags.flag-2.mn>span:before{background-position:-4800px 0 !important}.weglot-flags.flag-2.ne>a:before,.weglot-flags.flag-2.ne>span:before{background-position:-1320px 0 !important}.weglot-flags.flag-2.no>a:before,.weglot-flags.flag-2.no>span:before{background-position:-4776px 0 !important}.weglot-flags.flag-2.ps>a:before,.weglot-flags.flag-2.ps>span:before{background-position:-4008px 0 !important}.weglot-flags.flag-2.fa>a:before,.weglot-flags.flag-2.fa>span:before{background-position:-5088px 0 !important}.weglot-flags.flag-2.pl>a:before,.weglot-flags.flag-2.pl>span:before{background-position:-984px 0 !important}.weglot-flags.flag-2.pt>a:before,.weglot-flags.flag-2.pt>span:before{background-position:-528px 0 !important}.weglot-flags.flag-2.pa>a:before,.weglot-flags.flag-2.pa>span:before{background-position:-1728px 0 !important}.weglot-flags.flag-2.ro>a:before,.weglot-flags.flag-2.ro>span:before{background-position:-960px 0 !important}.weglot-flags.flag-2.ru>a:before,.weglot-flags.flag-2.ru>span:before{background-position:-936px 0 !important}.weglot-flags.flag-2.sm>a:before,.weglot-flags.flag-2.sm>span:before{background-position:-3408px 0 !important}.weglot-flags.flag-2.gd>a:before,.weglot-flags.flag-2.gd>span:before{background-position:-4872px 0 !important}.weglot-flags.flag-2.sr>a:before,.weglot-flags.flag-2.sr>span:before{background-position:-3120px 0 !important}.weglot-flags.flag-2.sn>a:before,.weglot-flags.flag-2.sn>span:before{background-position:-72px 0 !important}.weglot-flags.flag-2.sd>a:before,.weglot-flags.flag-2.sd>span:before{background-position:-1128px 0 !important}.weglot-flags.flag-2.si>a:before,.weglot-flags.flag-2.si>span:before{background-position:-480px 0 !important}.weglot-flags.flag-2.sk>a:before,.weglot-flags.flag-2.sk>span:before{background-position:-4152px 0 !important}.weglot-flags.flag-2.sl>a:before,.weglot-flags.flag-2.sl>span:before{background-position:-696px 0 !important}.weglot-flags.flag-2.so>a:before,.weglot-flags.flag-2.so>span:before{background-position:-3336px 0 !important}.weglot-flags.flag-2.st>a:before,.weglot-flags.flag-2.st>span:before{background-position:-3552px 0 !important}.weglot-flags.flag-2.es>a:before,.weglot-flags.flag-2.es>span:before{background-position:-96px 0 !important}.weglot-flags.flag-2.su>a:before,.weglot-flags.flag-2.su>span:before{background-position:-3312px 0 !important}.weglot-flags.flag-2.sw>a:before,.weglot-flags.flag-2.sw>span:before{background-position:-1872px 0 !important}.weglot-flags.flag-2.sv>a:before,.weglot-flags.flag-2.sv>span:before{background-position:-552px 0 !important}.weglot-flags.flag-2.tl>a:before,.weglot-flags.flag-2.tl>span:before{background-position:-1008px 0 !important}.weglot-flags.flag-2.ty>a:before,.weglot-flags.flag-2.ty>span:before{background-position:-4512px 0 !important}.weglot-flags.flag-2.tg>a:before,.weglot-flags.flag-2.tg>span:before{background-position:-264px 0 !important}.weglot-flags.flag-2.ta>a:before,.weglot-flags.flag-2.ta>span:before{background-position:-1728px 0 !important}.weglot-flags.flag-2.tt>a:before,.weglot-flags.flag-2.tt>span:before{background-position:-936px 0 !important}.weglot-flags.flag-2.te>a:before,.weglot-flags.flag-2.te>span:before{background-position:-1728px 0 !important}.weglot-flags.flag-2.th>a:before,.weglot-flags.flag-2.th>span:before{background-position:-456px 0 !important}.weglot-flags.flag-2.to>a:before,.weglot-flags.flag-2.to>span:before{background-position:-3264px 0 !important}.weglot-flags.flag-2.tr>a:before,.weglot-flags.flag-2.tr>span:before{background-position:-360px 0 !important}.weglot-flags.flag-2.uk>a:before,.weglot-flags.flag-2.uk>span:before{background-position:-288px 0 !important}.weglot-flags.flag-2.ur>a:before,.weglot-flags.flag-2.ur>span:before{background-position:-1128px 0 !important}.weglot-flags.flag-2.uz>a:before,.weglot-flags.flag-2.uz>span:before{background-position:-240px 0 !important}.weglot-flags.flag-2.vi>a:before,.weglot-flags.flag-2.vi>span:before{background-position:-144px 0 !important}.weglot-flags.flag-2.cy>a:before,.weglot-flags.flag-2.cy>span:before{background-position:-4848px 0 !important}.weglot-flags.flag-2.fy>a:before,.weglot-flags.flag-2.fy>span:before{background-position:-1296px 0 !important}.weglot-flags.flag-2.xh>a:before,.weglot-flags.flag-2.xh>span:before{background-position:-4968px 0 !important}.weglot-flags.flag-2.yi>a:before,.weglot-flags.flag-2.yi>span:before{background-position:-1992px 0 !important}.weglot-flags.flag-2.yo>a:before,.weglot-flags.flag-2.yo>span:before{background-position:-1103px 0 !important}.weglot-flags.flag-2.zu>a:before,.weglot-flags.flag-2.zu>span:before{background-position:-4968px 0 !important}.weglot-flags.flag-3.hw>a:before,.weglot-flags.flag-3.hw>span:before{background-position:-2711px 0 !important}.weglot-flags.flag-3.fl>a:before,.weglot-flags.flag-3.fl>span:before{background-position:-5232px 0 !important}.weglot-flags.flag-3.af>a:before,.weglot-flags.flag-3.af>span:before{background-position:-5496px 0 !important}.weglot-flags.flag-3.sq>a:before,.weglot-flags.flag-3.sq>span:before{background-position:-4776px 0 !important}.weglot-flags.flag-3.am>a:before,.weglot-flags.flag-3.am>span:before{background-position:-192px 0 !important}.weglot-flags.flag-3.ar>a:before,.weglot-flags.flag-3.ar>span:before{background-position:-3336px 0 !important}.weglot-flags.flag-3.hy>a:before,.weglot-flags.flag-3.hy>span:before{background-position:-4632px 0 !important}.weglot-flags.flag-3.az>a:before,.weglot-flags.flag-3.az>span:before{background-position:-4536px 0 !important}.weglot-flags.flag-3.ba>a:before,.weglot-flags.flag-3.ba>span:before{background-position:-2664px 0 !important}.weglot-flags.flag-3.eu>a:before,.weglot-flags.flag-3.eu>span:before{background-position:-5808px 0 !important}.weglot-flags.flag-3.be>a:before,.weglot-flags.flag-3.be>span:before{background-position:-144px 0 !important}.weglot-flags.flag-3.bn>a:before,.weglot-flags.flag-3.bn>span:before{background-position:-4488px 0 !important}.weglot-flags.flag-3.bs>a:before,.weglot-flags.flag-3.bs>span:before{background-position:-4392px 0 !important}.weglot-flags.flag-3.bg>a:before,.weglot-flags.flag-3.bg>span:before{background-position:-4296px 0 !important}.weglot-flags.flag-3.br>a:before,.weglot-flags.flag-3.br>span:before{background-position:-4344px 0 !important}.weglot-flags.flag-3.my>a:before,.weglot-flags.flag-3.my>span:before{background-position:-3769px 0 !important}.weglot-flags.flag-3.ca>a:before,.weglot-flags.flag-3.ca>span:before{background-position:-5784px 0 !important}.weglot-flags.flag-3.zh>a:before,.weglot-flags.flag-3.zh>span:before{background-position:-3240px 0 !important}.weglot-flags.flag-3.tw>a:before,.weglot-flags.flag-3.tw>span:before{background-position:-4008px 0 !important}.weglot-flags.flag-3.km>a:before,.weglot-flags.flag-3.km>span:before{background-position:-4201px 0 !important}.weglot-flags.flag-3.ny>a:before,.weglot-flags.flag-3.ny>span:before{background-position:-384px 0 !important}.weglot-flags.flag-3.co>a:before,.weglot-flags.flag-3.co>span:before{background-position:-2760px 0 !important}.weglot-flags.flag-3.hr>a:before,.weglot-flags.flag-3.hr>span:before{background-position:-3048px 0 !important}.weglot-flags.flag-3.cs>a:before,.weglot-flags.flag-3.cs>span:before{background-position:-5280px 0 !important}.weglot-flags.flag-3.da>a:before,.weglot-flags.flag-3.da>span:before{background-position:-3024px 0 !important}.weglot-flags.flag-3.nl>a:before,.weglot-flags.flag-3.nl>span:before{background-position:-3360px 0 !important}.weglot-flags.flag-3.en>a:before,.weglot-flags.flag-3.en>span:before{background-position:-2520px 0 !important}.weglot-flags.flag-3.eo>a:before,.weglot-flags.flag-3.eo>span:before{background-position:-2520px 0 !important}.weglot-flags.flag-3.et>a:before,.weglot-flags.flag-3.et>span:before{background-position:-2856px 0 !important}.weglot-flags.flag-3.fj>a:before,.weglot-flags.flag-3.fj>span:before{background-position:-0px 0 !important}.weglot-flags.flag-3.fi>a:before,.weglot-flags.flag-3.fi>span:before{background-position:-2784px 0 !important}.weglot-flags.flag-3.fr>a:before,.weglot-flags.flag-3.fr>span:before{background-position:-2760px 0 !important}.weglot-flags.flag-3.gl>a:before,.weglot-flags.flag-3.gl>span:before{background-position:-5832px 0 !important}.weglot-flags.flag-3.ka>a:before,.weglot-flags.flag-3.ka>span:before{background-position:-1536px 0 !important}.weglot-flags.flag-3.de>a:before,.weglot-flags.flag-3.de>span:before{background-position:-1488px 0 !important}.weglot-flags.flag-3.el>a:before,.weglot-flags.flag-3.el>span:before{background-position:-1416px 0 !important}.weglot-flags.flag-3.gu>a:before,.weglot-flags.flag-3.gu>span:before{background-position:-2304px 0 !important}.weglot-flags.flag-3.ht>a:before,.weglot-flags.flag-3.ht>span:before{background-position:-5160px 0 !important}.weglot-flags.flag-3.ha>a:before,.weglot-flags.flag-3.ha>span:before{background-position:-361px 0 !important}.weglot-flags.flag-3.he>a:before,.weglot-flags.flag-3.he>span:before{background-position:-1608px 0 !important}.weglot-flags.flag-3.hi>a:before,.weglot-flags.flag-3.hi>span:before{background-position:-2304px 0 !important}.weglot-flags.flag-3.hu>a:before,.weglot-flags.flag-3.hu>span:before{background-position:-1920px 0 !important}.weglot-flags.flag-3.is>a:before,.weglot-flags.flag-3.is>span:before{background-position:-840px 0 !important}.weglot-flags.flag-3.ig>a:before,.weglot-flags.flag-3.ig>span:before{background-position:-3457px 0 !important}.weglot-flags.flag-3.id>a:before,.weglot-flags.flag-3.id>span:before{background-position:-4992px 0 !important}.weglot-flags.flag-3.ga>a:before,.weglot-flags.flag-3.ga>span:before{background-position:-2016px 0 !important}.weglot-flags.flag-3.it>a:before,.weglot-flags.flag-3.it>span:before{background-position:-336px 0 !important}.weglot-flags.flag-3.ja>a:before,.weglot-flags.flag-3.ja>span:before{background-position:-2448px 0 !important}.weglot-flags.flag-3.jv>a:before,.weglot-flags.flag-3.jv>span:before{background-position:-864px 0 !important}.weglot-flags.flag-3.kn>a:before,.weglot-flags.flag-3.kn>span:before{background-position:-2304px 0 !important}.weglot-flags.flag-3.kk>a:before,.weglot-flags.flag-3.kk>span:before{background-position:-3912px 0 !important}.weglot-flags.flag-3.ko>a:before,.weglot-flags.flag-3.ko>span:before{background-position:-2256px 0 !important}.weglot-flags.flag-3.ku>a:before,.weglot-flags.flag-3.ku>span:before{background-position:-1920px 0 !important}.weglot-flags.flag-3.ky>a:before,.weglot-flags.flag-3.ky>span:before{background-position:-744px 0 !important}.weglot-flags.flag-3.lo>a:before,.weglot-flags.flag-3.lo>span:before{background-position:-3816px 0 !important}.weglot-flags.flag-3.la>a:before,.weglot-flags.flag-3.la>span:before{background-position:-336px 0 !important}.weglot-flags.flag-3.lv>a:before,.weglot-flags.flag-3.lv>span:before{background-position:-216px 0 !important}.weglot-flags.flag-3.lt>a:before,.weglot-flags.flag-3.lt>span:before{background-position:-1776px 0 !important}.weglot-flags.flag-3.lb>a:before,.weglot-flags.flag-3.lb>span:before{background-position:-1945px 0 !important}.weglot-flags.flag-3.mk>a:before,.weglot-flags.flag-3.mk>span:before{background-position:-2208px 0 !important}.weglot-flags.flag-3.mg>a:before,.weglot-flags.flag-3.mg>span:before{background-position:-5064px 0 !important}.weglot-flags.flag-3.ms>a:before,.weglot-flags.flag-3.ms>span:before{background-position:-864px 0 !important}.weglot-flags.flag-3.ml>a:before,.weglot-flags.flag-3.ml>span:before{background-position:-2304px 0 !important}.weglot-flags.flag-3.mt>a:before,.weglot-flags.flag-3.mt>span:before{background-position:-4920px 0 !important}.weglot-flags.flag-3.mi>a:before,.weglot-flags.flag-3.mi>span:before{background-position:-2113px 0 !important}.weglot-flags.flag-3.mr>a:before,.weglot-flags.flag-3.mr>span:before{background-position:-2304px 0 !important}.weglot-flags.flag-3.mn>a:before,.weglot-flags.flag-3.mn>span:before{background-position:-24px 0 !important}.weglot-flags.flag-3.ne>a:before,.weglot-flags.flag-3.ne>span:before{background-position:-5642px 0 !important}.weglot-flags.flag-3.no>a:before,.weglot-flags.flag-3.no>span:before{background-position:-984px 0 !important}.weglot-flags.flag-3.ps>a:before,.weglot-flags.flag-3.ps>span:before{background-position:-4753px 0 !important}.weglot-flags.flag-3.fa>a:before,.weglot-flags.flag-3.fa>span:before{background-position:-816px 0 !important}.weglot-flags.flag-3.pl>a:before,.weglot-flags.flag-3.pl>span:before{background-position:-4944px 0 !important}.weglot-flags.flag-3.pt>a:before,.weglot-flags.flag-3.pt>span:before{background-position:-3504px 0 !important}.weglot-flags.flag-3.pa>a:before,.weglot-flags.flag-3.pa>span:before{background-position:-2304px 0 !important}.weglot-flags.flag-3.ro>a:before,.weglot-flags.flag-3.ro>span:before{background-position:-3744px 0 !important}.weglot-flags.flag-3.ru>a:before,.weglot-flags.flag-3.ru>span:before{background-position:-2664px 0 !important}.weglot-flags.flag-3.sm>a:before,.weglot-flags.flag-3.sm>span:before{background-position:-1248px 0 !important}.weglot-flags.flag-3.gd>a:before,.weglot-flags.flag-3.gd>span:before{background-position:-3841px 0 !important}.weglot-flags.flag-3.sr>a:before,.weglot-flags.flag-3.sr>span:before{background-position:-3312px 0 !important}.weglot-flags.flag-3.sn>a:before,.weglot-flags.flag-3.sn>span:before{background-position:-5521px 0 !important}.weglot-flags.flag-3.sd>a:before,.weglot-flags.flag-3.sd>span:before{background-position:-1993px 0 !important}.weglot-flags.flag-3.si>a:before,.weglot-flags.flag-3.si>span:before{background-position:-2833px 0 !important}.weglot-flags.flag-3.sk>a:before,.weglot-flags.flag-3.sk>span:before{background-position:-552px 0 !important}.weglot-flags.flag-3.sl>a:before,.weglot-flags.flag-3.sl>span:before{background-position:-936px 0 !important}.weglot-flags.flag-3.so>a:before,.weglot-flags.flag-3.so>span:before{background-position:-4032px 0 !important}.weglot-flags.flag-3.st>a:before,.weglot-flags.flag-3.st>span:before{background-position:-3961px 0 !important}.weglot-flags.flag-3.es>a:before,.weglot-flags.flag-3.es>span:before{background-position:-3576px 0 !important}.weglot-flags.flag-3.su>a:before,.weglot-flags.flag-3.su>span:before{background-position:-3985px 0 !important}.weglot-flags.flag-3.sw>a:before,.weglot-flags.flag-3.sw>span:before{background-position:-912px 0 !important}.weglot-flags.flag-3.sv>a:before,.weglot-flags.flag-3.sv>span:before{background-position:-264px 0 !important}.weglot-flags.flag-3.tl>a:before,.weglot-flags.flag-3.tl>span:before{background-position:-5232px 0 !important}.weglot-flags.flag-3.ty>a:before,.weglot-flags.flag-3.ty>span:before{background-position:-1512px 0 !important}.weglot-flags.flag-3.tg>a:before,.weglot-flags.flag-3.tg>span:before{background-position:-3720px 0 !important}.weglot-flags.flag-3.ta>a:before,.weglot-flags.flag-3.ta>span:before{background-position:-2304px 0 !important}.weglot-flags.flag-3.tt>a:before,.weglot-flags.flag-3.tt>span:before{background-position:-2664px 0 !important}.weglot-flags.flag-3.te>a:before,.weglot-flags.flag-3.te>span:before{background-position:-2304px 0 !important}.weglot-flags.flag-3.th>a:before,.weglot-flags.flag-3.th>span:before{background-position:-4848px 0 !important}.weglot-flags.flag-3.to>a:before,.weglot-flags.flag-3.to>span:before{background-position:-1680px 0 !important}.weglot-flags.flag-3.tr>a:before,.weglot-flags.flag-3.tr>span:before{background-position:-432px 0 !important}.weglot-flags.flag-3.uk>a:before,.weglot-flags.flag-3.uk>span:before{background-position:-5736px 0 !important}.weglot-flags.flag-3.ur>a:before,.weglot-flags.flag-3.ur>span:before{background-position:-1992px 0 !important}.weglot-flags.flag-3.uz>a:before,.weglot-flags.flag-3.uz>span:before{background-position:-2160px 0 !important}.weglot-flags.flag-3.vi>a:before,.weglot-flags.flag-3.vi>span:before{background-position:-3384px 0 !important}.weglot-flags.flag-3.cy>a:before,.weglot-flags.flag-3.cy>span:before{background-position:-5040px 0 !important}.weglot-flags.flag-3.fy>a:before,.weglot-flags.flag-3.fy>span:before{background-position:-3360px 0 !important}.weglot-flags.flag-3.xh>a:before,.weglot-flags.flag-3.xh>span:before{background-position:-5496px 0 !important}.weglot-flags.flag-3.yi>a:before,.weglot-flags.flag-3.yi>span:before{background-position:-1608px 0 !important}.weglot-flags.flag-3.yo>a:before,.weglot-flags.flag-3.yo>span:before{background-position:-3457px 0 !important}.weglot-flags.flag-3.zu>a:before,.weglot-flags.flag-3.zu>span:before{background-position:-5496px 0 !important}body div[id^="mega-menu-wrap"] #mega-menu-primary li.mega-menu-item.weglot-flags a.mega-menu-link:before{background-image:url("../images/rect_mate.png") !important;background-size:auto 20px !important;border-radius:0px !important;width:30px !important;height:20px !important;content:"";vertical-align:middle;margin-right:10px;display:inline-block;overflow:hidden}body div[id^="mega-menu-wrap"] #mega-menu-primary li.mega-menu-item.weglot-flags.flag-1 .mega-menu-link:before{background-image:url("../images/rect_bright.png") !important}body div[id^="mega-menu-wrap"] #mega-menu-primary li.mega-menu-item.weglot-flags.flag-2 .mega-menu-link:before{background-image:url("../images/square_flag.png") !important;width:24px !important;height:24px !important;background-size:auto 24px !important}body div[id^="mega-menu-wrap"] #mega-menu-primary li.mega-menu-item.weglot-flags.flag-3 .mega-menu-link:before{background-image:url("../images/circular_flag.png") !important;width:24px !important;height:24px !important;background-size:auto 24px !important}#wp-admin-bar-weglot>.ab-item{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIj48ZyBmaWxsPSIjYTBhNWFhIj48cGF0aCBkPSJNMjEuNzM5IDkyLjU2NWw1MS44MjggMTI5LjczMiAyMy42Ni02MC4yNzkgMjQuMTQ0IDYwLjI3OUwxNzMuMiA5Mi41NjVoLTI4LjAwN2wtMjMuODIyIDU4Ljc1LTIzLjkwMi01OC43NS0yMy45MDIgNTguNzUtMjMuOTAyLTU4Ljc1SDIxLjczOXoiLz48cGF0aCBkPSJNMjEwLjAwNiA5Mi43MWMtMTcuODY2IDAtMzMuMTU3IDYuMzU4LTQ1Ljg3MyAxOS4wNzQtMTIuNzE1IDEyLjcxNi0xOC45OTMgMjguMDA2LTE4Ljk5MyA0NS43OTIgMCAxNy44NjcgNi4yNzggMzMuMTU4IDE4Ljk5MyA0NS44NzMgMTIuNzE2IDEyLjcxNiAyOC4wMDcgMTguOTkzIDQ1Ljg3MyAxOC45OTMgMTcuNzg2IDAgMzMuMDc3LTYuMjc3IDQ1Ljc5My0xOC45OTMgMTIuNzE1LTEyLjcxNSAxOS4wNzMtMjguMDA2IDE5LjA3My00NS44NzMgMC00LjUwNy0uNDgzLTguODUyLTEuMjg4LTEyLjk1N2gtNjMuNTc4djI1LjkxNGgzNi42OTljLTIuNzM3IDcuNTY1LTcuNDg1IDEzLjg0My0xNC4wODQgMTguNjcxLTYuNjggNC44My0xNC4yNDUgNy4yNDQtMjIuNjE1IDcuMjQ0LTEwLjc4NCAwLTE5Ljk1OC0zLjc4My0yNy41MjMtMTEuMzQ4LTcuNTY2LTcuNTY1LTExLjM0OC0xNi43NC0xMS4zNDgtMjcuNTI0IDAtMTAuNjIzIDMuNzgyLTE5Ljc5OCAxMS4zNDgtMjcuNDQzIDcuNTY1LTcuNjQ1IDE2Ljc0LTExLjUwOCAyNy41MjMtMTEuNTA4IDEwLjYyMyAwIDE5Ljc5OCAzLjg2MyAyNy41MjQgMTEuNDI4bDE4LjM1LTE4LjM1YTY3Ljk2MyA2Ny45NjMgMCAwMC0yMC43NjQtMTMuODQyYy03Ljg4Ny0zLjM4LTE2LjI1Ny01LjE1LTI1LjExLTUuMTV6Ii8+PC9nPjwvc3ZnPg==") !important;-webkit-background-size:22px auto !important;background-size:22px auto !important;background-repeat:no-repeat !important;background-position:4px 5px !important;padding-left:30px !important}li.weglot-hide,.weglot-hide{display:none !important}.country-selector{z-index:9999;text-align:left;position:relative;display:inline-block;width:auto}.country-selector a{padding:0 10px;outline:none;text-decoration:none;float:none !important;white-space:nowrap;font-weight:normal;cursor:pointer;color:black;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.country-selector a:focus{outline:none}.country-selector ul{padding:0px;z-index:1010;list-style:none;margin:0}.country-selector li{margin:0px;padding:0px}.country-selector.weglot-custom-switcher-ajax{display:none}.country-selector.weglot-dropdown{background-color:white}.country-selector.weglot-dropdown a,.country-selector.weglot-dropdown span{display:block;height:37px;line-height:36px;font-size:13px;padding:0 10px;width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;font-weight:normal}.country-selector.weglot-dropdown a:hover,.country-selector.weglot-dropdown span:hover{cursor:pointer}.country-selector.weglot-dropdown .wgcurrent{border:1px solid #e0e0e0;list-style:none;display:block;margin:0}.country-selector.weglot-dropdown .wgcurrent a,.country-selector.weglot-dropdown .wgcurrent span{padding-right:60px}.country-selector.weglot-dropdown .wgcurrent:after{display:inline-block;position:absolute;top:17px;right:8px;width:13px;height:7px;-ms-interpolation-mode:nearest-neighbor;image-rendering:-webkit-optimize-contrast;image-rendering:-moz-crisp-edges;image-rendering:-o-pixelated;image-rendering:pixelated;background:url("../images/wgarrowdown.png") no-repeat;content:"";-webkit-transition:all 200ms;-o-transition:all 200ms;transition:all 200ms;-webkit-transform:rotate(-90deg);-ms-transform:rotate(-90deg);transform:rotate(-90deg)}.country-selector.weglot-dropdown ul{position:absolute;min-width:100%;border:1px solid #ebeef0;background:white;left:0;top:initial;-webkit-box-sizing:border-box;box-sizing:border-box;display:none;padding:0}.country-selector.weglot-dropdown input:checked ~ ul{display:block}.country-selector.weglot-dropdown input:checked ~ .wgcurrent:after{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg)}.country-selector.weglot-dropdown li{width:100%}.country-selector.weglot-dropdown.weglot-invert ul{bottom:38px}.country-selector.weglot-dropdown.weglot-invert input:checked ~ .wgcurrent:after{-webkit-transform:rotate(-180deg);-ms-transform:rotate(-180deg);transform:rotate(-180deg)}.country-selector.weglot-default{position:fixed;bottom:0px;right:40px}.country-selector.weglot-inline a:hover{text-decoration:underline;color:#00a0d2}.country-selector.weglot-inline .wgcurrent a{text-decoration:underline}.country-selector.weglot-inline label{margin-bottom:0;display:inline-block;vertical-align:middle}.country-selector.weglot-inline ul{display:inline-block;vertical-align:middle}.country-selector.weglot-inline li{line-height:1 !important;display:inline-block;margin:2px 0px;vertical-align:middle}.country-selector.weglot-inline.weglot-default{bottom:5px}.country-selector input{display:none !important}.navbar .navbar-nav li.weglot-flags a.weglot-lang:before{position:static;-webkit-transform:none;-ms-transform:none;transform:none;-webkit-transition:none;-o-transition:none;transition:none}.js .main-navigation .country-selector ul{display:none}html[dir="rtl"] .weglot-flags a:before,html[dir="rtl"] .weglot-flags span:before{margin-right:0;margin-left:10px}.weglot-flags>a:before,.weglot-flags>span.wglanguage-name:before{background-image:url("../images/rect_mate.png");-webkit-background-size:auto 20px !important;background-size:auto 20px !important;border-radius:0px !important;width:30px !important;height:20px !important;content:"";vertical-align:middle;margin-right:10px;display:inline-block;overflow:hidden}.weglot-flags.flag-1>a:before,.weglot-flags.flag-1>span:before{background-image:url("../images/rect_bright.png")}.weglot-flags.flag-2>a:before,.weglot-flags.flag-2>span:before{background-image:url("../images/square_flag.png");width:24px !important;height:24px !important;-webkit-background-size:auto 24px !important;background-size:auto 24px !important}.weglot-flags.flag-3 a:before,.weglot-flags.flag-3 span:before{background-image:url("../images/circular_flag.png");width:24px !important;height:24px !important;-webkit-background-size:auto 24px !important;background-size:auto 24px !important}.weglot-flags>a span:before{background-image:none !important;display:none !important}.weglot-flags>span a:before{background-image:none !important;display:none !important}
dist/front-js.js CHANGED
@@ -1 +1 @@
1
- !function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},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 n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},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=0)}([function(e,t){document.addEventListener("DOMContentLoaded",(function(e){const t=document.querySelector(".country-selector");if(!t)return;const o=function(e){let t=0,o=0;do{t+=e.offsetTop||0,o+=e.offsetLeft||0,e=e.offsetParent}while(e);return{top:t,left:o}}(t).top,n=document.body,r=document.documentElement,u=Math.max(n.scrollHeight,n.offsetHeight,r.clientHeight,r.scrollHeight,r.offsetHeight),i=window.getComputedStyle(t).getPropertyValue("position");window.getComputedStyle(t).getPropertyValue("bottom"),window.getComputedStyle(t).getPropertyValue("top");return("fixed"!==i&&o>u/2||"fixed"===i&&o>100)&&(t.className+=" weglot-invert"),!1}))}]);
1
+ !function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},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 n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},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=0)}([function(e,t){function o(){const e=document.querySelectorAll(".weglot-custom-switcher-ajax");Array.prototype.forEach.call(e,(function(e,t){let o=document.querySelector(e.getAttribute("data-wg-target")),n=document.querySelector(e.getAttribute("data-wg-sibling"));o&&n?(o.insertBefore(e,n),e.classList.remove("weglot-custom-switcher-ajax")):o?(o.insertBefore(e,o.firstChild),e.classList.remove("weglot-custom-switcher-ajax")):n&&(n.parentNode.insertBefore(e,n),e.classList.remove("weglot-custom-switcher-ajax"))}))}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>o()):o(),document.addEventListener("DOMContentLoaded",(function(e){const t=document.querySelector(".country-selector");if(!t)return;const o=function(e){let t=0,o=0;do{t+=e.offsetTop||0,o+=e.offsetLeft||0,e=e.offsetParent}while(e);return{top:t,left:o}}(t).top,n=document.body,r=document.documentElement,l=Math.max(n.scrollHeight,n.offsetHeight,r.clientHeight,r.scrollHeight,r.offsetHeight),c=window.getComputedStyle(t).getPropertyValue("position");window.getComputedStyle(t).getPropertyValue("bottom"),window.getComputedStyle(t).getPropertyValue("top");if(("fixed"!==c&&o>l/2||"fixed"===c&&o>100)&&(t.className+=" weglot-invert"),function(){try{return window.frameElement||window.self!==window.top}catch(e){return!1}}()){const e=document.querySelectorAll(".weglot-dropdown");null!==e&&[].forEach.call(e,(function(e){e.style.display="none"}))}const s=document.getElementsByClassName("country-selector"),i=e=>!e.className.includes("closed");let u;if(s.length>0){const e=document.getElementsByClassName("wgcurrent");for(let t of s){const o={ENTER:13,ESCAPE:27,ARROWUP:38,ARROWDOWN:40},n=()=>{const{bottom:e=0}=t.getBoundingClientRect();return e>window.innerHeight/2},r=()=>{t.classList.remove("closed"),document.querySelectorAll(".country-selector.weglot-dropdown input").checked=!0,t.setAttribute("aria-expanded","true")},l=()=>{t.classList.add("closed"),document.querySelectorAll(".country-selector.weglot-dropdown input").checked=!1,t.setAttribute("aria-expanded","false"),u&&(u.classList.remove("focus"),u=null)},c=e=>{getLangNameFromCode(e);t.setAttribute("aria-activedescendant","weglot-language-"+e),t.setAttribute("aria-label","Language selected: "+e)},s=()=>{t.classList.contains("closed")?r():l(),u&&u.classList.remove("focus"),u=null};t.addEventListener("keydown",n=>{if(n.keyCode!==o.ENTER){if(n.keyCode===o.ARROWDOWN||n.keyCode===o.ARROWUP)return n.preventDefault(),void a(n.keyCode);n.keyCode===o.ESCAPE&&i(t)&&(n.preventDefault(),l(),t.focus())}else{for(var r=0;r<e.length;r++)e[r].click();if(u){const e=u.getAttribute("data-l");c(e),t.focus()}s()}}),t.addEventListener("click",e=>{if(u){const e=u.getAttribute("data-l");c(e),t.focus()}s()});const a=c=>{const s=c===o.ARROWDOWN?"nextSibling":"previousSibling",a=n();if(u&&i(t))u[s]?(u.classList.remove("focus"),u=u[s],u.classList.add("focus"),u.childNodes[0].focus(),u.scrollIntoView({block:"center"})):(c===o.ARROWUP&&!a||c===o.ARROWDOWN&&a)&&(l(),t.focus());else{const n=a?"ul li.wg-li:last-child":"ul li.wg-li";for(var d=0;d<e.length;d++)u=e[d].parentNode.querySelector(n);if(!u)return;u.classList.add("focus"),u.childNodes[0].focus(),u.scrollIntoView({block:"center"});const l=c===o.ARROWUP&&a||c===o.ARROWDOWN&&!a;!i(t)&&l&&r()}}}}return!1}))}]);
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Contributors: remyb92, gmulti, wysija, wpr0ck, glx77
3
  Tags: translate, multilingual, language, translation, localization, multilingual SEO, languages, translator, website translation, multilanguage, international, traduction
4
  Requires at least: 4.5
5
- Tested up to: 5.9
6
  Requires PHP: 5.6
7
- Stable tag: 3.6.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -210,11 +210,16 @@ See changelog for upgrade changes.
210
 
211
  == Changelog ==
212
 
213
- = 3.6.1 (02/03/2022) =
214
-
215
- * Bugfix: Fix hide button option on switcher menu
216
- * Bugfix: Fix bug VE not translated
217
- * Bugfix: Fix bug add Custom full name for orginal language
 
 
 
 
 
218
 
219
  = Older versions =
220
 
2
  Contributors: remyb92, gmulti, wysija, wpr0ck, glx77
3
  Tags: translate, multilingual, language, translation, localization, multilingual SEO, languages, translator, website translation, multilanguage, international, traduction
4
  Requires at least: 4.5
5
+ Tested up to: 6.0
6
  Requires PHP: 5.6
7
+ Stable tag: 3.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
210
 
211
  == Changelog ==
212
 
213
+ = 3.7 (08/06/2022) =
214
+ * Add: Translate pdf service
215
+ * Add: Optimize button accessibility
216
+ * Add: Pageviews integration
217
+ * Add: Add switcher editor integration
218
+ * Add: Woocomerce translate all mail
219
+ * Add: Do not translate .eps or .txt
220
+ * Add: Detect if switcher is child of an iframe and if so, don't display it
221
+ * Add: Reduce api call on wp-admin
222
+ * Bugfix: Some bug fix
223
 
224
  = Older versions =
225
 
src/actions/front/class-front-enqueue-weglot.php CHANGED
@@ -29,26 +29,47 @@ class Front_Enqueue_Weglot implements Hooks_Interface_Weglot {
29
  }
30
 
31
  /**
 
 
32
  * @see Hooks_Interface_Weglot
33
  *
34
- * @since 2.0
35
- * @return void
36
  */
37
  public function hooks() {
38
  add_action( 'wp_enqueue_scripts', array( $this, 'weglot_wp_enqueue_scripts' ) );
39
  add_action( 'login_enqueue_scripts', array( $this, 'weglot_wp_enqueue_scripts' ) );
 
40
  }
41
 
42
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
 
44
  /**
45
- * @see wp_enqueue_scripts
46
  * @since 2.0
47
  *
48
- * @return void
49
  */
50
  public function weglot_wp_enqueue_scripts() {
51
-
52
  // Add JS
53
  wp_register_script( 'wp-weglot-js', WEGLOT_URL_DIST . '/front-js.js', false, WEGLOT_VERSION, false );
54
  wp_enqueue_script( 'wp-weglot-js' );
@@ -59,9 +80,9 @@ class Front_Enqueue_Weglot implements Hooks_Interface_Weglot {
59
 
60
  //display new flags
61
  if ( empty( $this->option_services->get_option( 'flag_css' ) )
62
- && strpos( $this->option_services->get_css_custom_inline(), 'background-position' ) == false
63
- && strpos( $this->option_services->get_css_custom_inline(), 'background-image' ) == false ) {
64
- Helper_Flag_Type::get_new_flags();
65
  }
66
 
67
  wp_add_inline_style( 'weglot-css', $this->option_services->get_flag_css() );
29
  }
30
 
31
  /**
32
+ * @return void
33
+ * @since 2.0
34
  * @see Hooks_Interface_Weglot
35
  *
 
 
36
  */
37
  public function hooks() {
38
  add_action( 'wp_enqueue_scripts', array( $this, 'weglot_wp_enqueue_scripts' ) );
39
  add_action( 'login_enqueue_scripts', array( $this, 'weglot_wp_enqueue_scripts' ) );
40
+ add_action( 'wp_footer', array( $this, 'weglot_pageviews_script' ) );
41
  }
42
 
43
+ /**
44
+ *
45
+ * @return string
46
+ * @since 2.0
47
+ */
48
+ public function weglot_pageviews_script() {
49
+ $options = $this->option_services->get_options();
50
+ if ( $options['page_views_enabled'] ) {
51
+ ?>
52
+ <script>
53
+ var request = new XMLHttpRequest();
54
+ var data = JSON.stringify({
55
+ url: location.protocol + '//' + location.host + location.pathname,
56
+ language: document.getElementsByTagName('html')[0].getAttribute('lang'),
57
+ browser_language: (navigator.language || navigator.userLanguage)
58
+ }
59
+ )
60
+ request.open('POST', "https://cdn-api.weglot.com/pageviews?api_key=<?php echo esc_js( $options['api_key'] )?>", true);
61
+ request.send(data);
62
+ </script>
63
+ <?php }
64
+ }
65
 
66
  /**
67
+ * @return void
68
  * @since 2.0
69
  *
70
+ * @see wp_enqueue_scripts
71
  */
72
  public function weglot_wp_enqueue_scripts() {
 
73
  // Add JS
74
  wp_register_script( 'wp-weglot-js', WEGLOT_URL_DIST . '/front-js.js', false, WEGLOT_VERSION, false );
75
  wp_enqueue_script( 'wp-weglot-js' );
80
 
81
  //display new flags
82
  if ( empty( $this->option_services->get_option( 'flag_css' ) )
83
+ && strpos( $this->option_services->get_css_custom_inline(), 'background-position' ) == false
84
+ && strpos( $this->option_services->get_css_custom_inline(), 'background-image' ) == false ) {
85
+ Helper_Flag_Type::get_new_flags();
86
  }
87
 
88
  wp_add_inline_style( 'weglot-css', $this->option_services->get_flag_css() );
src/actions/front/class-search-weglot.php CHANGED
@@ -83,7 +83,7 @@ class Search_Weglot implements Hooks_Interface_Weglot {
83
  }
84
 
85
  $original_language = $this->language_services->get_original_language()->getInternalCode();
86
- $current_language = $this->request_url_services->get_current_language()->getInternalCode();
87
 
88
  if ( $original_language === $current_language ) {
89
  return;
83
  }
84
 
85
  $original_language = $this->language_services->get_original_language()->getInternalCode();
86
+ $current_language = $this->request_url_services->get_current_language()->getEnglishName();
87
 
88
  if ( $original_language === $current_language ) {
89
  return;
src/actions/front/class-translate-page-weglot.php CHANGED
@@ -119,6 +119,7 @@ class Translate_Page_Weglot implements Hooks_Interface_Weglot {
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
 
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
+ 'el_check_user_login', // Event list plugin.
123
  )
124
  );
125
 
src/models/class-schema-option-v3.php CHANGED
@@ -17,14 +17,14 @@ class Schema_Option_V3 {
17
  */
18
  public static function get_schema_options_v3_compatible() {
19
  $schema = array(
20
- 'api_key' => 'api_key',
21
- 'api_key_private' => 'api_key_private',
22
- 'allowed' => 'allowed',
23
- 'original_language' => 'language_from',
24
- 'language_from_custom_flag' => 'language_from_custom_flag',
25
- 'language_from_custom_name' => 'language_from_custom_name',
26
- 'translation_engine' => 'translation_engine',
27
- 'destination_language' => (object) array(
28
  'path' => 'languages',
29
  'fn' => function( $languages ) {
30
  $destinations = array();
@@ -33,17 +33,18 @@ class Schema_Option_V3 {
33
  }
34
  foreach ( $languages as $item ) {
35
  $destinations[] = array(
36
- 'language_to' => $item['language_to'],
37
- 'custom_code' => $item['custom_code'],
38
- 'custom_name' => $item['custom_name'],
39
- 'public' => $item['enabled'],
 
40
  );
41
  }
42
 
43
  return $destinations;
44
  },
45
  ),
46
- 'private_mode' => (object) array(
47
  'path' => 'languages',
48
  'fn' => function( $languages ) {
49
  $private = array();
@@ -58,10 +59,10 @@ class Schema_Option_V3 {
58
  return $private;
59
  },
60
  ),
61
- 'auto_redirect' => 'auto_switch',
62
- 'autoswitch_fallback' => 'auto_switch_fallback',
63
- 'exclude_urls' => 'excluded_paths',
64
- 'exclude_blocks' => (object) array(
65
  'path' => 'excluded_blocks',
66
  'fn' => function( $excluded_blocks ) {
67
  $excluded = array();
@@ -74,12 +75,12 @@ class Schema_Option_V3 {
74
  return $excluded;
75
  },
76
  ),
77
- 'custom_settings' => 'custom_settings',
78
- 'is_dropdown' => 'custom_settings.button_style.is_dropdown',
79
- 'is_fullname' => 'custom_settings.button_style.full_name',
80
- 'with_name' => 'custom_settings.button_style.with_name',
81
- 'with_flags' => 'custom_settings.button_style.with_flags',
82
- 'type_flags' => (object) array(
83
  'path' => 'custom_settings.button_style.flag_type',
84
  'fn' => function( $flag_type ) {
85
  if ( $flag_type ) {
@@ -89,13 +90,13 @@ class Schema_Option_V3 {
89
  return Helper_Flag_Type::RECTANGLE_MAT;
90
  },
91
  ),
92
- 'override_css' => 'custom_settings.button_style.custom_css',
93
- 'email_translate' => 'custom_settings.translate_email',
94
- 'active_search' => 'custom_settings.translate_search',
95
- 'translate_amp' => 'custom_settings.translate_amp',
96
- 'has_first_settings' => 'has_first_settings',
97
- 'show_box_first_settings' => 'show_box_first_settings',
98
- 'custom_urls' => (object) array(
99
  'path' => 'custom_urls',
100
  'fn' => function( $custom_urls ) {
101
  if ( $custom_urls ) {
@@ -105,12 +106,13 @@ class Schema_Option_V3 {
105
  return array();
106
  },
107
  ),
108
- 'flag_css' => 'flag_css',
109
- 'menu_switcher' => 'menu_switcher',
110
- 'active_wc_reload' => 'active_wc_reload',
111
- 'versions' => 'versions',
112
- 'slugTranslation' => 'versions.slugTranslation',
113
- 'translation' => 'versions.translation',
 
114
  );
115
 
116
  return $schema;
17
  */
18
  public static function get_schema_options_v3_compatible() {
19
  $schema = array(
20
+ 'api_key' => 'api_key',
21
+ 'api_key_private' => 'api_key_private',
22
+ 'allowed' => 'allowed',
23
+ 'original_language' => 'language_from',
24
+ 'language_from_custom_flag' => 'language_from_custom_flag',
25
+ 'language_from_custom_name' => 'language_from_custom_name',
26
+ 'translation_engine' => 'translation_engine',
27
+ 'destination_language' => (object) array(
28
  'path' => 'languages',
29
  'fn' => function( $languages ) {
30
  $destinations = array();
33
  }
34
  foreach ( $languages as $item ) {
35
  $destinations[] = array(
36
+ 'language_to' => $item['language_to'],
37
+ 'custom_code' => $item['custom_code'],
38
+ 'custom_name' => $item['custom_name'],
39
+ 'custom_local_name' => $item['custom_local_name'],
40
+ 'public' => $item['enabled'],
41
  );
42
  }
43
 
44
  return $destinations;
45
  },
46
  ),
47
+ 'private_mode' => (object) array(
48
  'path' => 'languages',
49
  'fn' => function( $languages ) {
50
  $private = array();
59
  return $private;
60
  },
61
  ),
62
+ 'auto_redirect' => 'auto_switch',
63
+ 'autoswitch_fallback' => 'auto_switch_fallback',
64
+ 'exclude_urls' => 'excluded_paths',
65
+ 'exclude_blocks' => (object) array(
66
  'path' => 'excluded_blocks',
67
  'fn' => function( $excluded_blocks ) {
68
  $excluded = array();
75
  return $excluded;
76
  },
77
  ),
78
+ 'custom_settings' => 'custom_settings',
79
+ 'is_dropdown' => 'custom_settings.button_style.is_dropdown',
80
+ 'is_fullname' => 'custom_settings.button_style.full_name',
81
+ 'with_name' => 'custom_settings.button_style.with_name',
82
+ 'with_flags' => 'custom_settings.button_style.with_flags',
83
+ 'type_flags' => (object) array(
84
  'path' => 'custom_settings.button_style.flag_type',
85
  'fn' => function( $flag_type ) {
86
  if ( $flag_type ) {
90
  return Helper_Flag_Type::RECTANGLE_MAT;
91
  },
92
  ),
93
+ 'override_css' => 'custom_settings.button_style.custom_css',
94
+ 'email_translate' => 'custom_settings.translate_email',
95
+ 'active_search' => 'custom_settings.translate_search',
96
+ 'translate_amp' => 'custom_settings.translate_amp',
97
+ 'has_first_settings' => 'has_first_settings',
98
+ 'show_box_first_settings' => 'show_box_first_settings',
99
+ 'custom_urls' => (object) array(
100
  'path' => 'custom_urls',
101
  'fn' => function( $custom_urls ) {
102
  if ( $custom_urls ) {
106
  return array();
107
  },
108
  ),
109
+ 'page_views_enabled' => 'page_views_enabled',
110
+ 'flag_css' => 'flag_css',
111
+ 'menu_switcher' => 'menu_switcher',
112
+ 'active_wc_reload' => 'active_wc_reload',
113
+ 'versions' => 'versions',
114
+ 'slugTranslation' => 'versions.slugTranslation',
115
+ 'translation' => 'versions.translation',
116
  );
117
 
118
  return $schema;
src/services/class-button-service-weglot.php CHANGED
@@ -125,13 +125,15 @@ class Button_Service_Weglot {
125
  * Get html button switcher
126
  *
127
  * @param string $add_class
 
 
128
  * @param array $switcher
129
  *
130
  * @return string
131
  * @version 2.3.1
132
  * @since 2.0
133
  */
134
- public function get_html( $add_class = '', $switcher = [] ) {
135
 
136
  $weglot_url = $this->request_url_services->get_weglot_url();
137
  $amp_regex = $this->amp_services->get_regex( true );
@@ -158,24 +160,29 @@ class Button_Service_Weglot {
158
  $class_aside = $this->get_class_dropdown( $switcher );
159
 
160
  $button_html = sprintf( '<!--Weglot %s-->', WEGLOT_VERSION );
161
- $button_html .= sprintf( '<aside data-wg-notranslate="" class="country-selector %s">', $class_aside . $add_class );
 
 
 
 
 
162
 
163
  $name = $this->get_name_with_language_entry( $current_language, $switcher );
164
 
165
  $display_first = false;
166
  if ( $this->request_url_services->is_eligible_url( $this->request_url_services->get_full_url() ) || $language_button_displayed ) {
167
  $uniq_id = 'wg' . uniqid( strtotime( 'now' ) ) . wp_rand( 1, 1000 );
168
- $button_html .= sprintf( '<input id="%s" class="weglot_choice" type="checkbox" name="menu"/><label for="%s" class="wgcurrent wg-li weglot-lang weglot-language %s" data-code-language="%s" data-name-language="%s"><span class="wglanguage-name">%s</span></label>', esc_attr( $uniq_id ), esc_attr( $uniq_id ), esc_attr( $flag_class . $current_language->getInternalCode() ), esc_attr( $current_language->getInternalCode() ), esc_html( $name ), esc_html( $name ) );
169
  $display_first = true;
170
  }
171
 
172
  if ( ! $display_first && ! $hide_all_language ) {
173
  $uniq_id = 'wg' . uniqid( strtotime( 'now' ) ) . wp_rand( 1, 1000 );
174
- $button_html .= sprintf( '<input id="%s" class="weglot_choice" type="checkbox" name="menu"/><label for="%s" class="wgcurrent wg-li weglot-lang weglot-language %s" data-code-language="%s" data-name-language="%s"><span class="wglanguage-name">%s</span></label>', esc_attr( $uniq_id ), esc_attr( $uniq_id ), esc_attr( $flag_class . $current_language->getInternalCode() ), esc_attr( $current_language->getInternalCode() ), esc_html( $name ), esc_html( $name ) );
175
  $display_first = true;
176
  }
177
 
178
- $button_html .= '<ul>';
179
 
180
  foreach ( $this->language_services->get_original_and_destination_languages( $this->request_url_services->is_allowed_private() ) as $language ) {
181
  // check if for this button we ant to exclude the button from switcher.
@@ -183,7 +190,7 @@ class Button_Service_Weglot {
183
  $link_button = $this->request_url_services->get_weglot_url()->getForLanguage( $language, true );
184
 
185
  if ( $language->getInternalCode() === $current_language->getInternalCode()
186
- || ! $display_original_language && ! $display_first ) {
187
  continue;
188
  }
189
 
@@ -196,7 +203,7 @@ class Button_Service_Weglot {
196
  }
197
 
198
  if ( $link_button ) {
199
- $button_html .= sprintf( '<li class="wg-li weglot-lang weglot-language %s" data-code-language="%s">', $flag_class . $language->getInternalCode(), $language->getInternalCode() );
200
  $name = $this->get_name_with_language_entry( $language, $switcher );
201
 
202
  if ( $this->option_services->get_option( 'auto_redirect' ) ) {
@@ -209,7 +216,7 @@ class Button_Service_Weglot {
209
  }
210
 
211
  $button_html .= sprintf(
212
- '<a data-wg-notranslate="" href="%s">%s</a>',
213
  esc_url( $link_button ),
214
  esc_html( $name )
215
  );
125
  * Get html button switcher
126
  *
127
  * @param string $add_class
128
+ * @param string $add_attr_target
129
+ * @param string $add_attr_sibling
130
  * @param array $switcher
131
  *
132
  * @return string
133
  * @version 2.3.1
134
  * @since 2.0
135
  */
136
+ public function get_html( $add_class = '', $switcher = [], $add_attr_target = '', $add_attr_sibling = '' ) {
137
 
138
  $weglot_url = $this->request_url_services->get_weglot_url();
139
  $amp_regex = $this->amp_services->get_regex( true );
160
  $class_aside = $this->get_class_dropdown( $switcher );
161
 
162
  $button_html = sprintf( '<!--Weglot %s-->', WEGLOT_VERSION );
163
+
164
+ if ( !empty ( $add_attr_target ) ) {
165
+ $button_html .= sprintf( '<aside data-wg-notranslate="" class="country-selector %s" tabindex="0" aria-expanded="false" role="listbox" aria-activedescendant="weglot-language-'.$current_language->getExternalCode().'" aria-label="Language selected: '.$current_language->getEnglishName().'" data-wg-target="%s" data-wg-sibling="%s">', $class_aside . $add_class, $add_attr_target, $add_attr_sibling );
166
+ } else {
167
+ $button_html .= sprintf( '<aside data-wg-notranslate="" class="country-selector %s" tabindex="0" aria-expanded="false" role="listbox" aria-activedescendant="weglot-language-'.$current_language->getExternalCode().'" aria-label="Language selected: '.$current_language->getEnglishName().'">', $class_aside . $add_class );
168
+ }
169
 
170
  $name = $this->get_name_with_language_entry( $current_language, $switcher );
171
 
172
  $display_first = false;
173
  if ( $this->request_url_services->is_eligible_url( $this->request_url_services->get_full_url() ) || $language_button_displayed ) {
174
  $uniq_id = 'wg' . uniqid( strtotime( 'now' ) ) . wp_rand( 1, 1000 );
175
+ $button_html .= sprintf( '<input id="%s" class="weglot_choice" type="checkbox" name="menu"/><label data-l="'.$current_language->getExternalCode().'" tabindex="-1" id="weglot-language-'.$current_language->getExternalCode().'" role="none" for="%s" class="wgcurrent wg-li weglot-lang weglot-language %s" data-code-language="%s" data-name-language="%s"><span class="wglanguage-name">%s</span></label>', esc_attr( $uniq_id ), esc_attr( $uniq_id ), esc_attr( $flag_class . $current_language->getInternalCode() ), esc_attr( $current_language->getInternalCode() ), esc_html( $name ), esc_html( $name ) );
176
  $display_first = true;
177
  }
178
 
179
  if ( ! $display_first && ! $hide_all_language ) {
180
  $uniq_id = 'wg' . uniqid( strtotime( 'now' ) ) . wp_rand( 1, 1000 );
181
+ $button_html .= sprintf( '<input id="%s" class="weglot_choice" type="checkbox" name="menu"/><label tabindex="-1" role="none" id="weglot-language-'.$current_language->getExternalCode().'" for="%s" class="wgcurrent wg-li weglot-lang weglot-language %s" data-code-language="%s" data-name-language="%s"><span class="wglanguage-name">%s</span></label>', esc_attr( $uniq_id ), esc_attr( $uniq_id ), esc_attr( $flag_class . $current_language->getInternalCode() ), esc_attr( $current_language->getInternalCode() ), esc_html( $name ), esc_html( $name ) );
182
  $display_first = true;
183
  }
184
 
185
+ $button_html .= '<ul role="none">';
186
 
187
  foreach ( $this->language_services->get_original_and_destination_languages( $this->request_url_services->is_allowed_private() ) as $language ) {
188
  // check if for this button we ant to exclude the button from switcher.
190
  $link_button = $this->request_url_services->get_weglot_url()->getForLanguage( $language, true );
191
 
192
  if ( $language->getInternalCode() === $current_language->getInternalCode()
193
+ || ! $display_original_language && ! $display_first ) {
194
  continue;
195
  }
196
 
203
  }
204
 
205
  if ( $link_button ) {
206
+ $button_html .= sprintf( '<li data-l="'.$language->getExternalCode().'" class="wg-li weglot-lang weglot-language %s" data-code-language="%s" role="none">', $flag_class . $language->getInternalCode(), $language->getInternalCode() );
207
  $name = $this->get_name_with_language_entry( $language, $switcher );
208
 
209
  if ( $this->option_services->get_option( 'auto_redirect' ) ) {
216
  }
217
 
218
  $button_html .= sprintf(
219
+ '<a title="Language switcher : '.$language->getEnglishName().'" id="weglot-language-'.$language->getExternalCode().'" role="option" data-wg-notranslate="" href="%s">%s</a>',
220
  esc_url( $link_button ),
221
  esc_html( $name )
222
  );
src/services/class-generate-switcher-service-weglot.php CHANGED
@@ -128,7 +128,17 @@ class Generate_Switcher_Service_Weglot {
128
  if ( strpos( $dom, '<div data-wg-position="' . $key . '"></div>' ) !== false ) {
129
  $dom = str_replace( '<div data-wg-position="' . $key . '"></div>', $button_html, $dom );
130
  $find_location = true;
 
 
 
 
 
 
131
  }
 
 
 
 
132
  }
133
  }
134
  if ( ! $find_location ) {
128
  if ( strpos( $dom, '<div data-wg-position="' . $key . '"></div>' ) !== false ) {
129
  $dom = str_replace( '<div data-wg-position="' . $key . '"></div>', $button_html, $dom );
130
  $find_location = true;
131
+ }elseif(strpos( $dom, '<div data-wg-position="' . $key . '" data-wg-ajax="true"></div>' ) !== false ){
132
+ $attr_target = ! empty( $location['target'] ) ? $location['target'] : '' ;
133
+ $attr_sibling = ! empty( $location['sibling'] ) ? $location['sibling'] : '' ;
134
+ $button_ajax_html = $this->button_services->get_html( 'weglot-custom-switcher-ajax', $switcher, $attr_target, $attr_sibling );
135
+ $dom = str_replace( '<div data-wg-position="' . $key . '" data-wg-ajax="true"></div>', $button_ajax_html, $dom );
136
+ $find_location = true;
137
  }
138
+ }else{
139
+ $button_html = $this->button_services->get_html( 'weglot-custom-switcher weglot-default', $switcher );
140
+ $dom = str_replace( '</body>', $button_html, $dom );
141
+ $find_location = true;
142
  }
143
  }
144
  if ( ! $find_location ) {
src/services/class-language-service-weglot.php CHANGED
@@ -31,10 +31,11 @@ class Language_Service_Weglot {
31
  }
32
 
33
  /**
34
- * @since 2.0.6
35
  * @param array $a
36
  * @param array $b
 
37
  * @return bool
 
38
  */
39
  protected function compare_language( $a, $b ) {
40
  return strcmp( $a['english'], $b['english'] );
@@ -42,10 +43,12 @@ class Language_Service_Weglot {
42
 
43
  /**
44
  * Get defaults languages available from API
45
- * @since 2.0
46
- * @version 2.0.6
47
  * @param array $params
 
48
  * @return LanguageCollection
 
 
49
  */
50
  public function get_languages_available( $params = array() ) {
51
  if ( null !== $this->languages ) {
@@ -54,11 +57,11 @@ class Language_Service_Weglot {
54
 
55
  $client = weglot_get_service( 'Parser_Service_Weglot' )->get_client();
56
 
57
- $languages = new LanguagesList( $client );
58
 
59
  $this->languages = $languages->handle();
60
 
61
- //We add the weglot_language_code_replace filter for custom code
62
  $this->languages = $this->languages->jsonSerialize();
63
 
64
  if ( isset( $params['sort'] ) && $params['sort'] ) {
@@ -73,26 +76,31 @@ class Language_Service_Weglot {
73
  $language_collection->addOne( $entry );
74
  }
75
  $this->languages = $language_collection;
 
76
  return $this->languages;
77
  }
78
 
79
  /**
80
  * Adds a language to the language collection
 
81
  * @param $internal_code
82
  * @param $external_code
83
  * @param $english_name
84
  * @param $local_name
85
- * @param bool $is_rtl
 
86
  * @return array
87
  */
88
  public function add_language( $internal_code, $external_code, $english_name, $local_name, $is_rtl = false ) {
89
  $entry = new LanguageEntry( $internal_code, $external_code, $english_name, $local_name, $is_rtl );
90
  $this->languages->addOne( $entry );
 
91
  return $this->languages;
92
  }
93
 
94
  /**
95
  * Get all languages : list of 109 default languages merged with custom languages taken from options
 
96
  * @return array|LanguageCollection|null
97
  */
98
  public function get_all_languages() {
@@ -100,28 +108,36 @@ class Language_Service_Weglot {
100
  return $this->languages;
101
  }
102
 
103
- $this->languages = $this->get_languages_available( [ 'sort' => true ] );
104
  $destination_languages = $this->option_services->get_destination_languages();
105
- $original_language = $this->get_original_language();
106
 
107
  if ( ! empty( $this->get_original_language_name_custom() ) ) {
108
  $this->languages = $this->add_language( $original_language->getInternalCode(), $original_language->getExternalCode(), $this->get_original_language_name_custom(), $this->get_original_language_name_custom() );
109
  }
110
 
111
  foreach ( $destination_languages as $d ) {
112
- if ( $d['custom_name'] ) {
113
- $this->languages = $this->add_language( $d['language_to'], $d['custom_code'], $d['custom_name'], $d['custom_name'] );
 
 
 
 
 
 
 
114
  }
115
  }
116
-
117
  return $this->languages;
118
  }
119
 
120
  /**
121
  * Get language entry from the internal code
122
- * @since 3.2.1
123
  * @param string $internal_code
 
124
  * @return LanguageEntry
 
125
  */
126
  public function get_language_from_internal( $internal_code ) {
127
  return $this->get_all_languages()[ $internal_code ];
@@ -129,9 +145,11 @@ class Language_Service_Weglot {
129
 
130
  /**
131
  * Get language entry from the external code
132
- * @since 3.2.1
133
  * @param string $external_code
 
134
  * @return LanguageEntry
 
135
  */
136
  public function get_language_from_external( $external_code ) {
137
  foreach ( $this->get_all_languages() as $language ) {
@@ -139,17 +157,20 @@ class Language_Service_Weglot {
139
  return $language;
140
  }
141
  }
 
142
  return null;
143
  }
144
 
145
  /**
146
  * Get destination languages as language entries
 
147
  * @param bool $allowed_private
 
148
  * @return LanguageEntry[]
149
  */
150
  public function get_destination_languages( $allowed_private = false ) {
151
  $destination_languages_as_array = $this->option_services->get_destination_languages();
152
- $destination_languages = [];
153
  foreach ( $destination_languages_as_array as $destination_language_as_array ) {
154
  if ( $destination_language_as_array['public'] || $allowed_private ) {
155
  if ( $this->get_all_languages()[ $destination_language_as_array['language_to'] ] ) {
@@ -157,33 +178,40 @@ class Language_Service_Weglot {
157
  }
158
  }
159
  }
 
160
  return $destination_languages;
161
  }
162
 
163
  /**
164
  * Get destination languages as language entries
 
165
  * @param bool $allowed_private
 
166
  * @return string[]
167
  */
168
  public function get_destination_languages_external( $allowed_private = false ) {
169
  return array_map(
170
- function( $l ) {
171
  return $l->getExternalCode();
172
- }, $this->get_destination_languages( $allowed_private )
 
173
  );
174
  }
175
 
176
  /**
177
  * Get original language as language entry
 
178
  * @return LanguageEntry
179
  */
180
  public function get_original_language() {
181
  $original_language_code = $this->option_services->get_option( 'original_language' );
 
182
  return $this->get_language_from_internal( $original_language_code );
183
  }
184
 
185
  /**
186
  * Get original language as language entry
 
187
  * @return LanguageEntry
188
  */
189
  public function get_original_language_name_custom() {
@@ -192,12 +220,15 @@ class Language_Service_Weglot {
192
 
193
  /**
194
  * Get original language and destination languages as language entries
 
195
  * @param bool $allowed_private
 
196
  * @return LanguageEntry[]
197
  */
198
  public function get_original_and_destination_languages( $allowed_private = false ) {
199
  $languages = $this->get_destination_languages( $allowed_private );
200
  array_unshift( $languages, $this->get_original_language() );
 
201
  return $languages;
202
  }
203
  }
31
  }
32
 
33
  /**
 
34
  * @param array $a
35
  * @param array $b
36
+ *
37
  * @return bool
38
+ * @since 2.0.6
39
  */
40
  protected function compare_language( $a, $b ) {
41
  return strcmp( $a['english'], $b['english'] );
43
 
44
  /**
45
  * Get defaults languages available from API
46
+ *
 
47
  * @param array $params
48
+ *
49
  * @return LanguageCollection
50
+ * @since 2.0
51
+ * @version 2.0.6
52
  */
53
  public function get_languages_available( $params = array() ) {
54
  if ( null !== $this->languages ) {
57
 
58
  $client = weglot_get_service( 'Parser_Service_Weglot' )->get_client();
59
 
60
+ $languages = new LanguagesList( $client );
61
 
62
  $this->languages = $languages->handle();
63
 
64
+ // We add the weglot_language_code_replace filter for custom code
65
  $this->languages = $this->languages->jsonSerialize();
66
 
67
  if ( isset( $params['sort'] ) && $params['sort'] ) {
76
  $language_collection->addOne( $entry );
77
  }
78
  $this->languages = $language_collection;
79
+
80
  return $this->languages;
81
  }
82
 
83
  /**
84
  * Adds a language to the language collection
85
+ *
86
  * @param $internal_code
87
  * @param $external_code
88
  * @param $english_name
89
  * @param $local_name
90
+ * @param bool $is_rtl
91
+ *
92
  * @return array
93
  */
94
  public function add_language( $internal_code, $external_code, $english_name, $local_name, $is_rtl = false ) {
95
  $entry = new LanguageEntry( $internal_code, $external_code, $english_name, $local_name, $is_rtl );
96
  $this->languages->addOne( $entry );
97
+
98
  return $this->languages;
99
  }
100
 
101
  /**
102
  * Get all languages : list of 109 default languages merged with custom languages taken from options
103
+ *
104
  * @return array|LanguageCollection|null
105
  */
106
  public function get_all_languages() {
108
  return $this->languages;
109
  }
110
 
111
+ $this->languages = $this->get_languages_available( array( 'sort' => true ) );
112
  $destination_languages = $this->option_services->get_destination_languages();
113
+ $original_language = $this->get_original_language();
114
 
115
  if ( ! empty( $this->get_original_language_name_custom() ) ) {
116
  $this->languages = $this->add_language( $original_language->getInternalCode(), $original_language->getExternalCode(), $this->get_original_language_name_custom(), $this->get_original_language_name_custom() );
117
  }
118
 
119
  foreach ( $destination_languages as $d ) {
120
+ $language_data = $this->languages->getCode( $d['language_to'] );
121
+ if ( ! $language_data ) {
122
+ $this->languages = $this->add_language( $d['language_to'], $d['custom_code'], $d['custom_name'], $d['custom_local_name'] );
123
+ } else {
124
+ $external_code = isset( $d['custom_code'] ) ? $d['custom_code'] : $language_data->getExternalCode();
125
+ $custom_local_name = isset( $d['custom_name'] ) ? $d['custom_name'] : $language_data->getLocalName(); // TODO: remove after core fixes bug.
126
+ $custom_local_name = isset( $d['custom_local_name'] ) ? $d['custom_local_name'] : $custom_local_name;
127
+ $custom_name = isset( $d['custom_name'] ) ? $d['custom_name'] : $language_data->getEnglishName();
128
+ $this->languages = $this->add_language( $d['language_to'], $external_code, $custom_name, $custom_local_name ); // côté core : il faut que le nom qui change soit le custom_local_name.
129
  }
130
  }
 
131
  return $this->languages;
132
  }
133
 
134
  /**
135
  * Get language entry from the internal code
136
+ *
137
  * @param string $internal_code
138
+ *
139
  * @return LanguageEntry
140
+ * @since 3.2.1
141
  */
142
  public function get_language_from_internal( $internal_code ) {
143
  return $this->get_all_languages()[ $internal_code ];
145
 
146
  /**
147
  * Get language entry from the external code
148
+ *
149
  * @param string $external_code
150
+ *
151
  * @return LanguageEntry
152
+ * @since 3.2.1
153
  */
154
  public function get_language_from_external( $external_code ) {
155
  foreach ( $this->get_all_languages() as $language ) {
157
  return $language;
158
  }
159
  }
160
+
161
  return null;
162
  }
163
 
164
  /**
165
  * Get destination languages as language entries
166
+ *
167
  * @param bool $allowed_private
168
+ *
169
  * @return LanguageEntry[]
170
  */
171
  public function get_destination_languages( $allowed_private = false ) {
172
  $destination_languages_as_array = $this->option_services->get_destination_languages();
173
+ $destination_languages = array();
174
  foreach ( $destination_languages_as_array as $destination_language_as_array ) {
175
  if ( $destination_language_as_array['public'] || $allowed_private ) {
176
  if ( $this->get_all_languages()[ $destination_language_as_array['language_to'] ] ) {
178
  }
179
  }
180
  }
181
+
182
  return $destination_languages;
183
  }
184
 
185
  /**
186
  * Get destination languages as language entries
187
+ *
188
  * @param bool $allowed_private
189
+ *
190
  * @return string[]
191
  */
192
  public function get_destination_languages_external( $allowed_private = false ) {
193
  return array_map(
194
+ function ( $l ) {
195
  return $l->getExternalCode();
196
+ },
197
+ $this->get_destination_languages( $allowed_private )
198
  );
199
  }
200
 
201
  /**
202
  * Get original language as language entry
203
+ *
204
  * @return LanguageEntry
205
  */
206
  public function get_original_language() {
207
  $original_language_code = $this->option_services->get_option( 'original_language' );
208
+
209
  return $this->get_language_from_internal( $original_language_code );
210
  }
211
 
212
  /**
213
  * Get original language as language entry
214
+ *
215
  * @return LanguageEntry
216
  */
217
  public function get_original_language_name_custom() {
220
 
221
  /**
222
  * Get original language and destination languages as language entries
223
+ *
224
  * @param bool $allowed_private
225
+ *
226
  * @return LanguageEntry[]
227
  */
228
  public function get_original_and_destination_languages( $allowed_private = false ) {
229
  $languages = $this->get_destination_languages( $allowed_private );
230
  array_unshift( $languages, $this->get_original_language() );
231
+
232
  return $languages;
233
  }
234
  }
src/services/class-option-service-weglot.php CHANGED
@@ -26,7 +26,7 @@ class Option_Service_Weglot {
26
  protected $slugs_cache = null;
27
 
28
  protected $options_from_api = null;
29
- protected $slugs_from_api = null;
30
 
31
  const NO_OPTIONS = 'OPTIONS_NOT_FOUND';
32
 
@@ -59,6 +59,7 @@ class Option_Service_Weglot {
59
  'active_wc_reload' => true,
60
  'flag_css' => '',
61
  ),
 
62
  'allowed' => true,
63
  'has_first_settings' => true,
64
  'show_box_first_settings' => false,
@@ -169,7 +170,7 @@ class Option_Service_Weglot {
169
 
170
  /**
171
  * @param string $api_key
172
- * @param array $destinations_languages
173
  *
174
  * @return array
175
  * @since 3.0.0
@@ -261,7 +262,7 @@ class Option_Service_Weglot {
261
  }
262
 
263
  /**
264
- * @param string $api_key
265
  * @param $destinations_languages
266
  *
267
  * @return array
@@ -393,10 +394,12 @@ class Option_Service_Weglot {
393
  $api_key_private = $this->get_api_key_private();
394
  $options = null;
395
 
396
- if ( Helper_Is_Admin::is_wp_admin() && $api_key_private ) {
 
 
397
  $response = $this->get_options_from_api_with_api_key( $api_key_private );
398
  } else {
399
- if ( ! Helper_Is_Admin::is_wp_admin() && $api_key ) {
400
  $response = $this->get_options_from_cdn_with_api_key( $api_key );
401
  } else {
402
  return $this->get_options_from_v2();
@@ -422,10 +425,10 @@ class Option_Service_Weglot {
422
 
423
  $destinations_languages = array_column( $options['destination_language'], 'language_to' );
424
 
425
- if ( Helper_Is_Admin::is_wp_admin() && $api_key_private ) {
426
  $slugs = $this->get_slugs_from_api_with_api_key( $api_key_private, $destinations_languages );
427
  } else {
428
- if ( ! Helper_Is_Admin::is_wp_admin() && $api_key ) {
429
  $slugs = $this->get_slugs_from_cache_with_api_key( $api_key_private, $destinations_languages );
430
  }
431
  }
@@ -580,7 +583,7 @@ class Option_Service_Weglot {
580
 
581
  /**
582
  * @param string $key
583
- * @param array $switcher
584
  *
585
  * @return string|boolean|int
586
  * @throws Exception
@@ -769,7 +772,7 @@ class Option_Service_Weglot {
769
  /**
770
  *
771
  * @param string $key
772
- * @param mixed $value
773
  *
774
  * @return Option_Service_Weglot
775
  */
26
  protected $slugs_cache = null;
27
 
28
  protected $options_from_api = null;
29
+ protected $slugs_from_api = null;
30
 
31
  const NO_OPTIONS = 'OPTIONS_NOT_FOUND';
32
 
59
  'active_wc_reload' => true,
60
  'flag_css' => '',
61
  ),
62
+ 'page_views_enabled' => false,
63
  'allowed' => true,
64
  'has_first_settings' => true,
65
  'show_box_first_settings' => false,
170
 
171
  /**
172
  * @param string $api_key
173
+ * @param array $destinations_languages
174
  *
175
  * @return array
176
  * @since 3.0.0
262
  }
263
 
264
  /**
265
+ * @param string $api_key
266
  * @param $destinations_languages
267
  *
268
  * @return array
394
  $api_key_private = $this->get_api_key_private();
395
  $options = null;
396
 
397
+ $is_weglot_settings_page = isset( $_GET['page']) && strpos( $_GET['page'], 'weglot-settings' ) !== false; //phpcs:ignore
398
+
399
+ if ( Helper_Is_Admin::is_wp_admin() && $api_key_private && $is_weglot_settings_page ) {
400
  $response = $this->get_options_from_api_with_api_key( $api_key_private );
401
  } else {
402
+ if ( ( ! Helper_Is_Admin::is_wp_admin() && $api_key ) || ( Helper_Is_Admin::is_wp_admin() && ! $is_weglot_settings_page ) ) {
403
  $response = $this->get_options_from_cdn_with_api_key( $api_key );
404
  } else {
405
  return $this->get_options_from_v2();
425
 
426
  $destinations_languages = array_column( $options['destination_language'], 'language_to' );
427
 
428
+ if ( Helper_Is_Admin::is_wp_admin() && $api_key_private && $is_weglot_settings_page ) {
429
  $slugs = $this->get_slugs_from_api_with_api_key( $api_key_private, $destinations_languages );
430
  } else {
431
+ if ( ( ! Helper_Is_Admin::is_wp_admin() && $api_key ) || ( Helper_Is_Admin::is_wp_admin() && ! $is_weglot_settings_page ) ) {
432
  $slugs = $this->get_slugs_from_cache_with_api_key( $api_key_private, $destinations_languages );
433
  }
434
  }
583
 
584
  /**
585
  * @param string $key
586
+ * @param array $switcher
587
  *
588
  * @return string|boolean|int
589
  * @throws Exception
772
  /**
773
  *
774
  * @param string $key
775
+ * @param mixed $value
776
  *
777
  * @return Option_Service_Weglot
778
  */
src/services/class-pdf-translate-service-weglot.php ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Services;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use Weglot\Parser\Parser;
10
+ use Weglot\Parser\ConfigProvider\ServerConfigProvider;
11
+
12
+
13
+ /**
14
+ * @since 3.7
15
+ */
16
+ class Pdf_Translate_Service_Weglot {
17
+ /**
18
+ * @var Option_Service_Weglot
19
+ */
20
+ private $option_services;
21
+ /**
22
+ * @var Parser_Service_Weglot
23
+ */
24
+ private $parser_services;
25
+ /**
26
+ * @var Language_Service_Weglot
27
+ */
28
+ private $language_services;
29
+
30
+ /**
31
+ * @since 3.7
32
+ */
33
+ public function __construct() {
34
+ $this->option_services = weglot_get_service( 'Option_Service_Weglot' );
35
+ $this->parser_services = weglot_get_service( 'Parser_Service_Weglot' );
36
+ $this->language_services = weglot_get_service( 'Language_Service_Weglot' );
37
+ }
38
+
39
+
40
+ /**
41
+ * Translate pdf with parser
42
+ * @version 3.7
43
+ * @param string $content
44
+ * @param string $language
45
+ * @return array
46
+ */
47
+ public function translate_pdf( $content, $language ) {
48
+ $api_key = $this->option_services->get_option( 'api_key' );
49
+
50
+ if ( ! $api_key ) {
51
+ return $content;
52
+ }
53
+
54
+ try {
55
+ $original_language = $this->language_services->get_original_language()->getInternalCode();
56
+ $exclude_blocks = $this->option_services->get_exclude_blocks();
57
+
58
+ $config = new ServerConfigProvider();
59
+ $client = $this->parser_services->get_client();
60
+ $parser = new Parser( $client, $config, $exclude_blocks );
61
+ $translated_content = $parser->translate( $content, $original_language, $language ); //phpcs:ignore
62
+
63
+ return array(
64
+ 'content' => $translated_content,
65
+ );
66
+ } catch ( \Exception $e ) {
67
+ return $content;
68
+ }
69
+ }
70
+ }
71
+
72
+
73
+
src/services/class-redirect-service-weglot.php CHANGED
@@ -116,6 +116,10 @@ class Redirect_Service_Weglot {
116
 
117
  // We add the original in the list of available languages.
118
  $available_languages[] = $this->language_services->get_original_language()->getExternalCode();
 
 
 
 
119
  if ( ! empty( $navigator_languages ) ) {
120
  $destination_languages_external = array_map( 'strtolower', $available_languages );
121
  foreach ( $navigator_languages as $navigator_language ) {
116
 
117
  // We add the original in the list of available languages.
118
  $available_languages[] = $this->language_services->get_original_language()->getExternalCode();
119
+
120
+ // We check if user add a custom languages code
121
+ $navigator_languages = apply_filters('weglot_navigator_language', $navigator_languages);
122
+
123
  if ( ! empty( $navigator_languages ) ) {
124
  $destination_languages_external = array_map( 'strtolower', $available_languages );
125
  foreach ( $navigator_languages as $navigator_language ) {
src/services/class-replace-link-service-weglot.php CHANGED
@@ -46,10 +46,11 @@ class Replace_Link_Service_Weglot {
46
  * @since 2.0
47
  * @param string $url
48
  * @param LanguageEntry $language
 
49
  * @return string
50
  */
51
- public function replace_url( $url, $language ) {
52
- $replaced_url = apply_filters( 'weglot_replace_url', $this->request_url_services->create_url_object( $url )->getForLanguage( $language, true ), $url, $language );
53
  if ( $replaced_url ) {
54
  return $replaced_url;
55
  } else {
@@ -153,7 +154,7 @@ class Replace_Link_Service_Weglot {
153
  */
154
  public function replace_form( $translated_page, $current_url, $quote1, $quote2, $sometags = null, $sometags2 = null ) {
155
  $current_language = $this->request_url_services->get_current_language();
156
- $translated_page = preg_replace( '/<form' . preg_quote( $sometags, '/' ) . 'action=' . preg_quote( $quote1 . $current_url . $quote2, '/' ) . '/', '<form ' . $sometags . 'action=' . $quote1 . $this->replace_url( $current_url, $current_language ) . $quote2, $translated_page );
157
 
158
  return $translated_page;
159
  }
46
  * @since 2.0
47
  * @param string $url
48
  * @param LanguageEntry $language
49
+ * @param Bool $evenExcluded
50
  * @return string
51
  */
52
+ public function replace_url( $url, $language, $evenExcluded = true ) {
53
+ $replaced_url = apply_filters( 'weglot_replace_url', $this->request_url_services->create_url_object( $url )->getForLanguage( $language, $evenExcluded ), $url, $language );
54
  if ( $replaced_url ) {
55
  return $replaced_url;
56
  } else {
154
  */
155
  public function replace_form( $translated_page, $current_url, $quote1, $quote2, $sometags = null, $sometags2 = null ) {
156
  $current_language = $this->request_url_services->get_current_language();
157
+ $translated_page = preg_replace( '/<form' . preg_quote( $sometags, '/' ) . 'action=' . preg_quote( $quote1 . $current_url . $quote2, '/' ) . '/', '<form ' . $sometags . 'action=' . $quote1 . $this->replace_url( $current_url, $current_language, false ) . $quote2, $translated_page );
158
 
159
  return $translated_page;
160
  }
src/services/class-replace-url-service-weglot.php CHANGED
@@ -208,6 +208,7 @@ class Replace_Url_Service_Weglot {
208
  * @return boolean
209
  */
210
  public function is_link_a_file( $current_url ) {
 
211
  $files = [
212
  'pdf',
213
  'rar',
@@ -223,10 +224,12 @@ class Replace_Url_Service_Weglot {
223
  'zip',
224
  'mp4',
225
  'xlsx',
 
 
226
  ];
227
 
228
  foreach ( $files as $file ) {
229
- if ( self::ends_with( $current_url, '.' . $file ) ) {
230
  return true;
231
  }
232
  }
208
  * @return boolean
209
  */
210
  public function is_link_a_file( $current_url ) {
211
+
212
  $files = [
213
  'pdf',
214
  'rar',
224
  'zip',
225
  'mp4',
226
  'xlsx',
227
+ 'txt',
228
+ 'eps',
229
  ];
230
 
231
  foreach ( $files as $file ) {
232
+ if ( self::ends_with( strtolower( $current_url ), '.' . $file ) ) {
233
  return true;
234
  }
235
  }
src/services/class-translate-service-weglot.php CHANGED
@@ -133,15 +133,13 @@ class Translate_Service_Weglot {
133
  * @return boolean
134
  */
135
  public function check_404_exclusion_before_treat() {
136
-
137
  if ( http_response_code() == 404 ) {
138
  $excluded_urls = $this->option_services->get_exclude_urls();
139
- foreach ( $excluded_urls as $url ) {
140
- if ( in_array( '^/404$', $url ) ) {
141
  return true;
142
  }
143
  }
144
-
145
  return false;
146
  } else {
147
  return false;
@@ -276,7 +274,6 @@ class Translate_Service_Weglot {
276
  $dom = preg_replace( '/<link rel="canonical"(.*?)?href=(\"|\')([^\s\>]+?)(\"|\')/', '<link rel="canonical" href="' . esc_url ( $current_url->getForLanguage( $this->language_services->get_original_language() ) ) . '"', $dom );
277
  }
278
  }
279
-
280
  return apply_filters( 'weglot_render_dom', $dom );
281
  }
282
  }
133
  * @return boolean
134
  */
135
  public function check_404_exclusion_before_treat() {
 
136
  if ( http_response_code() == 404 ) {
137
  $excluded_urls = $this->option_services->get_exclude_urls();
138
+ foreach ( $excluded_urls as $item ) {
139
+ if($item[0] === '^/404$'){
140
  return true;
141
  }
142
  }
 
143
  return false;
144
  } else {
145
  return false;
274
  $dom = preg_replace( '/<link rel="canonical"(.*?)?href=(\"|\')([^\s\>]+?)(\"|\')/', '<link rel="canonical" href="' . esc_url ( $current_url->getForLanguage( $this->language_services->get_original_language() ) ) . '"', $dom );
275
  }
276
  }
 
277
  return apply_filters( 'weglot_render_dom', $dom );
278
  }
279
  }
src/third/woocommerce/class-wc-mail-weglot.php CHANGED
@@ -32,8 +32,8 @@ class WC_Mail_Weglot implements Hooks_Interface_Weglot {
32
  private $language_services;
33
 
34
  /**
35
- * @since 3.1.6
36
  * @return void
 
37
  */
38
  public function __construct() {
39
  $this->wc_active_services = weglot_get_service( 'Wc_Active' );
@@ -42,8 +42,8 @@ class WC_Mail_Weglot implements Hooks_Interface_Weglot {
42
  }
43
 
44
  /**
45
- * @since 3.1.6
46
  * @return void
 
47
  */
48
  public function hooks() {
49
  if ( ! $this->wc_active_services->is_active() || ! apply_filters( 'weglot_woocommerce_translate_following_mail', true ) ) {
@@ -57,6 +57,7 @@ class WC_Mail_Weglot implements Hooks_Interface_Weglot {
57
  /**
58
  * @param $args
59
  * @param $mail
 
60
  * @return array
61
  * @since 3.1.6
62
  */
@@ -84,18 +85,29 @@ class WC_Mail_Weglot implements Hooks_Interface_Weglot {
84
 
85
  add_filter(
86
  'weglot_translate_email_languages_forced',
87
- function() use ( $current_and_original_language ) {
88
  return $current_and_original_language;
89
  }
90
  );
91
  }
92
- } else { // If mail is for admin
93
- $current_and_original_language['original'] = $this->language_services->get_original_language()->getInternalCode();
94
- $current_and_original_language['current'] = $current_and_original_language['original'];
 
 
 
 
 
 
 
 
 
 
 
95
 
96
  add_filter(
97
  'weglot_translate_email_languages_forced',
98
- function() use ( $current_and_original_language ) {
99
  return $current_and_original_language;
100
  }
101
  );
@@ -107,8 +119,8 @@ class WC_Mail_Weglot implements Hooks_Interface_Weglot {
107
 
108
 
109
  /**
110
- * @since 3.1.6
111
  * @return int
 
112
  */
113
  public function save_language( $order_id ) {
114
  if ( Helper_Is_Admin::is_wp_admin() ) {
32
  private $language_services;
33
 
34
  /**
 
35
  * @return void
36
+ * @since 3.1.6
37
  */
38
  public function __construct() {
39
  $this->wc_active_services = weglot_get_service( 'Wc_Active' );
42
  }
43
 
44
  /**
 
45
  * @return void
46
+ * @since 3.1.6
47
  */
48
  public function hooks() {
49
  if ( ! $this->wc_active_services->is_active() || ! apply_filters( 'weglot_woocommerce_translate_following_mail', true ) ) {
57
  /**
58
  * @param $args
59
  * @param $mail
60
+ *
61
  * @return array
62
  * @since 3.1.6
63
  */
85
 
86
  add_filter(
87
  'weglot_translate_email_languages_forced',
88
+ function () use ( $current_and_original_language ) {
89
  return $current_and_original_language;
90
  }
91
  );
92
  }
93
+ } else { // If mail is for admin.
94
+ //check if send is send to customer to.
95
+ if ( $mail->object->get_billing_email() === $mail->get_recipient() ) {
96
+ $woocommerce_order_language = get_post_meta( $mail->object->get_id(), 'weglot_language', true );
97
+ $current_and_original_language = array(
98
+ 'original' => $this->language_services->get_original_language()->getInternalCode(),
99
+ 'current' => $this->request_url_services->get_current_language()->getInternalCode(),
100
+ );
101
+ $current_and_original_language['current'] = $this->language_services->get_language_from_external( $woocommerce_order_language )->getInternalCode();
102
+
103
+ } else {
104
+ $current_and_original_language['original'] = $this->language_services->get_original_language()->getInternalCode();
105
+ $current_and_original_language['current'] = $current_and_original_language['original'];
106
+ }
107
 
108
  add_filter(
109
  'weglot_translate_email_languages_forced',
110
+ function () use ( $current_and_original_language ) {
111
  return $current_and_original_language;
112
  }
113
  );
119
 
120
 
121
  /**
 
122
  * @return int
123
+ * @since 3.1.6
124
  */
125
  public function save_language( $order_id ) {
126
  if ( Helper_Is_Admin::is_wp_admin() ) {
src/third/woocommercepdf/class-wcpdf-active.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Third\Woocommercepdf;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use WeglotWP\Models\Third_Active_Interface_Weglot;
10
+
11
+
12
+ /**
13
+ * Wcpdf_Active
14
+ *
15
+ * @since 2.0
16
+ */
17
+ class Wcpdf_Active implements Third_Active_Interface_Weglot {
18
+
19
+ /**
20
+ * WooCommerce PDF Invoices & Packing Slips is active ?
21
+ * @since 2.0
22
+ *
23
+ * @return boolean
24
+ */
25
+ public function is_active() {
26
+ if ( ! function_exists( 'is_plugin_active' ) ) {
27
+ include_once ABSPATH . 'wp-admin/includes/plugin.php';
28
+ }
29
+
30
+ if ( ! is_plugin_active( 'woocommerce-pdf-invoices-packing-slips/woocommerce-pdf-invoices-packingslips.php' ) ) {
31
+ return false;
32
+ }
33
+
34
+ return true;
35
+ }
36
+ }
src/third/woocommercepdf/class-wcpdf-weglot.php ADDED
@@ -0,0 +1,102 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace WeglotWP\Third\Woocommercepdf;
4
+
5
+ if ( ! defined( 'ABSPATH' ) ) {
6
+ exit;
7
+ }
8
+
9
+ use Dompdf\Dompdf;
10
+ use Dompdf\Options;
11
+ use WeglotWP\Helpers\Helper_Is_Admin;
12
+ use WeglotWP\Models\Hooks_Interface_Weglot;
13
+ use WeglotWP\Services\Language_Service_Weglot;
14
+ use WeglotWP\Services\Pdf_Translate_Service_Weglot;
15
+ use WeglotWP\Services\Request_Url_Service_Weglot;
16
+ use WeglotWP\Third\Woocommercepdf\Wcpdf_Active;
17
+
18
+
19
+ /**
20
+ * WC_Mail_Weglot
21
+ *
22
+ * @since 3.7
23
+ */
24
+ class WCPDF_Weglot implements Hooks_Interface_Weglot {
25
+ /**
26
+ * @var Wcpdf_Active
27
+ */
28
+ private $wcpdf_active_services;
29
+ /**
30
+ * @var Pdf_Translate_Service_Weglot
31
+ */
32
+ private $pdf_translate_services;
33
+ /**
34
+ * @var Request_Url_Service_Weglot
35
+ */
36
+ private $request_url_services;
37
+ /**
38
+ * @var Language_Service_Weglot
39
+ */
40
+ private $language_services;
41
+
42
+ /**
43
+ * @return void
44
+ * @since 3.7
45
+ */
46
+ public function __construct() {
47
+ $this->wcpdf_active_services = weglot_get_service( 'Wcpdf_Active' );
48
+ $this->request_url_services = weglot_get_service( 'Request_Url_Service_Weglot' );
49
+ $this->language_services = weglot_get_service( 'Language_Service_Weglot' );
50
+ $this->pdf_translate_services = weglot_get_service( 'Pdf_Translate_Service_Weglot' );
51
+ }
52
+
53
+ /**
54
+ * @return void
55
+ * @since 3.7
56
+ */
57
+ public function hooks() {
58
+ if ( ! $this->wcpdf_active_services->is_active() ) {
59
+ return;
60
+ }
61
+ add_filter( 'wpo_wcpdf_before_dompdf_render', array( $this, 'translate_invoice_pdf' ), 10, 2 );
62
+ }
63
+
64
+ /**
65
+ * @param $args
66
+ * @param $html
67
+ *
68
+ * @return string
69
+ * @since 3.7
70
+ */
71
+ public function translate_invoice_pdf( $dompdf, $html ) {
72
+
73
+ if( ! empty( sanitize_key($_GET['order_ids'] ))){ // phpcs:ignore
74
+ $order_id = sanitize_key($_GET['order_ids']); // phpcs:ignore
75
+ }
76
+
77
+ if( empty( $order_id )){
78
+ return $dompdf;
79
+ }
80
+
81
+ $woocommerce_order_language = get_post_meta( $order_id, 'weglot_language', true ); // phpcs:ignore
82
+
83
+ $_dompdf = clone $dompdf;
84
+ unset( $dompdf );
85
+ $_dompdf_options = $_dompdf->getOptions();
86
+ $_dompdf_paper_size = $_dompdf->getPaperSize();
87
+ $_dompdf_paper_orientation = $_dompdf->getPaperOrientation();
88
+
89
+ $_dompdf->loadHtml( $html );
90
+ $_dompdf->render();
91
+ unset( $_dompdf );
92
+
93
+ $dompdf = new \Dompdf\Dompdf( $_dompdf_options );
94
+ $translated_pdf = $this->pdf_translate_services->translate_pdf( $html, $woocommerce_order_language );
95
+
96
+ $dompdf->loadHtml( $translated_pdf['content'] );
97
+ $dompdf->setPaper( $_dompdf_paper_size, $_dompdf_paper_orientation );
98
+
99
+ return $dompdf;
100
+ }
101
+
102
+ }
templates/admin/pages/tabs/advanced.php CHANGED
@@ -10,48 +10,53 @@ use Weglot\Util\Regex\RegexEnum;
10
  use WeglotWP\Helpers\Helper_Tabs_Admin_Weglot;
11
  use WeglotWP\Helpers\Helper_Excluded_Type;
12
 
13
- $options_available = [
14
- 'exclude_urls' => [
15
  'key' => 'exclude_urls',
16
  'label' => __( 'Exclusion URL', 'weglot' ),
17
  'description' => __( 'Add URL that you want to exclude from translations. You can use regular expression to match multiple URLs. ', 'weglot' ),
18
- ],
19
- 'exclude_blocks' => [
20
  'key' => 'exclude_blocks',
21
  'label' => __( 'Exclusion Blocks', 'weglot' ),
22
  'description' => __( 'Enter the CSS selector of blocks you don\'t want to translate (like a sidebar, a menu, a paragraph, etc...)', 'weglot' ),
23
- ],
24
- 'auto_redirect' => [
25
  'key' => 'auto_redirect',
26
  'label' => __( 'Auto redirection', 'weglot' ),
27
  'description' => __( 'Check if you want to redirect users based on their browser language.', 'weglot' ),
28
- ],
29
- 'email_translate' => [
30
  'key' => 'email_translate',
31
  'label' => __( 'Translate email', 'weglot' ),
32
  'description' => __( 'Check to translate all emails who use function wp_mail', 'weglot' ),
33
- ],
34
- 'translate_amp' => [
35
  'key' => 'translate_amp',
36
  'label' => __( 'Translate AMP', 'weglot' ),
37
  'description' => __( 'Translate AMP page', 'weglot' ),
38
- ],
39
- 'active_search' => [
40
  'key' => 'active_search',
41
  'label' => __( 'Search WordPress', 'weglot' ),
42
  'description' => __( 'Allow your users to search in the language they use.', 'weglot' ),
43
- ],
44
- 'private_mode' => [
45
  'key' => 'private_mode',
46
  'label' => __( 'Private mode', 'weglot' ),
47
  'description' => __( 'Check if your only want admin users to see the translations', 'weglot' ),
48
- ],
49
- 'active_wc_reload' => [
50
  'key' => 'active_wc_reload',
51
  'label' => __( '[WooCommerce] : Prevent reload cart', 'weglot' ),
52
  'description' => __( 'You should only enable this option if you have translation errors on your cart widget.', 'weglot' ),
53
- ]
54
- ];
 
 
 
 
 
55
 
56
  ?>
57
 
@@ -97,7 +102,7 @@ $options_available = [
97
  <span class="dashicons dashicons-minus"></span>
98
  </button>
99
  </div>
100
- <?php
101
  endforeach;
102
  endif;
103
  ?>
@@ -178,6 +183,23 @@ $options_available = [
178
  <p class="description"><?php echo esc_html( $options_available['active_search']['description'] ); ?></p>
179
  </td>
180
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  </tbody>
182
  </table>
183
 
10
  use WeglotWP\Helpers\Helper_Tabs_Admin_Weglot;
11
  use WeglotWP\Helpers\Helper_Excluded_Type;
12
 
13
+ $options_available = array(
14
+ 'exclude_urls' => array(
15
  'key' => 'exclude_urls',
16
  'label' => __( 'Exclusion URL', 'weglot' ),
17
  'description' => __( 'Add URL that you want to exclude from translations. You can use regular expression to match multiple URLs. ', 'weglot' ),
18
+ ),
19
+ 'exclude_blocks' => array(
20
  'key' => 'exclude_blocks',
21
  'label' => __( 'Exclusion Blocks', 'weglot' ),
22
  'description' => __( 'Enter the CSS selector of blocks you don\'t want to translate (like a sidebar, a menu, a paragraph, etc...)', 'weglot' ),
23
+ ),
24
+ 'auto_redirect' => array(
25
  'key' => 'auto_redirect',
26
  'label' => __( 'Auto redirection', 'weglot' ),
27
  'description' => __( 'Check if you want to redirect users based on their browser language.', 'weglot' ),
28
+ ),
29
+ 'email_translate' => array(
30
  'key' => 'email_translate',
31
  'label' => __( 'Translate email', 'weglot' ),
32
  'description' => __( 'Check to translate all emails who use function wp_mail', 'weglot' ),
33
+ ),
34
+ 'translate_amp' => array(
35
  'key' => 'translate_amp',
36
  'label' => __( 'Translate AMP', 'weglot' ),
37
  'description' => __( 'Translate AMP page', 'weglot' ),
38
+ ),
39
+ 'active_search' => array(
40
  'key' => 'active_search',
41
  'label' => __( 'Search WordPress', 'weglot' ),
42
  'description' => __( 'Allow your users to search in the language they use.', 'weglot' ),
43
+ ),
44
+ 'private_mode' => array(
45
  'key' => 'private_mode',
46
  'label' => __( 'Private mode', 'weglot' ),
47
  'description' => __( 'Check if your only want admin users to see the translations', 'weglot' ),
48
+ ),
49
+ 'active_wc_reload' => array(
50
  'key' => 'active_wc_reload',
51
  'label' => __( '[WooCommerce] : Prevent reload cart', 'weglot' ),
52
  'description' => __( 'You should only enable this option if you have translation errors on your cart widget.', 'weglot' ),
53
+ ),
54
+ 'page_views_enabled' => array(
55
+ 'key' => 'page_views_enabled',
56
+ 'label' => __( 'Page views tracking (beta)', 'weglot' ),
57
+ 'description' => __( 'You can enable tracking of page views. This will save the country and browser language of visitors.', 'weglot' ),
58
+ ),
59
+ );
60
 
61
  ?>
62
 
102
  <span class="dashicons dashicons-minus"></span>
103
  </button>
104
  </div>
105
+ <?php
106
  endforeach;
107
  endif;
108
  ?>
183
  <p class="description"><?php echo esc_html( $options_available['active_search']['description'] ); ?></p>
184
  </td>
185
  </tr>
186
+ <tr valign="top">
187
+ <th scope="row" class="titledesc">
188
+ <label for="<?php echo esc_attr( $options_available['page_views_enabled']['key'] ); ?>">
189
+ <?php echo esc_html( $options_available['page_views_enabled']['label'] ); ?>
190
+ </label>
191
+ <p class="sub-label"><?php echo esc_html( $options_available['page_views_enabled']['description'] ); ?></p>
192
+ </th>
193
+ <td class="forminp forminp-text">
194
+
195
+ <?php if ( $this->options['page_views_enabled'] ) : ?>
196
+ <p class="description"><a target="_blank" href="https://dashboard.weglot.com/statistics/page-views/" title="Page views tracking is activated">Page views tracking</a> is <b>activated</b></p>
197
+ <?php else : ?>
198
+ <p class="description"><a target="_blank" href="https://dashboard.weglot.com/statistics/page-views/" title="Page views tracking is deactivated">Page views tracking</a> is <b>deactivated</b></p>
199
+ <?php endif; ?>
200
+ <p><small><span class="wp-menu-image dashicons-before dashicons-welcome-comments"></span><?php esc_html_e( 'When you enable page views tracking, Weglot plugin will send statistics about your visitors\' browser language and country. You can then view this data in your Weglot account, for example your visitors\' most common country or most common language. Note that these statistics are completely anonymous.', 'weglot' ); ?></small></p>
201
+ </td>
202
+ </tr>
203
  </tbody>
204
  </table>
205
 
templates/admin/pages/tabs/appearance.php CHANGED
@@ -3,44 +3,45 @@
3
  if ( ! defined( 'ABSPATH' ) ) {
4
  exit;
5
  }
 
6
  use WeglotWP\Helpers\Helper_Tabs_Admin_Weglot;
7
  use WeglotWP\Helpers\Helper_Flag_Type;
8
 
9
  $options_available = [
10
- 'type_flags' => [
11
  'key' => 'type_flags',
12
  'label' => __( 'Type of flags', 'weglot' ),
13
  'description' => '',
14
  ],
15
- 'is_fullname' => [
16
  'key' => 'is_fullname',
17
  'label' => __( 'Is fullname', 'weglot' ),
18
  'description' => __( "Check if you want the name of the language. Don't check if you want the language code.", 'weglot' ),
19
  ],
20
- 'with_name' => [
21
  'key' => 'with_name',
22
  'label' => __( 'With name', 'weglot' ),
23
  'description' => __( 'Check if you want to display the name of languages.', 'weglot' ),
24
  ],
25
- 'is_dropdown' => [
26
  'key' => 'is_dropdown',
27
  'label' => __( 'Is dropdown', 'weglot' ),
28
  'description' => __( 'Check if you want the button to be a dropdown box.', 'weglot' ),
29
  ],
30
- 'with_flags' => [
31
  'key' => 'with_flags',
32
  'label' => __( 'With flags', 'weglot' ),
33
  'description' => __( 'Check if you want flags in the language button.', 'weglot' ),
34
  ],
35
- 'override_css' => [
36
  'key' => 'override_css',
37
  'label' => __( 'Override CSS', 'weglot' ),
38
  'description' => __( "Don't change it unless you want a specific style for your button.", 'weglot' ),
39
  ],
40
- 'flag_css' => [
41
- 'key' => 'flag_css',
42
  ],
43
- 'switcher_editor' => [
44
  'key' => 'switcher_editor',
45
  'label' => __( 'Custom position?', 'weglot' ),
46
  'description' => __( 'You can place the button anywhere in your site using our switcher editor in your Weglot Dashboard', 'weglot' ),
@@ -51,17 +52,17 @@ $options_available = [
51
  <style id="weglot-css-flag-css"></style>
52
  <style id="weglot-css-inline"></style>
53
  <?php if ( empty( $this->option_services->get_switchers_editor_button() ) ) { ?>
54
- <h3>
55
- <?php echo esc_html__( 'Language button design', 'weglot' ) . ' ' . esc_html__( '(Optional)', 'weglot' ); ?>
56
- </h3>
57
- <hr />
58
 
59
- <table class="form-table">
60
- <tbody>
61
  <tr valign="top">
62
  <th scope="row" class="titledesc">
63
  <label>
64
- <?php echo esc_html__( 'Button preview', 'weglot' ); ?>
65
  </label>
66
  </th>
67
  <td class="forminp forminp-text">
@@ -142,7 +143,9 @@ $options_available = [
142
  </option>
143
  </select>
144
  <div class="flag-style-openclose"><?php esc_html_e( 'Change country flags', 'weglot' ); ?></div>
145
- <p id="custom_flag_tips">You are still using old flags. To use new SVG flags, make sure you are using the default flags (if you have some custom CSS related to background-position or background-image, remove it). Then save your settings and you will be using the flags</p>
 
 
146
  <div class="flag-style-wrapper" style="display:none;">
147
  <select class="flag-en-type wg-input-select">
148
  <option value=0><?php esc_html_e( 'Choose English flag:', 'weglot' ); ?></option>
@@ -222,7 +225,9 @@ $options_available = [
222
  </select>
223
  <p><?php esc_html_e( 'If you want to use a different flag, just ask us.', 'weglot' ); ?></p>
224
  </div>
225
- <textarea id="flag_css" name="<?php echo esc_attr( sprintf( '%s[%s]', WEGLOT_SLUG, $options_available['flag_css']['key'] ) ); ?>" style="display:none;"><?php echo esc_attr( $this->options['flag_css'] ); ?></textarea>
 
 
226
  </td>
227
  </tr>
228
  <tr valign="top">
@@ -249,9 +254,9 @@ $options_available = [
249
  </th>
250
  <td class="forminp forminp-text">
251
  <input
252
- name="<?php echo esc_attr( sprintf( '%s[custom_settings][button_style][full_name]', WEGLOT_SLUG ) ); ?>"
253
- id="<?php echo esc_attr( $options_available['is_fullname']['key'] ); ?>"
254
- type="checkbox"
255
  <?php checked( $this->options[ $options_available['is_fullname']['key'] ], 1 ); ?>
256
  >
257
  <p class="description"><?php echo esc_html( $options_available['is_fullname']['description'] ); ?></p>
@@ -262,8 +267,8 @@ $options_available = [
262
  <label for="<?php echo esc_attr( $options_available['override_css']['key'] ); ?>">
263
  <?php echo esc_html( $options_available['override_css']['label'] ); ?>
264
  </label>
265
- <p class="sub-label"><?php echo esc_html( $options_available['override_css']['description'] ); ?></p>
266
- </td>
267
  </th>
268
  <td class="forminp forminp-text">
269
  <textarea
@@ -272,18 +277,19 @@ $options_available = [
272
  type="text"
273
  rows="10"
274
  cols="30"
275
- name="<?php echo esc_attr( sprintf( '%s[custom_settings][button_style][custom_css]', WEGLOT_SLUG ) ); ?>" placeholder=".country-selector {
 
276
  margin-bottom: 20px;
277
  }"><?php echo $this->options[ $options_available['override_css']['key'] ]; //phpcs:ignore?></textarea>
278
  </tr>
279
- </tbody>
280
- </table>
281
  <?php } ?>
282
 
283
  <h3>
284
  <?php echo esc_html_e( 'Language button position', 'weglot' ) . ' ' . esc_html__( '(Optional)', 'weglot' ); ?>
285
  </h3>
286
- <hr />
287
 
288
  <p><?php esc_html_e( 'Where will the language button be on my website? By default, bottom right.', 'weglot' ); ?></p>
289
 
@@ -303,11 +309,12 @@ $options_available = [
303
  checked
304
  style="display:inline-block;"
305
  >
306
- <div class="notice notice-error is-dismissible" style="display: inline-block; position: relative; width: 80%; vertical-align: middle;">
 
307
  <p>
308
  <?php
309
- // translators: 1 HTML Tag, 2 HTML Tag
310
- echo esc_html__( 'Warning, this feature will be depreciated. We strongly advise you to uncheck the option and use and use the functionality: "In menu".', 'weglot' );
311
  ?>
312
  </p>
313
  </div>
@@ -318,13 +325,13 @@ $options_available = [
318
  <tr valign="top">
319
  <th scope="row"><?php esc_html_e( 'In menu?', 'weglot' ); ?></th>
320
  <td>
321
- <?php echo sprintf( esc_html__( 'You can place the button in a menu area. Go to %1$sAppearance → Menus%2$s and drag and drop the Weglot Translate Custom link where you want.' , 'weglot' ), '<a href="' . esc_url( admin_url( 'nav-menus.php' ) ) . '">', '</a>' ); ?>
322
  </td>
323
  </tr>
324
  <tr valign="top">
325
  <th scope="row"><?php esc_html_e( 'As a widget?', 'weglot' ); ?></th>
326
  <td>
327
- <?php echo sprintf ( esc_html__ ( 'You can place the button in a widget area. Go to %1$sAppearance → Widgets%2$s and drag and drop the Weglot Translate widget where you want.', 'weglot' ), '<a href="' . esc_url( admin_url( 'widgets.php' ) ) . '">', '</a>' ); ?>
328
  </td>
329
  </tr>
330
  <tr valign="top">
@@ -340,20 +347,21 @@ $options_available = [
340
  </td>
341
  </tr>
342
 
343
- <!--<tr valign="top">
344
  <th scope="row" class="titledesc">
345
- <label for="<?php /*echo esc_attr( $options_available['switcher_editor']['key'] ); */?>">
346
- <?php /*echo esc_html( $options_available['switcher_editor']['label'] ); */?>
347
  </label>
348
- <p class="sub-label"><?php /*echo esc_html( $options_available['switcher_editor']['description'] ); */?></p>
349
  </th>
350
  <td class="forminp forminp-text">
351
- <a class="btn btn-soft"
352
- href="https://dashboard.weglot.com/settings/language-switcher/editor?url=<?php /*echo esc_url( get_home_url() ); */?>" target="_blank"><span
353
- class="dashicons dashicons-admin-generic"></span> <?php /*esc_html_e( 'Use switcher editor', 'weglot' ); */?>
 
354
  </a>
355
  </td>
356
- </tr>-->
357
  </table>
358
 
359
  <template id="li-button-tpl">
3
  if ( ! defined( 'ABSPATH' ) ) {
4
  exit;
5
  }
6
+
7
  use WeglotWP\Helpers\Helper_Tabs_Admin_Weglot;
8
  use WeglotWP\Helpers\Helper_Flag_Type;
9
 
10
  $options_available = [
11
+ 'type_flags' => [
12
  'key' => 'type_flags',
13
  'label' => __( 'Type of flags', 'weglot' ),
14
  'description' => '',
15
  ],
16
+ 'is_fullname' => [
17
  'key' => 'is_fullname',
18
  'label' => __( 'Is fullname', 'weglot' ),
19
  'description' => __( "Check if you want the name of the language. Don't check if you want the language code.", 'weglot' ),
20
  ],
21
+ 'with_name' => [
22
  'key' => 'with_name',
23
  'label' => __( 'With name', 'weglot' ),
24
  'description' => __( 'Check if you want to display the name of languages.', 'weglot' ),
25
  ],
26
+ 'is_dropdown' => [
27
  'key' => 'is_dropdown',
28
  'label' => __( 'Is dropdown', 'weglot' ),
29
  'description' => __( 'Check if you want the button to be a dropdown box.', 'weglot' ),
30
  ],
31
+ 'with_flags' => [
32
  'key' => 'with_flags',
33
  'label' => __( 'With flags', 'weglot' ),
34
  'description' => __( 'Check if you want flags in the language button.', 'weglot' ),
35
  ],
36
+ 'override_css' => [
37
  'key' => 'override_css',
38
  'label' => __( 'Override CSS', 'weglot' ),
39
  'description' => __( "Don't change it unless you want a specific style for your button.", 'weglot' ),
40
  ],
41
+ 'flag_css' => [
42
+ 'key' => 'flag_css',
43
  ],
44
+ 'switcher_editor' => [
45
  'key' => 'switcher_editor',
46
  'label' => __( 'Custom position?', 'weglot' ),
47
  'description' => __( 'You can place the button anywhere in your site using our switcher editor in your Weglot Dashboard', 'weglot' ),
52
  <style id="weglot-css-flag-css"></style>
53
  <style id="weglot-css-inline"></style>
54
  <?php if ( empty( $this->option_services->get_switchers_editor_button() ) ) { ?>
55
+ <h3>
56
+ <?php echo esc_html__( 'Language button design', 'weglot' ) . ' ' . esc_html__( '(Optional)', 'weglot' ); ?>
57
+ </h3>
58
+ <hr/>
59
 
60
+ <table class="form-table">
61
+ <tbody>
62
  <tr valign="top">
63
  <th scope="row" class="titledesc">
64
  <label>
65
+ <?php echo esc_html__( 'Button preview', 'weglot' ); ?>
66
  </label>
67
  </th>
68
  <td class="forminp forminp-text">
143
  </option>
144
  </select>
145
  <div class="flag-style-openclose"><?php esc_html_e( 'Change country flags', 'weglot' ); ?></div>
146
+ <p id="custom_flag_tips">You are still using old flags. To use new SVG flags, make sure you are using
147
+ the default flags (if you have some custom CSS related to background-position or background-image,
148
+ remove it). Then save your settings and you will be using the flags</p>
149
  <div class="flag-style-wrapper" style="display:none;">
150
  <select class="flag-en-type wg-input-select">
151
  <option value=0><?php esc_html_e( 'Choose English flag:', 'weglot' ); ?></option>
225
  </select>
226
  <p><?php esc_html_e( 'If you want to use a different flag, just ask us.', 'weglot' ); ?></p>
227
  </div>
228
+ <textarea id="flag_css"
229
+ name="<?php echo esc_attr( sprintf( '%s[%s]', WEGLOT_SLUG, $options_available['flag_css']['key'] ) ); ?>"
230
+ style="display:none;"><?php echo esc_attr( $this->options['flag_css'] ); ?></textarea>
231
  </td>
232
  </tr>
233
  <tr valign="top">
254
  </th>
255
  <td class="forminp forminp-text">
256
  <input
257
+ name="<?php echo esc_attr( sprintf( '%s[custom_settings][button_style][full_name]', WEGLOT_SLUG ) ); ?>"
258
+ id="<?php echo esc_attr( $options_available['is_fullname']['key'] ); ?>"
259
+ type="checkbox"
260
  <?php checked( $this->options[ $options_available['is_fullname']['key'] ], 1 ); ?>
261
  >
262
  <p class="description"><?php echo esc_html( $options_available['is_fullname']['description'] ); ?></p>
267
  <label for="<?php echo esc_attr( $options_available['override_css']['key'] ); ?>">
268
  <?php echo esc_html( $options_available['override_css']['label'] ); ?>
269
  </label>
270
+ <p class="sub-label"><?php echo esc_html( $options_available['override_css']['description'] ); ?></p>
271
+ </td>
272
  </th>
273
  <td class="forminp forminp-text">
274
  <textarea
277
  type="text"
278
  rows="10"
279
  cols="30"
280
+ name="<?php echo esc_attr( sprintf( '%s[custom_settings][button_style][custom_css]', WEGLOT_SLUG ) ); ?>"
281
+ placeholder=".country-selector {
282
  margin-bottom: 20px;
283
  }"><?php echo $this->options[ $options_available['override_css']['key'] ]; //phpcs:ignore?></textarea>
284
  </tr>
285
+ </tbody>
286
+ </table>
287
  <?php } ?>
288
 
289
  <h3>
290
  <?php echo esc_html_e( 'Language button position', 'weglot' ) . ' ' . esc_html__( '(Optional)', 'weglot' ); ?>
291
  </h3>
292
+ <hr/>
293
 
294
  <p><?php esc_html_e( 'Where will the language button be on my website? By default, bottom right.', 'weglot' ); ?></p>
295
 
309
  checked
310
  style="display:inline-block;"
311
  >
312
+ <div class="notice notice-error is-dismissible"
313
+ style="display: inline-block; position: relative; width: 80%; vertical-align: middle;">
314
  <p>
315
  <?php
316
+ // translators: 1 HTML Tag, 2 HTML Tag
317
+ echo esc_html__( 'Warning, this feature will be depreciated. We strongly advise you to uncheck the option and use and use the functionality: "In menu".', 'weglot' );
318
  ?>
319
  </p>
320
  </div>
325
  <tr valign="top">
326
  <th scope="row"><?php esc_html_e( 'In menu?', 'weglot' ); ?></th>
327
  <td>
328
+ <?php echo sprintf( esc_html__( 'You can place the button in a menu area. Go to %1$sAppearance → Menus%2$s and drag and drop the Weglot Translate Custom link where you want.', 'weglot' ), '<a href="' . esc_url( admin_url( 'nav-menus.php' ) ) . '">', '</a>' ); ?>
329
  </td>
330
  </tr>
331
  <tr valign="top">
332
  <th scope="row"><?php esc_html_e( 'As a widget?', 'weglot' ); ?></th>
333
  <td>
334
+ <?php echo sprintf( esc_html__( 'You can place the button in a widget area. Go to %1$sAppearance → Widgets%2$s and drag and drop the Weglot Translate widget where you want.', 'weglot' ), '<a href="' . esc_url( admin_url( 'widgets.php' ) ) . '">', '</a>' ); ?>
335
  </td>
336
  </tr>
337
  <tr valign="top">
347
  </td>
348
  </tr>
349
 
350
+ <tr valign="top">
351
  <th scope="row" class="titledesc">
352
+ <label for="<?php echo esc_attr( $options_available['switcher_editor']['key'] ); ?>">
353
+ <?php echo esc_html( $options_available['switcher_editor']['label'] ); ?>
354
  </label>
355
+ <p class="sub-label"><?php echo esc_html( $options_available['switcher_editor']['description'] ); ?></p>
356
  </th>
357
  <td class="forminp forminp-text">
358
+ <a class="btn btn-soft"
359
+ href="https://dashboard.weglot.com/settings/language-switcher/editor?url=<?php echo esc_url( get_home_url() ); ?>"
360
+ target="_blank"><span
361
+ class="dashicons dashicons-admin-generic"></span> <?php esc_html_e( 'Use switcher editor', 'weglot' ); ?>
362
  </a>
363
  </td>
364
+ </tr>
365
  </table>
366
 
367
  <template id="li-button-tpl">
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit9cb8848c7796a94553e817856362dcc6::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInita5571042c34750f8fd2a5843b13637e1::getLoader();
vendor/composer/InstalledVersions.php CHANGED
@@ -30,7 +30,7 @@ private static $installed = array (
30
  'aliases' =>
31
  array (
32
  ),
33
- 'reference' => 'e1a847c386e4423a9703db41f896109885744db7',
34
  'name' => 'weglot/translate-wordpress',
35
  ),
36
  'versions' =>
@@ -69,7 +69,7 @@ private static $installed = array (
69
  'aliases' =>
70
  array (
71
  ),
72
- 'reference' => 'e1a847c386e4423a9703db41f896109885744db7',
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.3.4',
86
- 'version' => '1.3.4.0',
87
  'aliases' =>
88
  array (
89
  ),
90
- 'reference' => '38d07fee3b3cf2d2bd3a64be5460ea255d57eabd',
91
  ),
92
  ),
93
  );
30
  'aliases' =>
31
  array (
32
  ),
33
+ 'reference' => 'eeee9b4854c69224fee5f8eccd73dd93fa86297a',
34
  'name' => 'weglot/translate-wordpress',
35
  ),
36
  'versions' =>
69
  'aliases' =>
70
  array (
71
  ),
72
+ 'reference' => 'eeee9b4854c69224fee5f8eccd73dd93fa86297a',
73
  ),
74
  'weglot/translation-definitions' =>
75
  array (
82
  ),
83
  'weglot/weglot-php' =>
84
  array (
85
+ 'pretty_version' => '1.5',
86
+ 'version' => '1.5.0.0',
87
  'aliases' =>
88
  array (
89
  ),
90
+ 'reference' => 'c23a262fcf2961f086217896f8fdc175996c3492',
91
  ),
92
  ),
93
  );
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit9cb8848c7796a94553e817856362dcc6
6
  {
7
  private static $loader;
8
 
@@ -24,15 +24,15 @@ class ComposerAutoloaderInit9cb8848c7796a94553e817856362dcc6
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
- spl_autoload_register(array('ComposerAutoloaderInit9cb8848c7796a94553e817856362dcc6', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
- spl_autoload_unregister(array('ComposerAutoloaderInit9cb8848c7796a94553e817856362dcc6', '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\ComposerStaticInit9cb8848c7796a94553e817856362dcc6::getInitializer($loader));
36
  } else {
37
  $map = require __DIR__ . '/autoload_namespaces.php';
38
  foreach ($map as $namespace => $path) {
@@ -53,19 +53,19 @@ class ComposerAutoloaderInit9cb8848c7796a94553e817856362dcc6
53
  $loader->register(true);
54
 
55
  if ($useStaticLoader) {
56
- $includeFiles = Composer\Autoload\ComposerStaticInit9cb8848c7796a94553e817856362dcc6::$files;
57
  } else {
58
  $includeFiles = require __DIR__ . '/autoload_files.php';
59
  }
60
  foreach ($includeFiles as $fileIdentifier => $file) {
61
- composerRequire9cb8848c7796a94553e817856362dcc6($fileIdentifier, $file);
62
  }
63
 
64
  return $loader;
65
  }
66
  }
67
 
68
- function composerRequire9cb8848c7796a94553e817856362dcc6($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 ComposerAutoloaderInita5571042c34750f8fd2a5843b13637e1
6
  {
7
  private static $loader;
8
 
24
 
25
  require __DIR__ . '/platform_check.php';
26
 
27
+ spl_autoload_register(array('ComposerAutoloaderInita5571042c34750f8fd2a5843b13637e1', 'loadClassLoader'), true, true);
28
  self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
29
+ spl_autoload_unregister(array('ComposerAutoloaderInita5571042c34750f8fd2a5843b13637e1', '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\ComposerStaticInita5571042c34750f8fd2a5843b13637e1::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\ComposerStaticInita5571042c34750f8fd2a5843b13637e1::$files;
57
  } else {
58
  $includeFiles = require __DIR__ . '/autoload_files.php';
59
  }
60
  foreach ($includeFiles as $fileIdentifier => $file) {
61
+ composerRequirea5571042c34750f8fd2a5843b13637e1($fileIdentifier, $file);
62
  }
63
 
64
  return $loader;
65
  }
66
  }
67
 
68
+ function composerRequirea5571042c34750f8fd2a5843b13637e1($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 ComposerStaticInit9cb8848c7796a94553e817856362dcc6
8
  {
9
  public static $files = array (
10
  '6c200413eed8aeea54dbaf934a31b127' => __DIR__ . '/..' . '/weglot/simplehtmldom/src/simple_html_dom.php',
@@ -66,10 +66,10 @@ class ComposerStaticInit9cb8848c7796a94553e817856362dcc6
66
  public static function getInitializer(ClassLoader $loader)
67
  {
68
  return \Closure::bind(function () use ($loader) {
69
- $loader->prefixLengthsPsr4 = ComposerStaticInit9cb8848c7796a94553e817856362dcc6::$prefixLengthsPsr4;
70
- $loader->prefixDirsPsr4 = ComposerStaticInit9cb8848c7796a94553e817856362dcc6::$prefixDirsPsr4;
71
- $loader->prefixesPsr0 = ComposerStaticInit9cb8848c7796a94553e817856362dcc6::$prefixesPsr0;
72
- $loader->classMap = ComposerStaticInit9cb8848c7796a94553e817856362dcc6::$classMap;
73
 
74
  }, null, ClassLoader::class);
75
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInita5571042c34750f8fd2a5843b13637e1
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 = ComposerStaticInita5571042c34750f8fd2a5843b13637e1::$prefixLengthsPsr4;
70
+ $loader->prefixDirsPsr4 = ComposerStaticInita5571042c34750f8fd2a5843b13637e1::$prefixDirsPsr4;
71
+ $loader->prefixesPsr0 = ComposerStaticInita5571042c34750f8fd2a5843b13637e1::$prefixesPsr0;
72
+ $loader->classMap = ComposerStaticInita5571042c34750f8fd2a5843b13637e1::$classMap;
73
 
74
  }, null, ClassLoader::class);
75
  }
vendor/composer/installed.json CHANGED
@@ -189,17 +189,17 @@
189
  },
190
  {
191
  "name": "weglot/weglot-php",
192
- "version": "1.3.4",
193
- "version_normalized": "1.3.4.0",
194
  "source": {
195
  "type": "git",
196
  "url": "git@github.com:weglot/weglot-php.git",
197
- "reference": "38d07fee3b3cf2d2bd3a64be5460ea255d57eabd"
198
  },
199
  "dist": {
200
  "type": "zip",
201
- "url": "https://api.github.com/repos/weglot/weglot-php/zipball/38d07fee3b3cf2d2bd3a64be5460ea255d57eabd",
202
- "reference": "38d07fee3b3cf2d2bd3a64be5460ea255d57eabd",
203
  "shasum": ""
204
  },
205
  "require": {
@@ -212,7 +212,7 @@
212
  "codeception/codeception": "^2.4",
213
  "vlucas/phpdotenv": "^2.4"
214
  },
215
- "time": "2022-02-23T15:23:24+00:00",
216
  "type": "library",
217
  "installation-source": "dist",
218
  "autoload": {
189
  },
190
  {
191
  "name": "weglot/weglot-php",
192
+ "version": "1.5",
193
+ "version_normalized": "1.5.0.0",
194
  "source": {
195
  "type": "git",
196
  "url": "git@github.com:weglot/weglot-php.git",
197
+ "reference": "c23a262fcf2961f086217896f8fdc175996c3492"
198
  },
199
  "dist": {
200
  "type": "zip",
201
+ "url": "https://api.github.com/repos/weglot/weglot-php/zipball/c23a262fcf2961f086217896f8fdc175996c3492",
202
+ "reference": "c23a262fcf2961f086217896f8fdc175996c3492",
203
  "shasum": ""
204
  },
205
  "require": {
212
  "codeception/codeception": "^2.4",
213
  "vlucas/phpdotenv": "^2.4"
214
  },
215
+ "time": "2022-05-18T09:34:55+00:00",
216
  "type": "library",
217
  "installation-source": "dist",
218
  "autoload": {
vendor/composer/installed.php CHANGED
@@ -6,7 +6,7 @@
6
  'aliases' =>
7
  array (
8
  ),
9
- 'reference' => 'e1a847c386e4423a9703db41f896109885744db7',
10
  'name' => 'weglot/translate-wordpress',
11
  ),
12
  'versions' =>
@@ -45,7 +45,7 @@
45
  'aliases' =>
46
  array (
47
  ),
48
- 'reference' => 'e1a847c386e4423a9703db41f896109885744db7',
49
  ),
50
  'weglot/translation-definitions' =>
51
  array (
@@ -58,12 +58,12 @@
58
  ),
59
  'weglot/weglot-php' =>
60
  array (
61
- 'pretty_version' => '1.3.4',
62
- 'version' => '1.3.4.0',
63
  'aliases' =>
64
  array (
65
  ),
66
- 'reference' => '38d07fee3b3cf2d2bd3a64be5460ea255d57eabd',
67
  ),
68
  ),
69
  );
6
  'aliases' =>
7
  array (
8
  ),
9
+ 'reference' => 'eeee9b4854c69224fee5f8eccd73dd93fa86297a',
10
  'name' => 'weglot/translate-wordpress',
11
  ),
12
  'versions' =>
45
  'aliases' =>
46
  array (
47
  ),
48
+ 'reference' => 'eeee9b4854c69224fee5f8eccd73dd93fa86297a',
49
  ),
50
  'weglot/translation-definitions' =>
51
  array (
58
  ),
59
  'weglot/weglot-php' =>
60
  array (
61
+ 'pretty_version' => '1.5',
62
+ 'version' => '1.5.0.0',
63
  'aliases' =>
64
  array (
65
  ),
66
+ 'reference' => 'c23a262fcf2961f086217896f8fdc175996c3492',
67
  ),
68
  ),
69
  );
vendor/weglot/weglot-php/src/Parser/Formatter/CustomSwitchersFormatter.php CHANGED
@@ -5,8 +5,7 @@ namespace Weglot\Parser\Formatter;
5
  use WGSimpleHtmlDom\simple_html_dom;
6
  use Weglot\Parser\Parser;
7
 
8
- class CustomSwitchersFormatter
9
- {
10
  /**
11
  * @var simple_html_dom
12
  */
@@ -19,22 +18,22 @@ class CustomSwitchersFormatter
19
 
20
  /**
21
  * CustomSwitchersFormatter constructor.
 
22
  * @param $dom
23
  */
24
- public function __construct($dom, $customSwitchers)
25
- {
26
  $this
27
- ->setDom($dom)
28
- ->setCustomSwitchers($customSwitchers);
29
- $this->handle($this->dom, $customSwitchers);
30
  }
31
 
32
  /**
33
  * @param simple_html_dom $dom
 
34
  * @return $this
35
  */
36
- public function setDom(simple_html_dom $dom)
37
- {
38
  $this->dom = $dom;
39
 
40
  return $this;
@@ -43,17 +42,16 @@ class CustomSwitchersFormatter
43
  /**
44
  * @return simple_html_dom
45
  */
46
- public function getDom()
47
- {
48
  return $this->dom;
49
  }
50
 
51
  /**
52
  * @param array $customSwitchers
 
53
  * @return $this
54
  */
55
- public function setCustomSwitchers(array $customSwitchers)
56
- {
57
  $this->customSwitchers = $customSwitchers;
58
 
59
  return $this;
@@ -62,8 +60,7 @@ class CustomSwitchersFormatter
62
  /**
63
  * @return array
64
  */
65
- public function getCustomSwitchers()
66
- {
67
  return $this->customSwitchers;
68
  }
69
 
@@ -73,29 +70,51 @@ class CustomSwitchersFormatter
73
  *
74
  * @return simple_html_dom
75
  */
76
- public function handle($dom, $switchers)
77
- {
78
- foreach ($switchers as $switcher) {
79
 
80
  $location = $switcher['location'];
81
  if ( ! empty( $location ) ) {
 
82
  if ( $dom->find( $location['target'] ) && is_array( $dom->find( $location['target'] ) ) ) {
83
  foreach ( $dom->find( $location['target'] ) as $target ) {
 
84
  if ( empty( $location['sibling'] ) ) {
85
- $target->innertext .= '<div data-wg-position="'.$location['target'].'"></div>';
86
  } else {
87
- if ( $target->find( $location['sibling'] ) ) {
88
- foreach ( $target->find( $location['sibling'], 0 ) as $sibling ) {
 
 
 
 
 
 
 
 
89
  if ( is_object( $sibling ) ) {
90
- $sibling->innertext = '<div data-wg-position="'.$location['target'].' '.$location['sibling'].'"></div>' . $sibling->innertext;
91
  }
92
  }
93
  }
94
  }
95
  }
 
 
 
 
 
 
 
 
 
 
 
 
96
  }
97
  }
98
  }
 
99
  return $dom;
100
  }
101
  }
5
  use WGSimpleHtmlDom\simple_html_dom;
6
  use Weglot\Parser\Parser;
7
 
8
+ class CustomSwitchersFormatter {
 
9
  /**
10
  * @var simple_html_dom
11
  */
18
 
19
  /**
20
  * CustomSwitchersFormatter constructor.
21
+ *
22
  * @param $dom
23
  */
24
+ public function __construct( $dom, $customSwitchers ) {
 
25
  $this
26
+ ->setDom( $dom )
27
+ ->setCustomSwitchers( $customSwitchers );
28
+ $this->handle( $this->dom, $customSwitchers );
29
  }
30
 
31
  /**
32
  * @param simple_html_dom $dom
33
+ *
34
  * @return $this
35
  */
36
+ public function setDom( simple_html_dom $dom ) {
 
37
  $this->dom = $dom;
38
 
39
  return $this;
42
  /**
43
  * @return simple_html_dom
44
  */
45
+ public function getDom() {
 
46
  return $this->dom;
47
  }
48
 
49
  /**
50
  * @param array $customSwitchers
51
+ *
52
  * @return $this
53
  */
54
+ public function setCustomSwitchers( array $customSwitchers ) {
 
55
  $this->customSwitchers = $customSwitchers;
56
 
57
  return $this;
60
  /**
61
  * @return array
62
  */
63
+ public function getCustomSwitchers() {
 
64
  return $this->customSwitchers;
65
  }
66
 
70
  *
71
  * @return simple_html_dom
72
  */
73
+ public function handle( $dom, $switchers ) {
74
+ foreach ( $switchers as $switcher ) {
 
75
 
76
  $location = $switcher['location'];
77
  if ( ! empty( $location ) ) {
78
+ //we check if we find the target location
79
  if ( $dom->find( $location['target'] ) && is_array( $dom->find( $location['target'] ) ) ) {
80
  foreach ( $dom->find( $location['target'] ) as $target ) {
81
+ //for each target we check if we have an associate sibling or we put the switcher into him
82
  if ( empty( $location['sibling'] ) ) {
83
+ $target->innertext .= '<div data-wg-position="' . $location['target'] . '"></div>';
84
  } else {
85
+ // we try to find the sibling
86
+ if ( $dom->find( $location['target'] . ' ' . $location['sibling'] ) ) {
87
+ // we check if the sibling is a parent of the target location and we put the switche before
88
+ foreach ( $dom->find( $location['target'] . ' ' . $location['sibling'] ) as $sibling ) {
89
+ if ( is_object( $sibling ) ) {
90
+ $sibling->outertext = '<div data-wg-position="' . $location['target'] . ' ' . $location['sibling'] . '"></div>' . $sibling->outertext;
91
+ }
92
+ }
93
+ } else {
94
+ foreach ( $dom->find( $location['sibling'], 0 ) as $sibling ) {
95
  if ( is_object( $sibling ) ) {
96
+ $sibling->outertext = '<div data-wg-position="' . $location['target'] . ' ' . $location['sibling'] . '"></div>' . $sibling->outertext;
97
  }
98
  }
99
  }
100
  }
101
  }
102
+ } else {
103
+ if ( $dom->find( 'body' ) && is_array( $dom->find( 'body' ) ) ) {
104
+ foreach ( $dom->find( 'body' ) as $body ) {
105
+ $body->last_child()->innertext .= $body->last_child() . '<div data-wg-position="' . $location['target'] . ' ' . $location['sibling'] . '" data-wg-ajax="true"></div>';
106
+ }
107
+ }
108
+ }
109
+ } else {
110
+ if ( $dom->find( 'body' ) && is_array( $dom->find( 'body' ) ) ) {
111
+ foreach ( $dom->find( 'body' ) as $body ) {
112
+ $body->last_child()->innertext .= $body->last_child() . '<div data-wg-position=""></div>';
113
+ }
114
  }
115
  }
116
  }
117
+
118
  return $dom;
119
  }
120
  }
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.6.1
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.6.1' );
26
  define( 'WEGLOT_PHP_MIN', '5.6' );
27
  define( 'WEGLOT_BNAME', plugin_basename( __FILE__ ) );
28
  define( 'WEGLOT_DIR', __DIR__ );
@@ -67,7 +67,6 @@ if ( file_exists( $dir_yoast_premium . '/wp-seo-premium.php' ) ) {
67
  require_once __DIR__ . '/vendor/autoload.php';
68
  require_once __DIR__ . '/bootstrap.php';
69
  require_once __DIR__ . '/weglot-functions.php';
70
-
71
  include_once __DIR__ . '/src/third/yoast/redirect-premium.php';
72
  }
73
  }
7
  Author URI: https://weglot.com/
8
  Text Domain: weglot
9
  Domain Path: /languages/
10
+ Version: 3.7
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.7' );
26
  define( 'WEGLOT_PHP_MIN', '5.6' );
27
  define( 'WEGLOT_BNAME', plugin_basename( __FILE__ ) );
28
  define( 'WEGLOT_DIR', __DIR__ );
67
  require_once __DIR__ . '/vendor/autoload.php';
68
  require_once __DIR__ . '/bootstrap.php';
69
  require_once __DIR__ . '/weglot-functions.php';
 
70
  include_once __DIR__ . '/src/third/yoast/redirect-premium.php';
71
  }
72
  }