[wcj_wpml]

Translate any text

Description

[wcj_wpml] shortcode translates any text to language set by WPML.
* WPML plugin must be installed.

Args

lang
(optional) Language code (as in WPML) to display current shortcode content. Can be comma separated list.

Default: None
not_lang
(optional) Language code (as in WPML) not to display current shortcode content. Can be comma separated list.

Default: None

Examples

[wcj_wpml lang="DE"]Guten Tag![/wcj_wpml]
[wcj_wpml lang="EN"]Good day![/wcj_wpml]
[wcj_wpml not_lang="DE,EN"]Hi![/wcj_wpml]
If the example above won’t work, please try replacing lang attribute’s values with lowercase, i.e. EN to en, and DE to de.
Accessible through:
  • [wcj_wpml]
Tested on WooCommerce 3.8.0 and WordPress 5.3
Plugin can be downloaded here. If there are any locked fields in the module, you will need to get Booster Plus to unlock them.

Leave a Reply

Comments

12 Comments

  1. Stan September 6, 2019 at 11:14 am #

    Hey guys!
    I am trying to use this shortcode on the “Shipping Descriptions” module. Which seems to work fine for a split second after reloading the page then for some reason it decides to show the shortcode with the other languages. Any ideas of what I am doing wrong? I have tried with both uppercase and lowercase.
    Thanks for reading me!
    Best regards,
    Stan

    Reply to thread

    Avatar
    • RokasJ September 6, 2019 at 2:35 pm #

      Hi Stan,

      Does WPML work in other parts of the website? What about this shortcode elsewhere?

      If you are using any caching plugins I would suggest trying to set “Default customer location” to “Geolocate (with page caching support)” in Woocommerce Settings > General.

      Best regards,
      Rokas – Support Team

      Avatar
    • Stan September 8, 2019 at 9:53 am #

      Hey Rokas !
      Thanks so much for the reply! Well it seems to work on the cart page now in 2 different languages it just doesn’t work on the checkout page. I am currently not using any caching plugins on this site. Any other ideas I can try out?

      Thanks again!
      Stan

      Avatar
    • Stan September 8, 2019 at 12:33 pm #

      One extra note, I also use the left to free shipping module in combination with this same shortcode. And that one does work on both cart and checkout in both languages. And as said it does seem to work for a split second but once the “checkout” finishes loading it shows the shortcodes.

      Hope this will help find the issue.
      Best regards,
      Stan

      Avatar
    • RokasJ September 8, 2019 at 2:20 pm #

      Hi Stan,

      Could you contact us directly via email support@booster.io about this issue?

      Best regards,
      Rokas – Support Team

      Avatar
  2. Marc June 26, 2018 at 4:18 pm #

    Hi, I’m not an experienced with shortcodes or how to use them, so I’ll appreciate if you can give me a more detailed example on how to use the WPML shortcode on a site with 2 languages. The part I want to use WPML with is the (Offer Your Price) and the lightbox contact form.
    I was trying to use the strings in WPML to translate those parts but it doesn’t work.

    Please explain, thanks.

    Reply to thread

    Avatar
  3. awag September 17, 2017 at 11:09 pm #

    Hi,
    I need to translate verification email sent.
    I tried to put in the settings / Message – Success :
    [wcj_wpml lang="EN"]Guten Tag!Success: Your account has been activated![/wcj_wpml]
    [wcj_wpml lang="FR"]Merci ! Votre compte est maintenant bien activé ![/wcj_wpml]

    but it is not working . any idea please ?

    Reply to thread

    Avatar
    • awag September 17, 2017 at 11:28 pm #

      Ok I found the trick : put lowercase [wcj_wpml lang="en"] instead of [wcj_wpml lang="EN"] !

      Avatar
  4. Jean-Marc December 22, 2016 at 10:20 am #

    Hi, I tried [wcj_wpml lang="EN"]Warranty Policy[/wcj_wpml] [wcj_wpml lang="FR"]Warranty Policy[/wcj_wpml] with the Product Tabs Module Title but it doesn’t work.

    Reply to thread

    Avatar
    • Booster Support Team December 22, 2016 at 9:43 pm #

      Hi Jean-Marc,

      I’ve just rechecked the code – it should work as you described. What results are you getting? Empty title? And if possible, please contact me on tom@booster.io with server login details, so I could check it out by myself.

      Best regards,
      Tom

      Booster Support Team
  5. Robert September 2, 2015 at 7:40 pm #

    Hi, I’m not an experienced with shortcodes, so I’ll apreciate if you can give me a more detailed example on how to use the wpml shortcode on a site with 3 languages.

    Thanks!

    Reply to thread

    Avatar
    • Valentin Solovjov September 4, 2015 at 7:57 pm #

      Dear Robert,

      what part of site do you want to use wpml ?

      BR,
      Val

      Avatar