const localeKey = window.location.pathname.split("/")?.[1]; if (localeKey == "en") { window.fcSettings = { token: "26938a9a-6b8e-46f3-9682-43e764b23a08", host: "https://wchat.eu.freshchat.com", tags: ['silknet'], locale: "en", config: { cssNames: { //The below element is mandatory. Please add any custom class or leave the default. widget: 'custom_fc_frame', //The below element is mandatory. Please add any custom class or leave the default. expanded: 'custom_fc_expanded' }, content: { placeholders: { search_field: 'Search', reply_field: 'Reply', csat_reply: 'Add here' }, actions: { csat_yes:'Positive', csat_no: 'Negative', push_notify_yes: 'yes', push_notify_no: 'no', csat_submit: 'submit' }, headers: { chat: 'Write us', csat_question: 'Please rate the quality of the service provided:', push_notification: 'Dont miss a reply, activate push notifications', } } }, onInit: function() { console.log('widget init'); fcPreChatform.fcWidgetInit(preChatTemplate); window.fcWidget.on("widget:closed", function() { var sc_ans = confirm("Finish chat?"); if (sc_ans == true) { window.fcWidget.user.clear().then(function() { console.log('User cleared'); }, function() { console.log("User Not cleared"); }); } }); window.fcWidget.on("widget:opened", function() { const evt = new Event("changeLabels"); document.dispatchEvent(evt); }); } }; } else { window.fcSettings = { token: "26938a9a-6b8e-46f3-9682-43e764b23a08", host: "https://wchat.eu.freshchat.com", tags: ['silknet'], locale: "de", config: { cssNames: { //The below element is mandatory. Please add any custom class or leave the default. widget: 'custom_fc_frame', //The below element is mandatory. Please add any custom class or leave the default. expanded: 'custom_fc_expanded' }, content: { placeholders: { search_field: 'Search', reply_field: 'Reply', csat_reply: 'დატოვე გამოხმაურება' }, actions: { csat_yes: 'დადებითი', csat_no: 'უარყოფითი', push_notify_yes: 'დიახ', push_notify_no: 'არა იყოს', csat_submit: 'დადასტურება' }, headers: { chat: 'მოგვწერე', csat_question: 'გთხოვთ, შეაფასოთ გაწეული მომსახურების ხარისხი:', push_notification: 'არ გამოტოვო პასუხი, გააქტიურე სწრაფი შეტყობინებები', } } }, onInit: function() { console.log('widget init'); fcPreChatform.fcWidgetInit(preChatTemplate); window.fcWidget.on("widget:closed", function() { var sc_ans = confirm("Finish chat?"); if (sc_ans == true) { window.fcWidget.user.clear().then(function() { console.log('User cleared'); }, function() { console.log("User Not cleared"); }); } }); window.fcWidget.on("widget:opened", function() { const evt = new Event("changeLabels"); document.dispatchEvent(evt); }); } }; } -->