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.

Our next available supporter will start replying to tickets in about 11.32 hours from now. Thank you for your understanding.

This topic contains 25 replies, has 3 voices.

Last updated by ianM-17 5 months ago.

Assigned support staff: Ahmed Ibrahim.

Author Posts
May 7, 2019 at 10:55 am

ianM-17

Hello

We have been having ongoing issues when receiving all content back from the translation company it does not include the shortcodes and neither the featured image.

I have attached a screenshot with the original content on the left and the translation received back with the missing shortcodes and missing featured image.

The shortcodes are custom made for the theme, to enhance layout, but to also load content set up in a different area.

I have also made localised copies from the original one, with no issues getting the shortcodes and featured images in these copies.

The translation company suggest that I somehow export a .xliff file and then import it again, to test if the issue is on our side. Can you please advise the best way for me to do this.

Also, if you have any experience with translation companies having to send back files to WPML, keeping the shortcodes intact and include the featured images. Do you have any tips I can pass on to them. This company say on their website they are a partner of WPML. Hence I would have thought this would not be an issue to do. But we are literally struggling for months now trying it get the translations back with shortcodes and featured image.

The info in the site is at the staging version of the site - if you need to test things. SFTP at port 2222.

Any help and advise would be much appreciated.

May 8, 2019 at 8:00 am #3764385

ianM-17

Hello again!

Just wondering if you would be able to pick this one up today?
Can you let me know an estimate timeline?

Thank you in advance.

May 8, 2019 at 10:15 am #3765379

Marcel
Supporter

Languages: English (English ) German (Deutsch )

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

Hi Ian,

Thank you for contacting WPML Support. I'm already on your site checking the custom shortcodes. I will reply to you ASAP as I analyzed everything.

Best Marcel

May 8, 2019 at 10:59 am #3765755

ianM-17

Brilliant! Thank you Marcel for letting me know.

May 8, 2019 at 10:59 am #3765757

Marcel
Supporter

Languages: English (English ) German (Deutsch )

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

Hi Ian,

#1 You can also use XLIFF export, but I think it will not solve your problem. Our Translation Proxy is also sending the translation job over an XLIFF file so the output will be the same. Here a doc how to locate the export: https://wpml.org/documentation/translating-your-contents/using-desktop-cat-tools/configuring-xliff-file-options/#manually-downloading-the-xliff-files

#2 In your case, I would recommend you to add all your custom shortcodes to our WPML XML config file. This file is located under WPML -> Settings. Doc: https://wpml.org/documentation/support/language-configuration-files/#using-wpml-language-configuration-file-with-child-themes

And here a doc how to create the custom XML file:

https://wpml.org/documentation/support/language-configuration-files/#1-1-translate-strings

I prepared an example for you, please add your custom shortcodes to <tag> and <attribute> fields:

<wpml-config>
<shortcodes>
        <shortcode>
            <tag>SHORTCODE1</tag>
            <attributes>
                <attribute>title</attribute>
            </attributes>

            <tag>SHORTCODE2</tag>
            <attributes>
                <attribute>title2</attribute>
            </attributes>


        </shortcode>
</shortcodes>
</wpml-config>

Could you please try this and let me know if you need further help in this case?

Best Marcel

May 8, 2019 at 11:12 am #3765879

ianM-17

Thank you Marcel for all the info.

The main issue here, why I need to test it on my side, is basically for the translation service...
(I have already suggested they open a ticket with WPML, to see where things are going wrong)

The translation company uses XLIFF file format. That is how I send it to them and they get it back? Or as far as I know. Therefor I don't know if there is any point testing the XML version.

Its been months of struggling and they are starting to say it is 'our platform' that has an issue and that is why they can not send the shortcodes back with the content.

I basically need to be able to confirm that it is not 'our platform' and if possible, tips for them on how they can send back the translations including the shortcodes via XLIFF file format. Is this possible?

What are your experience with translation services, sending content with shortcodes?

May 8, 2019 at 12:06 pm #3766437

Marcel
Supporter

Languages: English (English ) German (Deutsch )

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

Hi Ian,

