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 4 replies, has 3 voices.

Last updated by Lauren 1 month, 2 weeks ago.

Assigned support staff: Lauren.

Author Posts
August 29, 2019 at 8:32 am #4478701

touficA

Hi guys,
We use a plugin that allows template content to be created and inserted via shortcodes.

These templates are translatable, however, the translated templates have a different ID, example:

English = [templatera id=”108”]

russian = [templatera id=”456”]

So when we change languages the template areas are blank because the wrong shortcode is being used…

Do you know if there is a way to solve this without manually editing each shortcode?

Is there a way to say, if the site is "russian" replace [templatera id=”108”] with [templatera id=”456”] on all posts and pages.

August 29, 2019 at 11:30 am #4480525

Bobby
Supporter

Languages: English (English )

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

Hello,

which plugin are you using and is it listed as a WPML compatible plugin ?
=> https://wpml.org/documentation/plugins-compatibility/

when you add the translation to your templates is the translation of your template linked to the default template ?

the standard procedure is to usually manually change the short-code during translation as there is no default option to achieve this without custom coding

August 29, 2019 at 12:05 pm #4480647

touficA

I dont mind coding a custom function, the function would simply need to say:

If [Shortcode A] is being used on [russian], use [Shortcode B]

August 29, 2019 at 12:21 pm #4480789

touficA

I managed to find the option to change the short code in the string translation section.

However, there are multiple instances (see image) ... is there a way to update 1 and apply to all of the same instance?

August 30, 2019 at 2:16 pm #4487681

Lauren
Supporter

Languages: English (English )

Timezone: America/New_York (GMT-04:00)

Hi there, Bobby is off for a few days so I'm stepping in to help out. I hope that is okay. As you can see from the text domain, the shortcode is registered on each page with the page builder shortcode. So there is no way to translate it on one page and have it save the changes on the other pages. The strings will need to be translated individually.

Once the string is translated, marked as complete and saved, the correct template should display. Please let me know if you need any further assistance and I will be happy to help.