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 topic contains 1 reply, has 2 voices.

Last updated by Laura 2 months ago.

Assigned support staff: Laura.

Author Posts
August 2, 2019 at 11:58 am #4329735

danielT-59

I am using Gatsby and therefore I need all the REST Endpoints to work properly in every language. This would be equally relevant for any build where one uses WordPress as headless CMS and tries to fetch everything over the REST API.

I am trying to fetch the translated ACF Flexible Content fields. Preferably there would be a call like the following, to fetch all translations directly:

wp-json/wp/v2/pages/?lang=all

But even with the following I won't get the ACF fields (default language is DE):

wp-json/wp/v2/pages/?lang=en

So here is a Link to the response: hidden link

As you can see the acf field is false for this site as example: hidden link

I expected to see:
That all fields are shown in the translation. If to be "Translatable" the show the translation. Otherwise it should show the default languages information.

Instead, I got:
"acf": false

Steps to reproduce:

  • Install the attached plugins
  • Create Custom Field Group with Flexible Content as base
  • Add Layouts (see acf image attached)
  • Create Page with ACF Flexible Content blocks and translate
  • Guides I tried to follow, but didn't help:
    hidden link
    https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/
    hidden link

    Related Problems:
    hidden link
    https://wpml.org/forums/topic/how-can-i-get-all-pages-original-and-translated-in-the-api-response/

    For me this is a major issue and I can't use WPML if this doesn't work. WPML is great and I would love to use it, but if it doesn't allow me to have all translations in the API then thats problem for me and I guess many people who are using WP with decoupled web apps.

    Hope you can give me a solution for this.

    Kindest regards

    August 18, 2019 at 3:36 pm #4412467

    Laura
    Supporter

    Languages: English (English ) Italian (Italiano ) Portuguese (Brazil) (Português )

    Timezone: Europe/Rome (GMT+02:00)

    Hi,

    I have some news.

    It seems this is related to the fact ACFML doesn't automatically copy all fields. We are aware of that and we're working on it.

    What our 2nd tier tested on the Sandbox:
    - Create a post and fill the field's value
    - Translate the post using TE
    - Now back to the original post and switch the language from admin language switcher, you will notice none of the Flexible fields is set
    - Now set all the ACF system field to copy and repeat the process this time it is fine and works with REST API too

    Could you confirm this process works for you too?

    The topic ‘[Closed] ACF Flexible Field Translations not in REST API’ is closed to new replies.