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 9 replies, has 2 voices.

Last updated by markusK-37 3 months, 1 week ago.

Assigned support staff: Rohan Sadanandan.

Author Posts
July 10, 2019 at 9:37 am #4177811

markusK-37

I am trying to: Convert contents in my custom page template into German

Link to a page where the issue can be seen: hidden link

I expected to see: Custom html code in my template file show up in advanced translation editor

Instead, It just show the the_content part that I wrote in the page. It doesn't show dynamic html code to edit in advance translation editor.

July 10, 2019 at 11:34 am #4179495

Rohan Sadanandan
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

Thank you for contacting WPML Support.

For translating the custom code in your template, you need to use String Translation.
For more details, you can read this documentation: https://wpml.org/documentation/getting-started-guide/string-translation/

Also please make sure that your template is following WordPress internalization standards.
Then only WPML can pick it for translation. You can read more here: https://codex.wordpress.org/I18n_for_WordPress_Developers

Thanks,
Rohan

July 10, 2019 at 12:12 pm #4179991

markusK-37

Hi Rohan,
I have already done string translation.

eg: I have this <div style="padding:0 0 40px;font-size: 16px;color: #111;line-height:1.4em;"><?php _e( "Brand Affairs manages international ties around the globe. Our trusted network provides international clients with an easy and efficient way to leverage local talent, relationships and know-how. We operate DACH, Europe and global HUB communication activities around the world.", 'brandaffairs' );?></div> I added string translation as well. But when I try to translate page it doesn't show anything.

July 10, 2019 at 1:11 pm #4180543

Rohan Sadanandan
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

For translating the strings in the code, you need to navigate to WPML > String Translation
There you can search for your string & translate the fields.

If you have any doubts, please let me know.

Thanks,
Rohan

July 10, 2019 at 1:59 pm #4181023

markusK-37

Hi Rohan,

I already told you that I did that too.

Thanks

July 10, 2019 at 2:20 pm #4181337

Rohan Sadanandan
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

I need to request temporary access (wp-admin and FTP) to your site - preferably to a test site where the problem has been replicated if possible - in order to be of better help. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.
Instructions to send private information are here: hidden link

Privacy and Security when Providing Debug Information for Support:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

Thanks,
Rohan

July 10, 2019 at 2:36 pm #4181535

markusK-37

Hi Rohan,

I managed to add above div tag with translations. Now it's working. There was a if condition to check string comparison and then I output the div. I removed the if condition so it resolved the above div tag content translation.

But when I do a coding like this //if(strcmp($team_group_name,'INTERNATIONAL') == 0) // to do a string comparison, it won't work. Is there a specific way to achieve this to work with translation?

Even a code like this <h1 class="group-title"><?php echo sprintf( __("%s", 'brandaffairs'), str_replace("-", " & ", $team_group_name)); ?></h1> does not work when page was translated. I am passing $team_group_name, but how can I show a dynamic output like this when page is translated?

Thanks,

Regards,
Indika

July 10, 2019 at 2:46 pm #4181565

Rohan Sadanandan
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello,

It seems you need custom programming work which is beyond the scope of our support.

At this point, I would suggest you consider contacting one of our certified partners from this link: http://wpml.org/documentation/support/wpml-contractors/

You will get the custom assistance you need to get on with your project.

Before doing so please have a look also here: http://wpml.org/documentation/support/wpml-contractors/guidelines-for-people-looking-for-consulting-help/

Thanks,
Rohan

July 10, 2019 at 2:52 pm #4181639

markusK-37

Hi Rohan,

Thanks for the help anyway. But My normal English page working fine. So there should be a way to resolve conditional statements when using WPML.

I will try provide link. Thanks.

Regards,
Indika

July 11, 2019 at 3:57 am #4186025

markusK-37

My issue is resolved now. Thank you!