I can not follow the comment from the translation service, as the XML config is the correct way to handle custom code like custom fields, shortcodes, attributes or even page builder content.
This will prevent the HTML output from breaking or getting lost. With the XML you tell WPML which parts need translation and how they are created

So, I think the translator did not fully understand that you are trying to send a custom shortcode and not a shortcode from your Theme, which would have already included in the Theme's XML config. This is the way how we make Themes compatible with WPML. We add custom XML for every element like Masonry, Grid, Testimonial.

As far as I see you used a translation service over our Translation Management, right?

- This means you created a translation job and sent it via our Translation Management Dashboard to the Agency.

- Or did you use another service where you send them the files manually over XLIFF?

So I would recommend you to add the XML config with all your custom shortcodes and sent the translations jobs again via Translation Management or if manual over XLIFF.

Then the translation agency will be able to receive the content with shortcodes inside.
Please let me know if it worked.

Best Marcel

May 8, 2019 at 1:44 pm #3767329

ianM-17

Marcel, thank you for the additional info.

Yes indeed, all I have been doing thus far was using the translation service from the WPML Translation Management, which then create a translation job that I then sent via the Translation Management > Translation Basket to the agency.

I have uploaded screenshots from the agency, of what they see. You can see the shortcodes highlighted. If it shows there, isn't there a way to set it up, so that it is included when the translations are sent back?

Do you perhaps know / to your knowledge if there is any sort of filtering the agency can do on their side? Also to get copies of the featured images included.

Or... to wrap my head around the info from your last message, does that actually mean for each shortcode used in a WordPress theme, one need to do an additional XML configuration, before transferring the translations, for it to work?

From my side, I have been involved with this project since we got the translations back, with no shortcodes and featured images. I did not do the initial set up of WPML and neither was involved planning or developing this custom theme...

May 8, 2019 at 3:32 pm #3768557

ianM-17

I have now also received the 2 files from the translation agency, see info and URLs below:

compute-en-de_en-US-2314225.xliff

is the source file they receive from us
hidden link

compute-en-de_de-DE-2318046.xliff

is the file they send back to us.
hidden link

Hopefully this will help to figure out where the issue could be.
Let me know if you need any more info.

May 9, 2019 at 4:19 pm #3778049

ianM-17

Any ideas on the last questions?
Let me know if there is a question that does not make sense.

Hope to hear from you soon.

May 9, 2019 at 4:50 pm #3778201

Marcel
Supporter

Languages: English (English ) German (Deutsch )

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

Hi Ian,

sorry, the delay in my answer.

Your translation process was correct. As written before you need to add your shortcodes to your custom WPML config, then everything will stay included when you receive the translations back.

"does that actually mean for each shortcode used in a WordPress theme, one need to do an additional XML configuration, before transferring the translations, for it to work?"

-> Exactly, this is the way we make Themes compatible. WPML still don't know yet that you are loading custom shortcodes. WPML will cover all essential content elements from WordPress. If your theme uses additional elements they need to be added to your XML.

Example: Let's say you are using the famous Avada Theme and you want to translate a Button from the Fusion (Page) Builder. WPML will load from the Themes folder following file: hidden link

With this code, WPML will know that you are using a button which is a custom shortcode from Fusion Builder with two attributes.

<shortcodes>
        <shortcode>
            <tag>fusion_button</tag>
            <attributes>
                <attribute type="link">link</attribute>
                <attribute>title</attribute>
            </attributes>
        </shortcode>
</shortcodes>
        

If you add additional shortcodes to your Theme, you need to tell WPML that you are using them. So, all you need to do is add all shortcodes to this XML config and your problem will be solved.

Please let me know if you have more questions regarding this process.

Best Marcel

May 10, 2019 at 9:32 am #3782785

ianM-17

Hello Marcel

Thank you so much for taking the time again explaining and all the info.
Really useful.

If I understand correctly, this means someone need to write some XML for all of the shortcodes the site is using? So that it can be added to the XML configuration tab.
This will then ensure, all shortcodes will come back as intended / expected.

