This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

Nessun supporter è disponibile a lavorare oggi sul forum Italian. Sentitevi liberi di creare ticket e li gestiremo il prima possibile quando saremo online. Grazie per la comprensione.

Etichettato: 

This topic contains 1 reply, has 2 voci.

Last updated by Bobby 3 mesi fa.

Assigned support staff: Bobby.

Autore Post
July 18, 2019 at 3:35 pm #4240235

albertoP-18

Hello,

how can I view a chat code based on the language?

also how can I view link usage terms based on the language in the woocommerce cart?

Thank you

July 18, 2019 at 5:05 pm #4241303

Bobby
Supporter

Languages: Inglese (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hello,

Please review the following documentation on our Hooks, Coding API, and Shortcodes

=> https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/

=> https://wpml.org/documentation/support/wpml-coding-api/

=> https://wpml.org/documentation/support/wpml-coding-api/shortcodes/

for example you could use an if else statement using the language constant ICL_LANGUAGE_CODE

a WPML constant that stores the current language that the site is being viewed in. https://wpml.org/documentation/support/wpml-coding-api/

An example code would be:

<?php
if (ICL_LANGUAGE_CODE == "fr") {
//show the chat code in French
} elseif (ICL_LANGUAGE_CODE == "de") {
//show the chat code in German
} else {
//show the default chat code in English
}
?>

The topic ‘[Closed] link conditions and code based on the language’ is closed to new replies.