We have just released WPML 4.3.3. Before reporting issues please make sure to update - this version resolves all known issues with the major WPML 4.3 release

Hi, Amit here, I am the WPML Support Manager, our current ticket queue is high, update your WPML plugins and make sure you meet the minimal requirements for running WPML before reporting an issue please - many tickets are resolved doing that

Please look at our updated list of Known Issues and you can also use our support search to find helpful information and of course review our documentation before opening a ticket.

If you do need to open a ticket please make sure to provide us with all the needed information as described in this page

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 topic contains 1 reply, has 1 voice.

Last updated by hishamA-3 1 year, 7 months ago.

Assigned support staff: Bruno.

Author Posts
March 22, 2018 at 2:48 pm #1554020

hishamA-3

Hello WPML Support Center,
First, I'd like to thank you for the hard work and effort you spend to help and support your customers,

I am trying to translate a shortcode that I manually added to my template-frontpage after I added the shortcode to the "get_string" function or so it's called , the shortcode already appeared in the WPML String translation, But it was translated to a long string in HTML.

My "get_string" function I added manually to my template-frontpage:-
<?php _e( do_shortcode("[smartslider3 slider=2]"), 'azera-shop' ); ?>

Link to the generated code inside WPML String Translation: hidden link

I tried to translate the generated HTML string by translating the desired text inside of it, but no luck, nothing appears in the translated page, I even just copied the exact HTML and pasted it in the translated string space in WPML String translation, But to no avail, Still nothing is showing on my page.

what I'm trying to do, Is translate "Smart Slider3" Plugin's texts by generating a different slider for each language as you suggested in another ticket "URL under this post",

I did that and I want to insert the shortcode of each slider inside each of my php page templates, the original language template is done fine, But I can't seem to find the translated page or it doesn't even exist!, So how can I add the 2nd language shortcode inside the body of the translated page Manually, I'd really appreciate a way to that, the help and a solution.

URL for the previous ticket: https://wpml.org/forums/topic/how-can-i-translate-smart-slider-3-slides-texts-httpwww-makocreaciones-es/

Thanks in advance, and kind regards,
Hisham

March 23, 2018 at 4:11 pm #1555264

hishamA-3

I found a solution in one of your tickets under the name of something like "conditional shortcode", I thought I'd paste it in, it might help somebody else, who knows.

the solution goes by adding an if statement to the template-page like this:

<?php
			
		if (ICL_LANGUAGE_CODE == 'en') {
			echo do_shortcode("[smartslider3 slider=2]"); 
		} else {
			echo do_shortcode("[smartslider3 slider=3]"); 
		}
			
?>

Kind regards,
Hisham