Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
13:00 – 17:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 -
- 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: Asia/Jerusalem (GMT+03:00)

Tagged: 

This topic contains 15 replies, has 2 voices.

Last updated by Eran Helzer 1 year, 11 months ago.

Assisted by: Eran Helzer.

Author Posts
May 30, 2023 at 9:57 pm #13742729

Pablo

With ACF I have created a custom taxonomy (Colours) and have added a custom field to it (Hex Code). When I create a new taxonomy term, I fill in the custom field and it is fine. I then translate the title of the taxonomy term using WPML (prompted at the top of the taxonomy term list with "Translating Colours? Use the Colour translation table for easier translation"). Now if I switch to the other language and try to edit the custom field, it is not saved. I can only change it by editing the taxonomy term in the original language.

May 31, 2023 at 10:22 am #13745693

Eran Helzer
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

When you use WPML to translate taxonomies created using ACF, in the translation table there is also the option to translate the taxonomies custom fields values. There is no reason to translate custom fields by editing them in the secondary language, although that should also work.

Make sure that under WPML -> Settings -> Custom Term Meta Translation, the hex_code is set to Translate.
Then, could you please check that in the Colour translation table, WPML -> Taxonomy translation, when you translate Colours you can also translate their Hex Code?

Please get back to me if this resolved your issue. If you need any further help don't hesitate to ask.

Regards,
Eran

May 31, 2023 at 3:02 pm #13748319

Pablo

Thanks Eran. Are you saying that it is not possible to have the custom field value copied to the other language, regardless of whether or not I edit it in the original language of the taxonomy term or not?

June 1, 2023 at 5:29 am #13750709

Eran Helzer
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

No, it is possible to copy the value of a custom field of a custom taxonomy to a secondary language. You can do this without affecting the value in the original language.
What I am saying is that whatever value you want the custom field to have in any secondary language, whether it is a copy of the original value or not, you can set in two ways:

The first is using the WPML -> Taxonomy translation tab, and there when you edit translations of taxonomy terms you can also edit their custom field translations.

The second method is by editing the custom field value from the Colours tab in a secondary language.
The setting you need to verify is WPML -> Settings -> Custom Term Meta Translation. There is a table there with settings that define which custom field you can translate, make sure hex_color is set to translate (the default). I added an image for illustration.

If this doesn't resolve your issue, please don't hesitate to reply.

Regards,
Eran

Screenshot from 2023-06-01 08-16-11.png
Screenshot from 2023-06-01 08-12-15.png
June 1, 2023 at 3:46 pm #13756233

Pablo

Thanks Eran. When I try to change the "Custom Term Meta Translation" setting from "Copy" to "Translate" it does not stick. I change the setting and click "Save". Then I go to my custom taxonomy listing and add a new one, setting the colour to red, then use WPML's Taxonomy Translation to create a version in another language, save, and then edit it so that the colour is green. After clicking "Update" the colour is still red. I revisit the "Custom Term Meta Translation" settings and it has been changed back to "Copy".

June 2, 2023 at 8:03 am #13759019

Eran Helzer
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

The "Custom Term Meta Translation" depends upon two things. The translation option you chose when creating the field group and the type of the field.
From what it sounds like I believe the cause of the issue is that you have set the translation option to "Same fields across languages" and the type of the field is "Color picker". This would cause the setting to be "Copy", which synchronizes the values across languages.

Can you please verify if this is correct, and if not what the translation option for this field group is and what the type of the field Hex Code is?

June 2, 2023 at 12:38 pm #13761675

Pablo

You are correct. I see now that certain fields have default translation settings when you choose the "Same fields across languages" option in the field group settings, and colour picker is Copy (https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/recommended-custom-fields-translation-preferences-for-acf-and-wpml/). In this case, the problem seems to be that when you use the Local JSON feature (hidden link), the WPML->Settings->Custom Field Translation settings are not displayed properly with the lock icon and preventing you from changing the settings. See the attached images, 465 is with acf-json directory in my theme and 466 is without it.

Selection_466.png
Selection_465.png
June 5, 2023 at 6:12 am #13767373

Eran Helzer
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

I tested this out for myself and you are correct.
It is as you said, when the translation option is set "Same fields across languages", the translations settings of fields should be preset. However, the Local JSON feature causes the custom field translation settings to appear to be customizable, then after attempting to translate the field it reverts to the value of the original language and the setting reverts to "Copy".

This indeed looks like a bug, I have escalated this to our development team.

Regarding your case, what you want can be achieved by setting the translation option of the custom field group to "Expert", then you could translate the hex code without it reverting to the original value.

Please update me on if this solution resolves your issue.

June 5, 2023 at 2:26 pm #13771943
Pablo

Thank you. When I set the field to Translate I can set them independently and it works as expected - however, the Copy setting does not work as expected regardless of the Local JSON bug.

To demonstrate, create a custom text field, set the translation preference to Copy, and attach it to a Post. When you edit a post in the non-original language, the field is read-only and a lock icon appears next to it with a message "This field value is copied from the default language and will be kept in sync across languages". This does not happen when you have a custom field set to Copy and attached to a taxonomy - there is no indication that the field is not editable in both languages.

New threads created by Eran Helzer and linked to this one are listed below:

https://wpml.org/forums/topic/taxonomy-custom-field-is-not-locked-when-set-to-copy/

June 6, 2023 at 6:23 am #13775239

Eran Helzer
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

You are correct again.

Thank you for bringing this to my attention, I have escalated this as well to our development team and will update you when there is new progress. It really helps us improve when clients like you point out things such as this.

In the mean time, the only thing I can suggest to you is to use the WPML -> Taxonomy translation tab. There the translation option of custom fields is reflected correctly.

Also, since it is our policy to keep it to one issue per thread I will split this thread. The first will be regarding the issue with Local JSON bug and the second thread will be for the taxonomy custom field "Copy" bug. I will update you on any new progress in each respective thread.

June 6, 2023 at 1:15 pm #13779143

Pablo

Thanks Eran. I have a follow up question regarding this statement:

"In the mean time, the only thing I can suggest to you is to use the WPML -> Taxonomy translation tab. There the translation option of custom fields is reflected correctly."

By "reflected correctly" do you mean that the custom field set to Copy does simply not appear in the list of translatable fields? It seems like it might be wise to have it displayed here as read-only with the lock icon as well.

Selection_470.png
June 6, 2023 at 2:04 pm #13779497

Eran Helzer
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Yes, that is what I mean.

Regarding your suggestion, while it does makes sense, the practical impact is not big, since the value won't change between languages.
I will relate your suggestion to our development team and keep you updated.

June 9, 2023 at 12:26 pm #13799527

Pablo

I received an email notification saying that this would be closed and assumed resolved if I didn't respond in 3 days. Is this a mistake and the thread should stay open while the dev team looks into the Local JSON bug?

June 11, 2023 at 11:18 am #13805141

Eran Helzer
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

No, that was my mistake. I will set the status of the ticket to escalated so it won't be closed from inactivity.

July 10, 2023 at 5:47 pm #14008921

Pablo

Has this issue been resolved? It no longer appears in my "open tickets" list.