Title: Translate script type text/javascript
Last modified: August 22, 2016

---

# Translate script type text/javascript

 *  Resolved [Nativum](https://wordpress.org/support/users/nativum/)
 * (@nativum)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/translate-script-type-textjavascript/)
 * Hello,
 * I am using the qtranslate x plugin on my website and everything works fine.
 * But now I am asking me how can I translate a text which is in the label.This 
   is my code:
 *     ```
       <?php
       add_action( 'wp_footer', 'add_tos' );
       function add_tos() {
       ?>
       <script type="text/javascript">
       jQuery(function($){
       if($('.mp_cart_shipping').length) {
       var html = '<tr><td colspan="2"><label><input type="checkbox" id="tos" /><strong>I agree with the <a href="/en/general-terms-and-conditions/">terms and conditions</strong></a></label></td></tr>';
       $('.mp_cart_shipping tbody').append(html);
       $('#mp_shipping_submit').click(function(e){
       if(!$('#tos').is(':checked')) {
       e.preventDefault();
       alert("<strong>Yes, I have read and agree with the terms and conditions</strong>");
       return false;
       }
       return true;
       });
       }
       });
       </script>
       <?php
       }
       ```
   
 * I want to translate the following part: I agree with the [terms and conditions](https://wordpress.org/en/general-terms-and-conditions/?output_format=md)
   and the last one under alert Yes, I have read and agree with the terms and conditions”.
   I have make the parts strong, so you can better see what I mean 🙂
 * Please, could you give me a advice,
 * thanks a lot,
 * regards,
 * Edina
 * [https://wordpress.org/plugins/qtranslate-x/](https://wordpress.org/plugins/qtranslate-x/)

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

 *  Plugin Author [Gunu](https://wordpress.org/support/users/grafcom/)
 * (@grafcom)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/translate-script-type-textjavascript/#post-5910057)
 * [@nativum](https://wordpress.org/support/users/nativum/),
 * tried with [:nl]Dutch Text[:en]English text – in your code?
 *  Thread Starter [Nativum](https://wordpress.org/support/users/nativum/)
 * (@nativum)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/translate-script-type-textjavascript/#post-5910064)
 * Hello @ Gunu,
 * thanks for your quick reply,
 * I have tried with[:en] but it doesn’t change. I have put it before the text like
   <label><input type=”checkbox” id=”tos” />[:en]I agree with the [terms and conditions](https://wordpress.org/en/general-terms-and-conditions/?output_format=md)[:
   de]Hiermit bestätige ich, die [AGB](https://wordpress.org/de/general-terms-and-conditions/?output_format=md)
   zur Kenntnis genommen zu haben und akzeptiere diese)</label>
 * But it doesn’t work 🙁
 *  Plugin Author [Gunu](https://wordpress.org/support/users/grafcom/)
 * (@grafcom)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/translate-script-type-textjavascript/#post-5910067)
 * Maybe [this](http://stackoverflow.com/questions/6520452/how-to-split-a-language-string-wordpress-qtranslate-in-javascript)
   can help you?
 *  Thread Starter [Nativum](https://wordpress.org/support/users/nativum/)
 * (@nativum)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/translate-script-type-textjavascript/#post-5910076)
 * Mhmmm, but where I have to put this code? Or how I use it.
 * I am not familiar so well with javascript from….
 *  Plugin Author [Gunu](https://wordpress.org/support/users/grafcom/)
 * (@grafcom)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/translate-script-type-textjavascript/#post-5910201)
 * try it in your functions.php of your theme.
 * I have not tested this, but you can try it.
 *  Thread Starter [Nativum](https://wordpress.org/support/users/nativum/)
 * (@nativum)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/translate-script-type-textjavascript/#post-5910303)
 * Hello,
 * I got it 🙂
 * I have just add following code:
 * <?php if(qtrans_getLanguage() == “de”) : ?>
    Text <?php endif ?>
 * Best regards,
 * Edina

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

The topic ‘Translate script type text/javascript’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/qtranslate-x_f9f9f9.svg)
 * [qTranslate X](https://wordpress.org/plugins/qtranslate-x/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/qtranslate-x/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/qtranslate-x/)
 * [Active Topics](https://wordpress.org/support/plugin/qtranslate-x/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/qtranslate-x/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/qtranslate-x/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Nativum](https://wordpress.org/support/users/nativum/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/translate-script-type-textjavascript/#post-5910303)
 * Status: resolved