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.

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

Problem: Translation of ACF textarea field shows up as text field

Solution: You can add attributes to the tags. These attributes customize the instruction texts in WPML Translation Management Editor. https://wpml.org/documentation/support/language-configuration-files/#custom-fields

Relevant Documentation: https://wpml.org/documentation/support/language-configuration-files/#custom-fields

This topic contains 5 replies, has 2 voices.

Last updated by Shekhar Bhandari 2 months ago.

Assigned support staff: Shekhar Bhandari.

Author Posts
August 9, 2019 at 5:04 pm #4372067

laura-dY

I am trying to:
Translate a textarea field and keep the formatting (basically this is a heading split on two lines with break, which is why I am using a textarea field instead of a WYSIWYG field)

Link to a page where the issue can be seen: The site is under development but I attached some screenshots. I will be uploading to a staging server soon so I can get you access if necessary

I expected to see:
Textarea fields where I could add the translation including the line break.

Instead, I got:
Just a text field

I found some of your support tickets related to this and attempted to use wpml-config.xml to set these fields to textarea. I did this by going to the WPML > Settings page > Custom XML configuration. I put in:

<wpml-config>
    <custom-fields>
        <custom-field action="translate" style="textarea" label="Subheading">subheading</custom-field>
        <custom-field action="translate" style="textarea" label="Heading">heading</custom-field>
    </custom-fields>
</wpml-config>

I added the fields, but I am using these fields within a flexible content field and these are clones, so maybe that is why it doesn't work. I'm using them everywhere so it would be difficult to try to do it for every field where it is cloned, but if that would work, I would give it a try.

August 12, 2019 at 5:26 am #4378443

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Thank you for contacting WPML support. I'd be happy to help you further.

Firstly, mark the system fields of the subheading & heading also to copy and see if this helps. The system fields start with _ and should name similar to _FIELDNAME

<custom-field action="translate" style="textarea" label="Subheading">subheading</custom-field>
<custom-field action="copy">_subheading</custom-field>

If this doesn't help, It must be a compatibility issue with the ACF. To debug compatibility issue quickly, it will be best to test the issue on a fresh new Installation, being so I would need your little help to pinpoint the issue further.

I have created a fresh new WordPress Installed test site here, hidden link you can click on the link to login.

Could you please use the same settings there and see if you can replicate the issue? Please don't use personal information on the site as it's a test site, I recommend using some dummy data.

This will help us to figure out if this is actually a compatibility issue or a site-specific issue.

Look forward to your reply.

Thanks

August 15, 2019 at 2:11 pm #4401459

laura-dY

That didn't work. I set up the fields in your test site. I had to create a new user for myself so I could set the admin language to English (it wouldn't let me do so for demo). Have a look and see if you can determine the issue with this minimal setup.

Thanks!

August 19, 2019 at 3:34 am #4413431

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

I just checked the same page and noticed the fields names are not the same there, which is creating the problem. To fix the issue, I used the following xml file.

<wpml-config>
    <custom-fields>
        <custom-field action="translate" style="textarea" label="Subheading">content_blocks_0_simple_heading</custom-field>
        <custom-field action="copy">_content_blocks_0_simple_heading</custom-field>
        <custom-field action="translate" style="textarea" label="Heading">content_blocks_0_simple_subheading</custom-field>
        <custom-field action="copy">_content_blocks_0_simple_subheading</custom-field>
        <custom-field action="copy">_content_blocks</custom-field>
    </custom-fields>
</wpml-config>

Let me know if this helps.

Thanks

August 19, 2019 at 10:06 am #4415037

laura-dY

This is what I was referring to in my original post about using these fields within Flexible Content Fields. I was hoping that I could set this for the original fields that are then cloned and used in Flexible Content Fields in different ways throughout the site. The field names you are using will change, and there are many of them (as opposed to the one I created in this demo site). The client can add, delete and move the content fields around and each time this field name will change. So, unfortunately, this isn't a very practical solution, but I assume the only possibility at this time. Is is something that would be considered for a future update? To inherit the field type from the original field (the same way ACF does?).

Thank you.

August 20, 2019 at 5:04 am #4420535

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Yes, this is the only way to mark those fields translatable at the moment.

You can suggest a new feature request from here if you wish:
https://wpml.org/suggest-a-new-feature-for-wpml/

Look forward to your reply.

Thanks