Title: Widget code
Last modified: May 9, 2023

---

# Widget code

 *  Resolved [weberbg](https://wordpress.org/support/users/weberbg/)
 * (@weberbg)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/widget-code-10/)
 * Hello, some time ago your colleagues gave me a code to put in the widgets of 
   the site. Until now it was translated from Bulgarian to other languages, but 
   now I turned it all into English and I want it to be translated from English 
   to other languages. I changed the settings in the plugin, but this code I’m talking
   about must be different. Because I see that you have changed a part in the plugin
   that generated code, I am writing to you if you can help me. Now I can only add
   css there.
 * This was the code, your colleagues gave me:
 *     ```wp-block-code
       <!-- GTranslate: https://gtranslate.io/ --><a href="#" class="switcher-popup glink nturl notranslate" onclick="openGTPopup(this)"><img src="//weberbg.com/wp-content/plugins/gtranslate/flags/24/bg.png" height="24" width="24" alt="bg" /> <span>Български</span><span style="color:#666;font-size:8px;font-weight:bold;padding:4px;"></span></a><div id="gt_fade" class="gt_black_overlay"></div><div id="gt_lightbox" class="gt_white_content notranslate"><div style="position:relative;height:14px;"><span onclick="closeGTPopup()" style="position:absolute;right:-5px;top:-5px;font-weight:bold;font-size:12px;cursor:pointer;color:#444;font-family:cursive;">X</span></div><div class="gt_languages"><a href="#" onclick="changeGTLanguage('bg|bg', this);return false;" title="Български" class="glink nturl selected"><img data-gt-lazy-src="//weberbg.com/wp-content/plugins/gtranslate/flags/24/bg.png" height="24" width="24" alt="bg" /> <span style="color:#06679a;">Български (Главен)</span></a><a href="#" onclick="changeGTLanguage('bg|en', this);return false;" title="English" class="glink nturl"><img data-gt-lazy-src="//weberbg.com/wp-content/plugins/gtranslate/flags/24/en.png" height="24" width="24" alt="en" /> <span style="color:#06679a;">English</span></a><a href="#" onclick="changeGTLanguage('bg|it', this);return false;" title="Italiano" class="glink nturl"><img data-gt-lazy-src="//weberbg.com/wp-content/plugins/gtranslate/flags/24/it.png" height="24" width="24" alt="it" /> <span style="color:#06679a;">Italiano</span></a><a href="#" onclick="changeGTLanguage('bg|ru', this);return false;" title="Русский" class="glink nturl"><img data-gt-lazy-src="//weberbg.com/wp-content/plugins/gtranslate/flags/24/ru.png" height="24" width="24" alt="ru" /> <span style="color:#06679a;">Русский</span></a><a href="#" onclick="changeGTLanguage('bg|es', this);return false;" title="Español" class="glink nturl"><img data-gt-lazy-src="//weberbg.com/wp-content/plugins/gtranslate/flags/24/es.png" height="24" width="24" alt="es" /> <span style="color:#06679a;">Español</span></a></div></div><style>.gt_black_overlay {display:none;position:fixed;top:0%;left:0%;width:100%;height:100%;background-color:black;z-index:2017;-moz-opacity:0.8;opacity:.80;filter:alpha(opacity=80);}.gt_white_content {display:none;position:fixed;top:50%;left:50%;width:341px;height:230px;margin:-100px 0 0 -170.5px;padding:6px 16px;border-radius:5px;background-color:white;color:black;z-index:19881205;overflow:auto;text-align:left;}.gt_white_content a {display:block;padding:5px 0;border-bottom:1px solid #e7e7e7;white-space:nowrap;}.gt_white_content a:last-of-type {border-bottom:none;}.gt_white_content a.selected {background-color: #8fe5ff;border-radius: 25px;padding: 5px;}.gt_white_content .gt_languages {column-count:1;column-gap:10px;}.gt_white_content::-webkit-scrollbar-track{-webkit-box-shadow:inset 0 0 3px rgba(0,0,0,0.3);border-radius:5px;background-color:#F5F5F5;}.gt_white_content::-webkit-scrollbar {width:5px;}.gt_white_content::-webkit-scrollbar-thumb {border-radius:5px;-webkit-box-shadow: inset 0 0 3px rgba(0,0,0,.3);background-color:#888;}</style>
   
       <script>function openGTPopup(a) {jQuery('.gt_white_content a img').each(function() {if(!jQuery(this)[0].hasAttribute('src'))jQuery(this).attr('src', jQuery(this).attr('data-gt-lazy-src'))});if(a === undefined){document.getElementById('gt_lightbox').style.display='block';document.getElementById('gt_fade').style.display='block';}else{jQuery(a).parent().find('#gt_lightbox').css('display', 'block');jQuery(a).parent().find('#gt_fade').css('display', 'block');}}function closeGTPopup() {jQuery('.gt_white_content').css('display', 'none');jQuery('.gt_black_overlay').css('display', 'none');}function changeGTLanguage(pair, a) {doGTranslate(pair);jQuery('a.switcher-popup').html(jQuery(a).html()+'<span style="color:#666;font-size:8px;font-weight:bold;"></span>');closeGTPopup();}jQuery('.gt_black_overlay').click(function(e) {if(jQuery('.gt_white_content').is(':visible')) {closeGTPopup()}});</script><style>#goog-gt-tt {display:none !important;}.goog-te-banner-frame {display:none !important;}.goog-te-menu-value:hover {text-decoration:none !important;}.goog-text-highlight {background-color:transparent !important;box-shadow:none !important;}body {top:0 !important;}#google_translate_element2 {display:none!important;}</style>
   
       <div id="google_translate_element2"></div><script>function googleTranslateElementInit2() {new google.translate.TranslateElement({pageLanguage: 'bg',autoDisplay: false}, 'google_translate_element2');}</script><script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit2"></script>
   
       <script>function GTranslateGetCurrentLang() {var keyValue = document['cookie'].match('(^|;) ?googtrans=([^;]*)(;|$)');return keyValue ? keyValue[2].split('/')[2] : null;}function GTranslateFireEvent(element,event){try{if(document.createEventObject){var evt=document.createEventObject();element.fireEvent('on'+event,evt)}else{var evt=document.createEvent('HTMLEvents');evt.initEvent(event,true,true);element.dispatchEvent(evt)}}catch(e){}}function doGTranslate(lang_pair){if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];if(GTranslateGetCurrentLang() == null && lang == lang_pair.split('|')[0])return;if(typeof ga!='undefined'){ga('send', 'event', 'GTranslate', lang, location.hostname+location.pathname+location.search);}else{if(typeof _gaq!='undefined')_gaq.push(['_trackEvent', 'GTranslate', lang, location.hostname+location.pathname+location.search]);}var teCombo;var sel=document.getElementsByTagName('select');for(var i=0;i<sel.length;i++)if(sel[i].className.indexOf('goog-te-combo')!=-1){teCombo=sel[i];break;}if(document.getElementById('google_translate_element2')==null||document.getElementById('google_translate_element2').innerHTML.length==0||teCombo.length==0||teCombo.innerHTML.length==0){setTimeout(function(){doGTranslate(lang_pair)},500)}else{teCombo.value=lang;GTranslateFireEvent(teCombo,'change');GTranslateFireEvent(teCombo,'change')}}if(GTranslateGetCurrentLang() != null)jQuery(document).ready(function() {var lang_html = jQuery(".gt_languages a[onclick*='|"+GTranslateGetCurrentLang()+"']").html();if(typeof lang_html != "undefined")jQuery('a.switcher-popup').html(lang_html.replace("data-gt-lazy-", "")+'<span style="color:#666;font-size:8px;font-weight:bold;"></span>');});</script>
       ```
   
 * ![](https://i0.wp.com/downloads.intercomcdn.com/i/o/738100178/6e9570dfe7b83cfc430c7b52/
   Screenshot%2B2023-05-09%2Bat%2B19.44.59.png?ssl=1)
 * These are the settings I am using right now 
 * ![](https://i0.wp.com/downloads.intercomcdn.com/i/o/738100892/2fa9745ef9a310f362921e5e/
   Screenshot%2B2023-05-09%2Bat%2B19.45.31.png?ssl=1)
 * And still you can see its translating from Bulgarian, I want to Translate from
   English.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fwidget-code-10%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  Plugin Author [edo888](https://wordpress.org/support/users/edo888/)
 * (@edo888)
 * [2 years, 11 months ago](https://wordpress.org/support/topic/widget-code-10/#post-16726574)
 * Hi,
 * We do not support old plugin anymore. I recommend you to use the newest version.
 * If you want to stick to the old code you can try to change bg| to en|, I’m not
   sure if that will be enough.
 * Thanks! 🙂
    -  This reply was modified 2 years, 11 months ago by [edo888](https://wordpress.org/support/users/edo888/).

Viewing 1 replies (of 1 total)

The topic ‘Widget code’ is closed to new replies.

 * ![](https://ps.w.org/gtranslate/assets/icon-256x256.png?rev=2595917)
 * [Translate Wordpress with GTranslate](https://wordpress.org/plugins/gtranslate/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gtranslate/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gtranslate/)
 * [Active Topics](https://wordpress.org/support/plugin/gtranslate/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gtranslate/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gtranslate/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [edo888](https://wordpress.org/support/users/edo888/)
 * Last activity: [2 years, 11 months ago](https://wordpress.org/support/topic/widget-code-10/#post-16726574)
 * Status: resolved