Title: rockfaceit's Replies | WordPress.org

---

# rockfaceit

  [  ](https://wordpress.org/support/users/rockfaceit/)

 *   [Profile](https://wordpress.org/support/users/rockfaceit/)
 *   [Topics Started](https://wordpress.org/support/users/rockfaceit/topics/)
 *   [Replies Created](https://wordpress.org/support/users/rockfaceit/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/rockfaceit/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/rockfaceit/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/rockfaceit/engagements/)
 *   [Favorites](https://wordpress.org/support/users/rockfaceit/favorites/)

 Search replies:

## Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Translate Wordpress with GTranslate] Change Dropdown](https://wordpress.org/support/topic/change-dropdown/)
 *  Thread Starter [rockfaceit](https://wordpress.org/support/users/rockfaceit/)
 * (@rockfaceit)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/change-dropdown/#post-18410282)
 * Thanks! I got something nice working:
 * [https://staging.alanonventura.org](https://staging.alanonventura.org)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Translate Wordpress with GTranslate] Change Dropdown](https://wordpress.org/support/topic/change-dropdown/)
 *  Thread Starter [rockfaceit](https://wordpress.org/support/users/rockfaceit/)
 * (@rockfaceit)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/change-dropdown/#post-18408348)
 * URL: [https://staging.alanonventura.org/design-gallery](https://staging.alanonventura.org/design-gallery)
 * If current_language is blank I want to display a shortcode for the ‘Spanish’ 
   version. If current_language = ‘es’ I want to display a shortcode for ‘Inglés’
   to display the ‘English’ version. Thanks
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Translate Wordpress with GTranslate] Change Dropdown](https://wordpress.org/support/topic/change-dropdown/)
 *  Thread Starter [rockfaceit](https://wordpress.org/support/users/rockfaceit/)
 * (@rockfaceit)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/change-dropdown/#post-18408346)
 *     ```wp-block-code
       I have this code but it's not working because the current_language variable only updates upon page load and the gTranslate options do not reload the page<input type="button" id="YourButtonES" value="Español" /><input type="button" id="YourButtonEN" value="Inglés" /> <script>buttonES = document.getElementById("YourButtonES");buttonEN = document.getElementById("YourButtonEN");buttonES.style.visibility = 'visible';buttonEN.style.visibility = 'hidden';var current_language = gt_get_cookie('googtrans').split('/').pop();console.log("current lang " + current_language);if (current_language === 'es') {    buttonES.style.visibility = 'hidden';    buttonEN.style.visibility = 'visible';} else {    buttonES.style.visibility = 'visible';    buttonEN.style.visibility = 'hidden';}//GTranslate codefunction gt_get_cookie(cname) {    var name = cname + "=";    var decodedCookie = decodeURIComponent(document.cookie);    var ca = decodedCookie.split(';');       for(var i = 0; i <ca.length; i++) {        var c = ca[i];        while (c.charAt(0) == ' ') {            c = c.substring(1);        }                if (c.indexOf(name) == 0) {            console.log(name.length);            return c.substring(name.length, c.length);        }    }    console.log('return');    return "";}</script>
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)