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.

This thread is resolved. Here is a description of the problem and solution.

Problem:
I want to translate the target of a link
Solution:
You can wrap your code around this code

function ...some code... {
 
$my_current_lang = apply_filters( 'wpml_current_language', NULL );
 
if( $my_current_lang =='en' ) {
...some code...
}
elseif( $my_current_lang =='nl') {
...some code...
}
return $translated_text;
}

Relevant Documentation:
https://wpml.org/forums/topic/php-error-ificl_language_codeen/#post-2111534

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by oscarM-16 1 month ago.

Assigned support staff: Bruno Kos.

Author Posts
September 11, 2019 at 7:18 am #4551055

oscarM-16

Tell us what you are trying to do? Translating the target of a link

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site? hidden link

September 11, 2019 at 8:31 am #4551719

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

I moved this into the ticket, since there was no reply for a long time. Can you tell me if you are able to code this as per my suggestion, so by using wpml_current_language filter?

Regards,
Bruno Kos

September 11, 2019 at 10:57 am #4552803

oscarM-16

Thanks for your help, works like a charm.