Skip Navigation

[Resolved] Translating a SELECT type Post Field with WPML

This support ticket is created 6 years, 9 months ago. 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Author
Posts
#551509
String Translation Option 2.JPG
String Translation Option 1.JPG
String Translation Label 2.JPG
String Translation Label 1.JPG
WPML Trans Mgmt Custom Fields Section.JPG
Toolsets Post Fields Input Screen.JPG
Spanish Content Front End.JPG

I am trying to: Translate a Toolsets Post Field using WPML
I visited this URL: hidden link
I expected to see: 1. I expect to see the back-end select input (drop-down menu) to be in Spanish (Etiqueta 1, Etiqueta 2) They are still in English
2. I expect to see the selection from that field in Spanish (Opcion 1)
Instead, I got: English. Same as the English post.
I have translated both the Label (Label 1 > Etiqueta 1) and the Term (Option 1 > Opcion 1) in WPML String Translation
I have set all fields in WMPL and in Toolsets Post Fields setup screen to TRANSLATE OPTION.
Everything on Spanish side is still in English. TEXT FIELD and TAXONOMY (CATEGORIES) work as expected.

#551571

I confirm there is a BUG.

1. Translate the Field in ST, it will not work
2. Translate the Field in Translation Editor itself, it will also not work.

Thanks for reporting this, I will escalate it to the Developers who will fix it ASAP.

Thanks for the patience as well.

#556012

The value of the Field is shown correctly as translated if you use the Translation Editor.

If you do not use the Translation Editor, the Label of the Field will be shown as well correctly translated (as translated in String Translation) in the Front end.

The Labels of the Field do not show translated in the backend.
This is a minor issue but I kept reporting this to the Developers so also that can be solved.

I will also keep updating here about eventual changes in the workflow as to me, this seems rather casual, and not nice.
I asked the Developers to analyse this deeper.

#560212

This is not yet solved.
I am pushing the developers to look into this ASAP.

Thank you for the patience.

#599511

There will be a Documentation update soon about how to use these fields with WPML.

As well there will be some development work to improve the usability and manage the restrictions better.

Let me show you what will figure in the document so we can already close this ticket here.

- Values of custom fields for posts and users that have a textfield-like interface should not be registered in WPML String Translation. In fact, this seems to be the current behavior.
==> Those fields get their value directly from the database, and as the current post is in the right language, we get the right values no matter whether they are set to translate, copy or do nothing.

- Each field has additional attributes:
-- Display name
-- Description
-- Validation messages
--- Fields with any sort of text input also have:
---- Placeholder
---- Default value
==> All those strings should be registered with WPML String Translation when the field group is saved, and should be translatable and translated in back-end and front-end.

- We have some special fields that need some sort of translated strings to work properly, this is because they do not expose their values directly and use labels, sometimes even alternative frontend output.
- Those fields are checkbox, checkboxes, radio and select fields.
==> In that case, they do translate their content. Changing the value, label or alternative output on the Types field group GUI sets those fields as Translation needs update in WPML String Translation, and they display the original language value until they get their translation updated.
- Select fields have options that the user can choose from. Each option has a Display text and Custom field content.
- The Display text is used whenever for option names whenever the input field is rendered, be it in back-end or front-end.
- When rendering the field with the [types] shortcode, the Display text is used by default as well.
- Custom field content is the raw value that will be stored in the database. It can be rendered on the front-end only using the raw output [types field='field-slug' output='raw'][/types].
==> Display text should be translatable while Custom field content must remain always the same, as defined field settings. They should never be registered as translatable strings.
==> Translating those values would create all sorts of problems with querying posts, with conditional output, and it also becomes a big problem if WPML gets deactivated (database is suddenly full of values that no longer have any connection to options), or even if the language of a post is changed.

- Translating "Display" text values, the values are registered as WPML strings as soon as the post field group holding the field is saved
==> That means, these strings should always be translated with WPML String Translation.
==> On the contrary, translating the Custom field content value with WPML Translation Manager is a bad practice, since the value works basically just as a “placeholder” for Display text. If the user absolutely needs to translate it, they’re probably using the wrong field type for their purpose, or they need some custom code adjustments.
==> The setting in WPML → Translation Management → Multilingual Content Setup → Custom Fields Translation can be set to Translate, because that means only that the user will be able to select a different option in the translated post (with a translated Display text but the same Custom field content value).

However, when the post as whole is sent to a translation via WPML Translation Manager, the translator will see (under WPML → Translations) the raw value of the field (Custom field content). This value should never be touched!

If they translate it directly, the value will not be recognized when the field is rendered (it will have no Display text attached) and Types will default to displaying it raw.

As you see there are some details which need usability updates and those works are in progress.

Teh document will clarify the process.

The updates depends mainly on WPML Translation management since it needs to hide the fields to be edited in certain cases.

These works will be updated in the WPML plugin, but I have no ETA's on this issue's solution.

It will be provided with a future release.

#656258

Hi Beda,

Is there any update on this topic? I am trying to translate type select field using string translation and unable to see translated text in translated post edit screen, as well as on post preview screen. I opted to reply on this thread rather than starting new one due to relevancy of topic. If required I can create a new topic.

Regards,
Khurram

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