Saltar navegación

[Resuelto] Can’t output a image with translated alt and title tags

Este hilo está resuelto. Aquí tiene una descripción del problema y la solución.

Problem:
The issue here is that the user is unable to translate his custom field images.

Solution:

Unfortunately at this time our WPML Media plugin is not able to translate the custom field media images.

This support ticket is created hace 6 años, 9 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Etiquetado: ,

Este tema contiene 12 respuestas, tiene 2 mensajes.

Última actualización por christophW-2 hace 6 años, 9 meses.

Asistido por: Shane.

Autor
Mensajes
#623304

I posted this question already in the WPML Forum (https://wpml.org/forums/topic/translating-the-alt-and-title-values-of-images/), and Carlos Rojas suggested to open the topic here also, because it seems more toolset than WPML related.

I use toolset and have a custom post type "products". Also I have the media plugin in use. When I first upload an image in the media module, I see that with the WPML media Plugin, I can change the language at the top and set different values for the image alt and title fields (within the media module). This works, so the images have alt and title fields in different languages.

When I insert an image in a toolset image field and display this field in a toolset view with the following code ([types field='maschinenbild' alt='%%ALT%%' title='%%TITLE%%'][/types]), the alt and title values are always in English (with the correct title and alt values set in the media module). How can I achieve that it's taking the alt and title values from the correct language?

So Carlos answer was that this isn't possible at the moment, but you some changes to solve this problem. So I would be interested to know, as soon as the translation of images will be fully supported.

Thanks
Christoph

#623424

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Christophe,

Thank you for contacting our support forum.

I would like for you to provide me with a duplicator package so that i can do some further testing on this.

To provide the package please follow the instructions below.

https://toolset.com/faq/provide-supporters-copy-site/

Thanks,
Shane

#624299

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Christoph,

Thanks for the duplicator package.

I'll update you with any findings.

Thanks,
Shane

#624396

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Christoph,

I was able to identify the issue.

It seems that the WPML Media doesn't work with custom image fields.

As a temporary workaround to this you can upload a separate image for the english translation in the meantime while I report this to our team.

Thanks,
Shane

#624515
screenshot.jpg

Hello Shane

Thanks for your feedback. I have another problem, and now that you already have installed the duplicator package, perhaps you (or another support member) can have a look at that one without I need to provide all the details again. Here is the problem:

In our custom post type "Produkte" we have a field "Downloads" of the type file, which can have multiple instances. When we insert a pdf-File, all is correct, but when we add a second or third file, all the previous inserted files from that product get changed to the same (see screenshot).

You can see it for example on this product: enlace oculto

Thanks for marking this post as private.

Regards
Christoph

#625333

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Christoph,

I'm consulting with the wpml team to understand the issue here with the custom image field as it may not be possible at the moment.

Your second issue might be caused by a plugin conflict. Would you mind temporarily disabling the non-toolset and wpml plugins and let me know if the problem still exists.

Thanks,
Shane

#625520
screenshot.jpg

Hello Shane

I disabled all plugins except WPML and Toolset Plugins (see screenshot). The problem still remains.

I found out the following thing. When I creat a new product and attache several download files, the files are correctly displayed. When I then change one of the files, all the files which are present are replaced with the last file which was inserted.

Thanks for checking.
Christoph

#626237

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Christoph,

I tried this on the duplicator package you provided and the issue isn't there.

Would you mind providing me with admin access so I see if I can replicate the problem on your site ?

The private fields have been enabled.

Thanks,
Shane

#626730

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Christoph,

I found the issue.

It seems its being caused by the WPML media plugin.

I went ahead and escalated this for further debugging.

Thanks,
Shane

#626992

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Christoph,

This is a known issue and was reported on our internal system.

We have a workaround for this.
in filter_meta_value_and_update() in \wpml-media-translation\classes\images-translation\class-wpml-media-custom-field-images-translation.php
comment out the line:
update_post_meta( $post_id, $meta_key, $meta_value_filtered );

Please try this and let me know if it helps.
Thanks,
Shane

#627010

Hello Shane

Thanks, that seems to work. So will this be fixed in the next plugin update, or do I have to think about doing this change again?

Regards, Christoph

#627012

Shane
Supporter

Idiomas: Inglés (English )

Zona horaria: America/Jamaica (GMT-05:00)

Hi Christoph,

Happy to hear that it works.

Yes this is reported to the development team for WPML and should be fixed in the next update for the WPML Media plugin.

Thanks,
Shane

#627013

Ok, thanks for your help.

Regards, Christoph