Title: Change Code on Different Languages
Last modified: October 16, 2022

---

# Change Code on Different Languages

 *  Resolved [furkanozkaya](https://wordpress.org/support/users/furkanozkaya/)
 * (@furkanozkaya)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/change-code-on-different-languages/)
 * I’m trying to show different codes for different languages on the gtranslate 
   WordPress plugin.
 * Here is what I’m trying to do:
 *     ```
       <figure>
                                       <?php
                                       $current_lang_code = $_SERVER['HTTP_X_GT_LANG'];
                                       if ($current_lang_code === 'ru') { ?>
                                       <img class="img-fit" src="https://www.mgc.com.tr/wp-content/uploads/2022/10/mgc-slider-rusca-v1-sks.jpg" alt="İstanbul Hukuk Bürosu">
                                       <?php } else if ($current_lang_code === 'ar') { ?>
                                       <img class="img-fit" src="https://www.mgc.com.tr/wp-content/uploads/2022/10/mgc-slider-arapca-v1-sks.jpg" alt="İstanbul Hukuk Bürosu">
                                       <?php } else { echo do_shortcode('[metaslider id="6449"]'); } ?>
                                   </figure>
       ```
   
 * So the idea is that I’m going to show my slider on my Turkish original website
   and show the other two images on the translated versions, which are automatically
   translated by gtranslate plugin. It seems to work but sometimes it gets cached
   or shows the wrong image (for example, Russian image when you are on the Arabic
   page, etc.). How can I make this work properly?
 * I don’t have any active cache plugin right now, but I will activate in the future
   of course.
 * Thank you, regards.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fchange-code-on-different-languages%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)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/change-code-on-different-languages/#post-16107947)
 * Hi,
 * You better use javascript for the logic, otherwise you must turn off caching.
 * Please direct support topics about the paid version to our live chat: [https://gtranslate.io/#contact](https://gtranslate.io/#contact)
 * Thanks! 🙂

Viewing 1 replies (of 1 total)

The topic ‘Change Code on Different Languages’ 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/)

## Tags

 * [code](https://wordpress.org/support/topic-tag/code/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 2 replies
 * 2 participants
 * Last reply from: [edo888](https://wordpress.org/support/users/edo888/)
 * Last activity: [3 years, 7 months ago](https://wordpress.org/support/topic/change-code-on-different-languages/#post-16107947)
 * Status: resolved