Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client was unable to translate certain custom fields using Advanced Custom Fields (ACF) and WPML's Advanced Translation Editor (ATE), despite setting the fields as translatable. The issue was due to multiple fields having the same name across different field groups, which caused WPML to apply the same translation settings to all similarly named fields.
Solution:
1. Verify that the field groups in ACF are set to 'translatable' under ACF -> Fields groups.
2. Ensure that in WPML -> Settings, the field groups for ACF are set to 'untranslatable' if they should not be translated.
3. For fields that need to be translated, ensure each field name is unique across all field groups to avoid conflicts in translation settings.
4. If the issue persists with existing content, make a minor edit in the default language and update the page. Then, access the translation editor where the field should now be available for translation.

Please note that this solution might be outdated or not applicable to your specific case. If the issue persists, we recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If needed, please open a new support ticket at WPML support forum for further assistance.

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.

Tagged: 

This topic contains 7 replies, has 2 voices.

Last updated by Bobby 10 months ago.

Assisted by: Bobby.

Author Posts
August 15, 2024 at 7:30 am #16073145

Imre Laur

Background of the issue:
I am trying to translate my custom blocks field. Whatever Multilingual setup settings I choose or whatever the translation preferences the field has, I still cannot translate it with ATE. Here is my ACF group JSON:

{"key": "group_641d8c170e39f","title": "My Custom Block","fields": [{"key": "field_641d8c1779f4a","label": "Block Google Analytics Group","name": "block_google_analytics_group","aria-label": "","type": "text","instructions": "","required": 0,"conditional_logic": 0,"wrapper": {"width": "","class": "","id": ""},"wpml_cf_preferences": 1,"default_value": "","maxlength": "","placeholder": "","prepend": "","append": ""},{"key": "field_641d8c5479f4b","label": "Title","name": "title","aria-label": "","type": "text","instructions": "Max characters: 120","required": 1,"conditional_logic": 0,"wrapper": {"width": "","class": "","id": ""},"wpml_cf_preferences": 2,"default_value": "","maxlength": 150,"placeholder": "","prepend": "","append": ""},{"key": "field_641d8cba79f4c","label": "Content","name": "content","aria-label": "","type": "textarea","instructions": "Here you can enter just plain text.","required": 1,"conditional_logic": 0,"wrapper": {"width": "","class": "","id": ""},"wpml_cf_preferences": 2,"default_value": "","maxlength": "","rows": 2,"placeholder": "","new_lines": ""},{"key": "field_649aa36682a71","label": "Services Title","name": "subtitle","aria-label": "","type": "text","instructions": "","required": 0,"conditional_logic": 0,"wrapper": {"width": "","class": "","id": ""},"wpml_cf_preferences": 2,"default_value": "What do you need help with?","maxlength": "","placeholder": "","prepend": "","append": ""},{"key": "field_641d8d1e79f4e","label": "Services","name": "services","aria-label": "","type": "repeater","instructions": "","required": 1,"conditional_logic": 0,"wrapper": {"width": "","class": "","id": ""},"wpml_cf_preferences": 2,"layout": "block","pagination": 0,"min": 6,"max": 6,"collapsed": "field_641d8d2b79f4f","button_label": "Add Service","rows_per_page": 20,"sub_fields": [{"key": "field_641d8d2b79f4f","label": "Service","name": "service","aria-label": "","type": "select","instructions": "","required": 1,"conditional_logic": 0,"wrapper": {"width": "","class": "","id": ""},"wpml_cf_preferences": 1,"choices": ["Error: Failed to load services!"],"default_value": false,"return_format": "array","multiple": 0,"allow_null": 0,"ui": 1,"ajax": 1,"placeholder": "","parent_repeater": "field_641d8d1e79f4e"},{"key": "field_641d8d5079f50","label": "Custom Title","name": "title","aria-label": "","type": "text","instructions": "Enter your own title to replace service title.","required": 0,"conditional_logic": 0,"wrapper": {"width": "","class": "","id": ""},"wpml_cf_preferences": 2,"default_value": "","maxlength": 150,"placeholder": "Your custom title","prepend": "","append": "","parent_repeater": "field_641d8d1e79f4e"},{"key": "field_641d8d8c79f51","label": "Is Checked?","name": "is_checked","aria-label": "","type": "true_false","instructions": "","required": 0,"conditional_logic": 0,"wrapper": {"width": "","class": "","id": ""},"wpml_cf_preferences": 1,"message": "","default_value": 0,"ui_on_text": "","ui_off_text": "","ui": 1,"parent_repeater": "field_641d8d1e79f4e"}]},{"key": "field_641d8d0679f4d","label": "Link Text","name": "link_text","aria-label": "","type": "text","instructions": "","required": 1,"conditional_logic": 0,"wrapper": {"width": "","class": "","id": ""},"wpml_cf_preferences": 2,"default_value": "","maxlength": 150,"placeholder": "Enter link text here","prepend": "","append": ""},{"key": "field_64241be676ba6","label": "Image","name": "image","aria-label": "","type": "image","instructions": "Minimum image size is 1024x1024. Ratio must be 1:1.","required": 1,"conditional_logic": 0,"wrapper": {"width": "","class": "","id": ""},"wpml_cf_preferences": 2,"return_format": "array","library": "all","min_width": 1024,"min_height": 1024,"min_size": "","max_width": "","max_height": "","max_size": "","mime_types": "","preview_size": "large"}],"location": [[{"param": "block","operator": "==","value": "acf/eres-marketplace-cta"}]],"menu_order": 0,"position": "normal","style": "default","label_placement": "top","instruction_placement": "label","hide_on_screen": "","active": true,"description": "","show_in_rest": 0,"acfml_field_group_mode": "advanced","modified": 1723700995}

