Title: JavaScript in translated string?
Last modified: October 20, 2022

---

# JavaScript in translated string?

 *  Resolved [xbhy](https://wordpress.org/support/users/xbhy/)
 * (@xbhy)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/javascript-in-translated-string/)
 * Hello,
    thank you very much for this great plugin, since WPML isn’t free anymore,
   I use TranslatePress all the time.
 * I have a page with a price list, the prices in the original Czech version are
   in CZK and I would like the prices to be in EUR in the translated English version.
   Of course it can be done manually in Translation Editor but I was thinking of
   something more fancy, like calculating the values in EUR from the values in CZK
   using an exchange rate pulled from somewhere.
 * I think this would require JavaScript. I saw in the documentation that some HTML
   tags can be used inside the string in the Translation Editor, but what about 
   JavaScript? I guess I can’t just use the script tag in the Editor and expect 
   that to work?
 * Do you have any ideas how to achieve this? Thank you very much.
    Petr
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fjavascript-in-translated-string%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Thread Starter [xbhy](https://wordpress.org/support/users/xbhy/)
 * (@xbhy)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/javascript-in-translated-string/#post-16119121)
 * Update: I just found a plugin that does what I need:
    [https://wordpress.org/plugins/artiss-currency-converter/](https://wordpress.org/plugins/artiss-currency-converter/)
 * Would be possible to combine this with TranslatePress? Such as having the Open
   Currency Converter shortcodes as part of the translations in the Translation 
   Editor? That would be absolutely great.
 * Petr
 *  [Dragos](https://wordpress.org/support/users/dragosvrejiu/)
 * (@dragosvrejiu)
 * [3 years, 7 months ago](https://wordpress.org/support/topic/javascript-in-translated-string/#post-16128019)
 * Hello Petr,
 * Thank you for getting in touch with us!
 * We have some string sanitation functions in place which will not allow you to
   do this via the Translation editor.
 * However, you can use our Conditional Shortcode Based On Language to display different
   content for different languages [https://translatepress.com/docs/translation-shortcode/](https://translatepress.com/docs/translation-shortcode/),
   or 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/](https://translatepress.com/docs/restrict-by-language/elementor-integration/).
 * Also, we have similar integrations with 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/).
 * The mentioned feature should also be easily achievable using JavaScript without
   having to insert any script tags. We append a .translatepress-language class 
   to the body tag where language is the current language.
 * This class can be used in order to conditionally display text using JS or make
   the conversion only on Czech.
 * In case you are familiar with JavaScript, you can use an exchange API (like [this one](https://exchangeratesapi.io/documentation/),
   for example) in order to convert from EUR to CZK.
 * Best wishes,

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

The topic ‘JavaScript in translated string?’ 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

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

 * 2 replies
 * 2 participants
 * Last reply from: [Dragos](https://wordpress.org/support/users/dragosvrejiu/)
 * Last activity: [3 years, 7 months ago](https://wordpress.org/support/topic/javascript-in-translated-string/#post-16128019)
 * Status: resolved