If this is the case, then we would need some help with the XML for the shortcodes.
Because we have struggled with this issue for so long, we are thinking it will be best to get help from a contractor that specialise in WPML and all the settings, to ensure it is future proof and to get things right.
I had a look on this page https://wpml.org/contractors/ but don't know how to look or for what I am searching for to find the best person to do these settings. And to then also have a look why the featured images are not coming back with translations either?
Any advise / recommendation on the search?

Do you agree that this is basically what we need to do at this stage?
Because it has been such a big issue for so long, you advise is much needed and apprecaited.

Thank you in advance.

May 10, 2019 at 10:23 am #3783215

Marcel
Supporter

Languages: English (English ) German (Deutsch )

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

Hi Ian,

exactly, this is only necessary for the shortcodes which are made custom for your site.

Creating the XML is not such a big thing. The demo code I provided you need to be filled only with the names of the shortcodes and all their attributes. In this step, I can't assist you more, as this is a custom solution which is out of the scope of our support.

A contractor will help you probably best. You don't need to filter our contractors for any particular detail, as they are all certified from us. I would recommend the basic "Troubleshoot and fix problems" filter.

About the featured image:

This is not related to the custom XML. In the WPML Settings, the "inline_featured_image" custom field was set to "Don't translate". I changed this now to "Copy", so it will be copied to all posts. I tested it on a new post already.

You will find this setting on the bottom of every blog post (next to the ACF custom fields). I changed it now under "WPML -> Settings -> Custom Fields translation" globally. You can add the missing images from the already created posts here: hidden link - simply press on the Pencil icons.

I hope now is everything clear and you can continue with your project. Have a nice day!

Best Marcel

May 13, 2019 at 3:00 pm #3799669

ianM-17

Hello again.

Thank you for the info from last week, it is very useful.
Hope it is ok to pick your brain further.

I passed on the details to the theme developer.
The theme developer came back with the following comments:

One thought I've had about the shortcode issue and one which I'm sure the agency would be able to clarify is that when all is said and done a shortcode is just a piece of text. I.E when they are inputted into a wysiwig area a user just literally types opening square bracket, name of shortcode, closing square bracket as far as a computer knows they are no different from say a word or a bunch of symbols.

With that knowledge I would be interested to know how the agency deals with content that they translate. Do they programatically ignore all the shortcodes that they export and send to translators (I.E ignore anything within square brackets within a wysywig area.) and then somehow reinject the shortcodes back into the xliff file which they reimport. Or do they in fact just copy all the text out (remember that shortcodes are just text) and then translate it all. If they do the later and they discard the shortcodes, I.E delete them and just translate actual words then when they reimport the shortcodes will be lost and therfore not be reimported.

I also did a few tests doing a manual translation to Austrian German and it is worth noting that if an ACF field is set to 'translate' rather than copy then the text (therefore shortcodes) don't get copied across. This is logical as you wouldn't want your Austrian page to be full of copied over English text that you would have to then remove and write the German text. This does mean that you would have to retype the shortcodes that would not have been copied in the process. Having said this Lingo don't use this method so they should have a way of differentiating between text and shortcodes.

Is there a possibility, if the text are being translated, that one can simply add in the shortcode with the translated text and it should then work? As per the comment above, that the developer is concerned that the shortcodes was perhaps not added in with the translations. And he is basically saying, if it was, it should work?

Or is having the settings as per your instructions the only only way this can ever work.
Appologies if I am repeating questions. We are having a meeting on Wednesday and I need to make sure of the facts to ensure we resolve this asap.

In fact, we were wondering if you or another expert like yourself, from WPML can also be in this meeting (Wednesday 10am BST). Especially because we have this situation of two different parties saying different things. So we definitely need some solid guidance.

Please let me know your advise and thoughts on this.

May 14, 2019 at 10:48 am #3806111

Marcel
Supporter

Languages: English (English ) German (Deutsch )

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

Hi Ian,

Thank you for the details. I checked your concerns and can tell you that the solution is a straightforward and simple task.

I will provide you with the XML config for one of your custom shortcodes. With this, you can create a new translation job or even export the XLIFF file to test it. Then your developer should be able to add the rest.

Please give me some time to create an example, as I need to check all your attributes. Please note that joining your meeting is out of the scope from our support policy.

Best
Marcel