Symptoms:
My block's title, subtitle, and services fields are still untranslatable.

Questions:
Why are my custom block fields untranslatable despite setting the correct Multilingual setup settings and translation preferences?
Is there an issue with the ACF group JSON configuration that is preventing translation?

August 15, 2024 at 7:13 pm #16075900

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

Hi there,

Is this happening for all the custom fields or specific ones?

If you go to ACF -> Fields groups what is the current settings for these fields, do you have them set to "translatable" ?

Also please go to WPML->Settings and verify that field groups for ACF is set to untranslatable.

August 16, 2024 at 4:58 am #16076666

Imre Laur

I have set them translatable, which I actually want to translate. Some fields which I do NOT want to translate, those have set to copy.

It is happening to some of the fields.

In my WPML -> Settings, I have that do not translate 'Field Groups (acf-field-group)'.

For example I have a field name called 'title' and field called 'subtitle'. I have a repeater `services` which contains the fields 'service' - returns custom Post Type object, 'title' - plain text, 'is_checked' - true/false field. I have set the repeater field to be translatable. 'service' field is on copy, 'title' field is set to translatable and 'is_checked' is set to copy. Also see my uploaded images.

Screenshot 2024-08-16 075813.png
Screenshot 2024-08-16 075751.png
Screenshot 2024-08-16 075124.png
August 16, 2024 at 6:10 am #16076818

Imre Laur

I have found a solution. The issue was that I had many fields with the same name. Let's take 'title' as an example. If any ACF field groups where same 'title' field set to don't translate, copy or copy once. Then the rest of fields will also use that setting. Don't know which order it uses. But I assume the last one overwrites it some how. So I had go over all my fields and set title field to translate.

I find it a bit weird that WPML knows for which block each fields are, but when they are not uniquely named globally, then WPML threats same named fields as the same. I would say I find as a bug. Since the block is unique and so it's fields. ACF knows that very well so can WPML. I hope you guys are taking this into a consideration to fix it in the future.

Another question is that how does WPML now know that a field is now translatable even when I have sent to Crowdin for example? What do I have to do that field will appear in ATE and Crowdin?

August 16, 2024 at 6:12 am #16076819

Imre Laur

My question now is that how does WPML now know that a field is now translatable even when I have sent to Crowdin for example?

What do I have to do that field will appear in ATE and Crowdin?

August 16, 2024 at 8:20 pm #16079260

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

That is a great catch, thank you for updating us! I will run some tests on our side and update the team regarding these findings.

When you set a field to translatable WPML should know right away that it is set to translatable with new pages/posts, etc, however, you do need to do the following for existing content.

Make a small change in the default language and update
Access the translation, you should see the field now picked up in the editor

August 19, 2024 at 4:55 am #16082024

Imre Laur

Could you please expand on what you mean "update
Access the translation"?

August 19, 2024 at 5:29 pm #16084832

Bobby
WPML Supporter since 04/2015

Languages: English (English )

Timezone: America/Los_Angeles (GMT-07:00)

After making a small change on your page/post in the default language click on the button 'update' to update the page as you would normally when creating or editing a page.

Then once the page reloads click on the translation and edit it as you would if you were adding a new translation and re save it.

August 21, 2024 at 4:31 am #16088632

Imre Laur

Okay, thank you very much for your help.