Skip Navigation

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

Last updated by mauricioS-4 1 year, 3 months ago.

Assisted by: Osama Mersal.

Author Posts
January 8, 2023 at 10:47 pm #12771919

mauricioS-4

Hi,

I'm using wpbakery and already added their tags on my website wpml XML.
However, when I have a shortcode inside of a wpbakery shortcode (texto block or raw HTML) it doesn't show up properly when trying to translate.
For instance, I've tried already as a tag and an attribute of the text block, but neither way works.
What would be the right way to translate this shortcode? (each language needs to load a different id).

Thanks,

Screen Shot 2023-01-08 at 4.44.20 PM.png
Screen Shot 2023-01-08 at 4.44.59 PM.png
January 9, 2023 at 7:22 am #12773279

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for contacting WPML forums support. I'll be glad to help you today.

1) Could you please check if you can find the ID if you searched for it in the advanced translation editor? (https://wpml.org/faq/how-to-translate-urls-shortcodes-and-html-attributes-using-the-advanced-translation-editor/)

2) Could you please share your Debug information with me?
You can read a detailed explanation about it here. (http://wpml.org/faq/provide-debug-information-faster-support)
The debug info will give me a lot of information about how your site is configured.

Best regards,
Osama

January 9, 2023 at 7:35 am #12773337

mauricioS-4

Hi,

No, I can't.

Another issue that is happening (not related to this but needs help asap), is when I create a page and translate it, it's not being published. And my setting is set to publish automatically.

Thanks,

Screen Shot 2023-01-09 at 1.34.24 AM.png
January 9, 2023 at 7:39 am #12773367

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

1) In our forum, we try to keep one issue per ticket, so may I kindly ask you to open a new ticket for your additional issue?
Continuing with one ticket per issue helps supporters focus on one issue at once and enables other users to find solutions to their questions faster.

2) For the shortcode issue, could you please let me know which page contains this shortcode?

Also, I would need to look closely at your site, so I would need to request temporary access (WP-Admin and FTP)
– preferably to a test site where the problem has been replicated if possible –
in order to be of better help and check if some configurations might need to be changed.

Your next answer will be private, which means only you and I can access it.

❌ Please backup your database and website ❌

✙ I would need your permission to de-activate and re-activate the Plugins and the Theme and change configurations on the site. This is also a reason the backup is critical.

✙ I also need your permission to take a local copy of your site to debug the issue without affecting your live site.

Best regards,
Osama

January 9, 2023 at 8:14 am #12773667

mauricioS-4

Hi Osama,

I'm sorry, but I can't give you access and it's not a test environment. It also contains a lot of private data and it will take a long time to replicate without compromising the data.
Please, let me know if there is another way. It should be a standard answer, I just need to know how to translate a shortcode inside of another one.

That's the page: /post.php?post=46680&action=edit&lang=en

January 9, 2023 at 8:34 am #12773785

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Your shortcode should work, but I can't provide an XML for the shortcode without checking it. Also, it could be a compatibility issue, so please login to this sandbox site and upload the form plugin that creates this shortcode. (hidden link)

After that, please create a test page and translate it to replicate the issue. If the issue is replicable, please let me know to check it and consult our compatibility team if needed.

Thanks,
Osama

January 12, 2023 at 4:23 am #12800369

mauricioS-4

Hi Osama,

I uploaded and created the page as requested.
The issue also happens on this development website. I can't change the id of the shortcode.

Thanks,

January 12, 2023 at 7:36 am #12801203

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for replicating the issue. I found a workaround to translate the numbers. Kindly check the following steps.

1- Add the following code to your functions.php

/**
 * Allow translating numbers
 */
function wpmlsupp_7499_allow_translating_numbers( $is_translatable, $job_translate ) {
    $data = $job_translate['field_data'];

	if ( 'base64' === $job_translate['field_format'] ) {
		$data = base64_decode( $data );
	}

    if ( is_numeric( $data ) ) {
    	return true;
    }

    return $is_translatable;
}
add_filter( 'wpml_tm_job_field_is_translatable', 'wpmlsupp_7499_allow_translating_numbers', 10, 2 );

2- Add the following XML to WPML-> Settings-> Custom XML tab

<wpml-config>
<shortcodes>
  <shortcode>
  <tag>ipt_fsqm_form</tag>
  <attributes>
    <attribute>id</attribute>
    </attributes>
  </shortcode>
  </shortcodes>
</wpml-config>

3- Update the page in the default language
4- Update the translation, use the search bar to search for the ID, and translate the ID

I've applied the above steps to the sandbox site. Would you please check it and let me know if it works correctly?

Best regards,
Osama

January 12, 2023 at 2:32 pm #12806113

mauricioS-4

Hi Osama!

I appreciate your help!
I'm wondering if this could be applied only to this specific shortcode. I'm afraid of breaking other things on the website.
I also don't understand why some other shortcodes that have an "id" works and I can see the whole text to be translated, but it doesn't work for this one.

Thanks again,

January 12, 2023 at 2:38 pm #12806173

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

1) This workaround is to translate the IDs that don't appear in ATE, and the code is needed for this function.

2) Some shortcodes work without this workaround, but it depends on how the shortcode is created and whether the other plugin is officially compatible with WPML or not.

Best regards,
Osama

January 14, 2023 at 2:40 am #12817095

mauricioS-4

Hi Osama,

I tried your solution but the shortcode/id doesn't show up in the advanced translation editor. (I searched for different keywords such as form, id, shortcode, etc.)
How does it show up for you?

Thanks,

January 14, 2023 at 9:06 am #12817703

Osama Mersal
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

I search for the ID itself. For example, on the sandbox, I search for "5".

Please let me know if you find it correctly on your site.

Best regards,
Osama

1.PNG
This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.