Title: How do switch scripts based on language
Last modified: February 15, 2024

---

# How do switch scripts based on language

 *  Resolved [mikehillcreative](https://wordpress.org/support/users/mikehillcreative/)
 * (@mikehillcreative)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/how-do-switch-scripts-based-on-language/)
 * Hello Denis and support,
   Thank you for your past help.I am trying switch a Hubspot
   form script based on language.I tried using your code above and below the script.[
   trp_language language=”en_US”][/trp_language][trp_language language=”pt_BR”][/
   trp_language]This is one of the scripts (image):[https://casknx.com/wp-content/uploads/2024/02/hubspot-form-code.jpg](https://casknx.com/wp-content/uploads/2024/02/hubspot-form-code.jpg)
   I appreciate your time and we love your plugin.Michael
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhow-do-switch-scripts-based-on-language%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [Anghel Emanuel](https://wordpress.org/support/users/anghelemanuel99/)
 * (@anghelemanuel99)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/how-do-switch-scripts-based-on-language/#post-17445755)
 * Hello there,
 * Thank you for reaching us!
 * It won’t work to use the shortcode into HTML.
 * What you can do is to insert that code in the back-end using a code block and
   then you can isolate it using the Conditional Shortcode.
 * Try this and let me know!
 * Kind Regards,
 *  Thread Starter [mikehillcreative](https://wordpress.org/support/users/mikehillcreative/)
 * (@mikehillcreative)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/how-do-switch-scripts-based-on-language/#post-17449753)
 * Hello Anghel,
 * Can you please tell me what you mean by “code block”?
 * And then what exactly to I put in that code block?:
 * Should I put both of my form scripts, wrapped in your short codes, into that 
   code block?
 * Then, on the page where I want the forms to load, what conditional shortcode 
   do I put in my page builder module?
 * Thanks,
 * Michael
 *  Thread Starter [mikehillcreative](https://wordpress.org/support/users/mikehillcreative/)
 * (@mikehillcreative)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/how-do-switch-scripts-based-on-language/#post-17460150)
 * Hello Anghel,
 * Can you please tell me what you mean by “code block”?
 * And then what exactly to I put in that code block?:
 * Should I put both of my form scripts, wrapped in your short codes, into that 
   code block?
 * Then, on the page where I want the forms to load, what conditional shortcode 
   do I put in my page builder module?
 * Thanks,
 * Michael
 *  Plugin Support [Alex](https://wordpress.org/support/users/alexcozmoslabs/)
 * (@alexcozmoslabs)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/how-do-switch-scripts-based-on-language/#post-17464560)
 * [@mikehillcreative](https://wordpress.org/support/users/mikehillcreative/)
   The
   shortcode needs to be used in a shortcode block, text editor, or as in the example
   with Gutenberg block in our documentation, but not directly in HTML: [https://translatepress.com/docs/restrict-by-language/translation-shortcode/](https://translatepress.com/docs/restrict-by-language/translation-shortcode/).
   So basically, you need to include that code into a widget/code-block, then isolate
   that block further with our shortcode.
 * Also, please notice that You can use our [Conditional Shortcode Based On Language](https://translatepress.com/docs/translation-shortcode/)
   to if your website is built with Elementor, you can restrict the modules based
   on language using our [Restrict by Language integration](https://translatepress.com/docs/restrict-by-language/elementor-integration/).
   
   Moreover, we have similar integrations with [Oxygen Builder](https://translatepress.com/docs/restrict-by-language/oxygen-builder-integration/),
   and [WP Bakery](https://translatepress.com/docs/restrict-by-language/wpbackery-integration/).
 * Best Regards,
 *  Thread Starter [mikehillcreative](https://wordpress.org/support/users/mikehillcreative/)
 * (@mikehillcreative)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/how-do-switch-scripts-based-on-language/#post-17466920)
 * [@alexcozmoslabs](https://wordpress.org/support/users/alexcozmoslabs/)
 * OKay, I finally got some results, thanks.
 * In Beaver Builder:
   I placed a text module in its own row, added [trp_language
   language=”en_US”] above the content I want to show/hide.
 * I placed my english content in its own row.
 * Below that, I placed a second text module in its own row with [/trp_language]
 * I repeated this process for my Portuguese content.
 * **Beaver builder has a conditional logic area in each container. I am wondering
   if there is a way to control this from there. (Shortcode result, or Cookie, or
   URL variable) ?**
 *  Plugin Support [Alex](https://wordpress.org/support/users/alexcozmoslabs/)
 * (@alexcozmoslabs)
 * [2 years, 3 months ago](https://wordpress.org/support/topic/how-do-switch-scripts-based-on-language/#post-17472422)
 * Glad to know it worked.
   There is no integration between Beaver and our conditional
   approach. Maybe we will try to come back to this idea in the future if we notice
   a major interest from our users regarding such a feature, but for the moment,
   the only solution is to use the conditional shortcode.However at the moment our
   current restrict-by-language integration is available as integration for Elementor,
   so you can restrict the modules based on language using our Restrict by Language
   integration, [https://translatepress.com/docs/restrict-by-language/elementor-integration/](https://translatepress.com/docs/restrict-by-language/elementor-integration/),
   Oxygen Builder, [https://translatepress.com/docs/restrict-by-language/oxygen-builder-integration/](https://translatepress.com/docs/restrict-by-language/oxygen-builder-integration/),
   and WP Bakery, [https://translatepress.com/docs/restrict-by-language/wpbackery-integration/](https://translatepress.com/docs/restrict-by-language/wpbackery-integration/).

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

The topic ‘How do switch scripts based on language’ 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/)

## Tags

 * [script](https://wordpress.org/support/topic-tag/script/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 6 replies
 * 3 participants
 * Last reply from: [Alex](https://wordpress.org/support/users/alexcozmoslabs/)
 * Last activity: [2 years, 3 months ago](https://wordpress.org/support/topic/how-do-switch-scripts-based-on-language/#post-17472422)
 * Status: resolved