Title: Changing the language by script
Last modified: December 10, 2019

---

# Changing the language by script

 *  Resolved [boredtaiga](https://wordpress.org/support/users/boredtaiga/)
 * (@boredtaiga)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/changing-the-language-by-script/)
 * Hey!
 * I would need a way of changing the current site language in the script. Is it
   possible?
 * Thanks!
    -  This topic was modified 6 years, 6 months ago by [boredtaiga](https://wordpress.org/support/users/boredtaiga/).

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

 *  Thread Starter [boredtaiga](https://wordpress.org/support/users/boredtaiga/)
 * (@boredtaiga)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/changing-the-language-by-script/#post-12227602)
 * I am still looking for an answer, sadly it would be an essential part in fixing
   a problem on my website with the plugin. Any info would be appreciated.
 *  [Dragos](https://wordpress.org/support/users/dragosvrejiu/)
 * (@dragosvrejiu)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/changing-the-language-by-script/#post-12230259)
 * Hello,
 * Can you please provide more details on what you are trying to achieve?
 * With the best wishes,
 *  Thread Starter [boredtaiga](https://wordpress.org/support/users/boredtaiga/)
 * (@boredtaiga)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/changing-the-language-by-script/#post-12230785)
 * Hey,
 * Go to this website: [https://ingatlan.unicool.hu/hu/](https://ingatlan.unicool.hu/hu/)
 * On the front page, there is a map, you can try to change any value or move the
   slider, or just simply change anything literally in the filter next to the map.
 * The language will be changed to English no matter what you do in the results 
   below the filtering settings.
 * This happens with everything on the website that uses AJAX to show content without
   page refresh. I solved this issue easily by storing the TRP_LANGUAGE global variable’s
   value in a cookie before the user clicks on anything and then return it when 
   the user gets in contact with any AJAX script.
 * I can’t use this solution at this problem, because there are too many things 
   changed when the user filters the results shown on the map.
 * This is a serious issue for me with this plugin because a lot of the content 
   on my website uses AJAX to show content.
 * Any ideas?
 * Thanks,
    boredtaiga
 *  Thread Starter [boredtaiga](https://wordpress.org/support/users/boredtaiga/)
 * (@boredtaiga)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/changing-the-language-by-script/#post-12230820)
 * The problem is the following: every time a user interacts with an AJAX script,
   the content shown as an output will be in the default language, which is English
   on my site.
 *  [Dragos](https://wordpress.org/support/users/dragosvrejiu/)
 * (@dragosvrejiu)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/changing-the-language-by-script/#post-12251137)
 * Hello,
 * Sorry for the late reply.
 * Do you have “Force language in custom links” enabled?
 * With the best wishes,
 *  Thread Starter [boredtaiga](https://wordpress.org/support/users/boredtaiga/)
 * (@boredtaiga)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/changing-the-language-by-script/#post-12285260)
 * Yes, I actually do have it turned on, although it doesn’t produce any results
   no matter if I have it enabled or not.

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

The topic ‘Changing the language by script’ is closed to new replies.

 * ![](https://ps.w.org/translatepress-multilingual/assets/icon.svg?rev=3166541)
 * [TranslatePress - Translate Multilingual sites with AI Translation](https://wordpress.org/plugins/translatepress-multilingual/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/translatepress-multilingual/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/translatepress-multilingual/)
 * [Active Topics](https://wordpress.org/support/plugin/translatepress-multilingual/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/translatepress-multilingual/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/translatepress-multilingual/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [boredtaiga](https://wordpress.org/support/users/boredtaiga/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/changing-the-language-by-script/#post-12285260)
 * Status: resolved