Skip Navigation

[Resuelto] "Checkboxes" custom field values are not being translated with WPML

This support ticket is created hace 6 años, 2 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.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

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

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

Etiquetado: ,

Este tema contiene 3 respuestas, tiene 2 mensajes.

Última actualización por Twig hace 6 años, 2 meses.

Asistido por: Luo Yang.

Autor
Mensajes
#1116705

Hi -

I am using WPML to translate custom fields and everything is going pretty well; the only issue I found is that the 'checkboxes' field type is not getting translated in the View when I use the [types..] shortcode UNLESS I specify "output='raw'".

If I edit a localized post that has the checkboxes on it, I can see the correct translated options are present, and checked. The only issue is the display on the front-end only work with output=raw.

This seems strange to me since all the other fields (text, dropdown etc.) will be parsed through the translation and come out fine without needing raw output.

Can you verify this is a bug?

#1117080
checkboxes-field.JPG

Hello,

I can not duplicate the same problem with the latest version of Toolset plugins + WPML plugins

Please check these:
1) Edit the custom checkboxes field, in each option, enable "Show one of these two values", fill the option text in option "Selected", see screenshot checkboxes-field.JPG

2) Translate the text here:
Dashboard-> WPML-> String translation
domain choose "plugin Types", find and translate those "Selected" text, and test again

#1117108

Hi Luo- thanks for looking into this.

Interesting - in my website with the issue, I do not use the "Show one of these two values" options; I chose the "display value in the database" option.

WPML String translation still exposes the titles/values of the checkbox fields which I translated, and they show up correctly on the edit screen: but as mentioned, only display in English unless output is raw.

Why would we need to use the "show one of these values" options instead of the default "database" option?

I'll spin up a sandbox site and test this out. Thanks.

#1117129

I see what is happening and how it is supposed to work: I think my feedback is this:

Types shouldn't expose the "value" fields to WPML because those values shouldn't be translated and its confusing to see them all listed on the String Translation page. For my site, we exported the POT files and had them translated, then brought back in - so obviously all the exposed fields got translated and imported.

For example, for every checkbox that you set up as you describe above, you get up FOUR strings exposed to WPML:

field my-checkbox option wpcf-fields-checkboxes-option-xxx-1 title
field my-checkbox option wpcf-fields-checkboxes-option-xxx-1 value
field my-checkbox option wpcf-fields-checkboxes-option-xxx-1 display value
field my-checkbox option wpcf-fields-checkboxes-option-xxx-1 display value selected

You can see how this is confusing since the "value" option isn't supposed to be translated. To complicate things further, if you DO use the "output='raw'" option, Types WILL translate that value into the title!

I also read that the values inside select-type (dropdown) custom fields also should not be altered (to keep fields in sync between languages) but again, that field IS exposed to WPML String translation.

So basically my suggestion would be to remove fields from the "plugin types" context that should not be translated.