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
- - 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00 9:00 – 18:00
- - - - - - -

Supporter timezone: America/Lima (GMT-05:00)

This topic contains 28 replies, has 3 voices.

Last updated by Andreas W. 1 year, 7 months ago.

Assisted by: Andreas W..

Author Posts
April 4, 2023 at 8:08 pm #13404025

Chainalysis

Hi Andreas, yes, I've deleted the string from within WPML > String Translation, and they do seem to delete correctly, but within WPML > Translation Management, I still see dozens of ACF Field Group translations available, such as "Field Group Labels 4661".

I checked out the icl_strings table within the database, and the strings do seem to have been deleted.

I know this because I'm able to pull up and older copy of the database where I see icl_strings fields where the context is acf-field-group-4661 for several fields. These fields exist in the old copy of the database but not in the current version.

April 4, 2023 at 8:53 pm #13404279

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

It might be that those field group labels are still showing up inside the WPML Translation Editor, as you started those jobs before you started to take the changes.

You will need to cancel the current jobs at WPML > Translation Management > Jobs and then when you translate the content again, the fields should not longer show up on the Translation Editor.

In case this will not work as expected, then please let me know.

Best regards
Andreas

April 5, 2023 at 4:29 pm #13412415

Chainalysis

Good idea but I have no open jobs at the moment, when I look within WPML > Translation Management > Jobs.

So there's nothing to cancel, unfortunately.

I tested a bit more and found that if I deactivate ACFML and then clone my production site, then the "acf-field-group#" fields do not appear on the new copy of the site.

But the moment that I activate the ACFML plugin, it seems to generate these fields.

So the problem seems to be some sort of setting, where ACFML is creating these ACF field group translation automatically even though I've applied the workaround that you shared, which in theory should stop this behavior.

Maybe there's some other ACFML code that needs to be commented out or changed? Or maybe there's a setting somewhere within ACFML or WPML that would enable us to stop the ACFML plugin from generating these new acf-field-group translation fields in the database?

April 6, 2023 at 2:44 am #13415293

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

In fact, when using the new ACFML then ACF Field Groups by default are set to "Not translatable" and it is now expected that labels are translated when translating the content - but there are some exceptions.

Take note, that now you can use a different translation mode for each field group.

Mode: "Same Fields Across Languages"
- Labels will appear on the ATE

How do I stop fields and field labels from showing up in the Advanced Translation Editor?

You can exclude field labels and field titles from appearing in the Advanced Translation Editor using the ACFML_EXCLUDE_FIELD_GROUP_STRINGS_IN_POST_JOBS constant.

You can still translate them if you choose to later from the String Translation page.

Simply add the following to your wp-config.php file:

define( 'ACFML_EXCLUDE_FIELD_GROUP_STRINGS_IN_POST_JOBS', true );

Mode: "Different Fields Across Languages"
- Labels should not appear on ATE and be translated with WPML > String Translation

Mode: "Expert"
- Now, in this case, I would need to run a test first, as I am not aware of how this mode handles labels in the new version of ACFML.

Your affected field groups are using all the "Expert" Mode?

Source:
https://wpml.org/documentation/related-projects/translate-sites-built-with-acf/#translating-labels

Best regards
Andreas

April 13, 2023 at 5:16 pm #13467139

Chainalysis

Hi Andreas, thanks you for your patience.

All of our fields are in Expert mode.

If I upgrade to ACFML version 2.0.4 and I add the new ACFML_EXCLUDE_FIELD_GROUP_STRINGS_IN_POST_JOBS constant, the same behavior persists:

The ACF field labels appear as string translations.

If I delete these strings, toggle ACFML off and toggle it back on, the unwanted string translations reappear.

Why would I toggle ACFML off and back on? It's because when we make staging copies of our production site, ACFML automatically re-initializes on the staging site, and the unwanted label translation strings reappear.

April 13, 2023 at 5:36 pm #13467255

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I am really sorry, but I am not sure at this moment if I understand the issue correctly.

Take note, that the constant "ACFML_EXCLUDE_FIELD_GROUP_STRINGS_IN_POST_JOBS" will only exclude those label strings from the WPML Translation Editor interface.

Due to the logic of ACFML 2.0 the labels are supposed to be translated in WPML String Translation by default, as now we do not longer suggest setting ACF Field Groups to be "translatable".

Is the issue for you, that there is the old translation for those labels already present on WPML > String Translation and you get unexpected results on Frontend?

If so, did you try to remove those strings from WPML > String Translation?

If you wish, I can offer to have a closer look at the site, or if you could set up a staging site for this purpose it would be even better.

Best regards
Andreas

April 13, 2023 at 5:42 pm #13467273

Chainalysis

> Due to the logic of ACFML 2.0 the labels are supposed to be translated in WPML String Translation by default

Okay, so that is the problem. How do we stop this new default behavior?

We want to prevent ACF field label translations completely, not only in the ATE but everywhere, please.

April 13, 2023 at 10:37 pm #13468921

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I am sorry if I might be repeating myself, but this is actually how ACFML works now.

These fields should only show up on the WPML Translation Editor, if you chose the ACF Field Groups translation option "Same fields across languages" or "Expert".

The only way is to use the constant "define( 'ACFML_EXCLUDE_FIELD_GROUP_STRINGS_IN_POST_JOBS', true );" which will exclude the fields from the Advanced Translation Editor when using these new ACF Modes.

If you use the ACF Field Group translation mode "Different fields across languages" then the labels also should not show up in the Advanced Translation Editor and can additionally be translated on WPML > String Translation, if necessary.

Further, Field Group Labels are always saved on WPML > String Translation too, but you do not need to translate them there if you do not wish to.

Best regards
Andreas

April 18, 2023 at 6:22 pm #13498885

Chainalysis

Andreas, you wrote,

'If you use the ACF Field Group translation mode "Different fields across languages" then the labels also should not show up in the Advanced Translation Editor and can additionally be translated on WPML > String Translation, if necessary.'

But we cannot use this setting because we use the ATE for translations, and this would break existing workflows.

Also, 'These fields should only show up on the WPML Translation Editor, if you chose the ACF Field Groups translation option "Same fields across languages" or "Expert"."'

We want to exclude the ACF field labels from Translation Management. We used to see a list of pages on the Translation Management screen, but now it is clogged up with ACF field groups, and there does not seem to be a way to remove them nor filter them out from the view.

You wrote "this is actually how ACFML works now."

ACFML 2.0 introduced the feature where field labels appear in the ATE, and many people found this to be a major problem, so you provided a workaround where we could deactivate this behavior. And as of ACFML 2.0.4, the new "ACFML_EXCLUDE_FIELD_GROUP_STRINGS_IN_POST_JOBS" constant allows us to stop that behavior. But thsi constant fails to prevent ACF field groups from appearing on the Translation Management screen.

Can you please share a workaround that will enable us to stop this content from appearing on the Translation Management screen?

It's okay if these items appear in string translation. We don't care if ACF field labels appear in String Translation because string translation is an optional feature that we are not forced to use, and because string translation includes filters so that we can limit the view to relevant content like pages and posts.

If it helps to understand this, it's extremely frustrating -- and causing us problems -- that ACFML introduced a new feature that is not optional, which causes problems with existing workflows.

ACFML includes an "expert" mode, which seems like it should enable people to opt out.

And the new ACFML_EXCLUDE_FIELD_GROUP_STRINGS_IN_POST_JOBS constant also seems like the sort of thing that should let people opt out completely.

Before, we could use the ATE and choose to either translate field labels or not. Now this option has been removed against our will, and the existence of the new ACFML_EXCLUDE_FIELD_GROUP_STRINGS_IN_POST_JOBS constant indicates that we are not the only team that is deeply frustrated and disappointed in the inability to opt out of the new forced behavior.

April 18, 2023 at 11:55 pm #13500159

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I do understand you, and just would like to sum up one last time:

"Same fields across languages" has pre-defined settings, and no options to change translation preference, this is why you have to translate the labels now.

"Different fields across languages" is not an option for you, as you use the ATE.

This means you need to use the Expert mode, which is the same old legacy mode from before the ACFML 2.0 Update.

I have created a test site here:
hidden link

There is already a CPT with an ACF Field Group in Expert mode.

All translation preferences are set by the user, with exception of the ACF Field Group Title which also appears on the WPML Translation Editor.

This is why we offered the constant "ACFML_EXCLUDE_FIELD_GROUP_STRINGS_IN_POST_JOBS".

Further, ACF Field Groups are an available post type at WPML > Translation Management > Dashboard.

Do I understand right, that you wish not to have ACF Field Groups as available post type at WPML > Translation Management > Dashboard - if so, I will consult this with the developers.

I understand that this behavior is kind of unexpected, as the post type will now always appear in Translation Management - actually, if you check WPML > Settings > Post Type Translation you also see that we now block the setting for the ACF Field Group to "Not translatable".

This why the post type should actually not show up on Translation Management and it only should show up there if ACF Field Groups is set to "Translatable" but we do not longer suggest that setting, as we do not translate the entire group, only the fields or the group.

I am not sure why our devs designed ACFM this way.

Please confirm the issue/request and I will escalate it internally.

Best regards
Andreas

April 20, 2023 at 12:53 pm #13511615

Chainalysis

Hi Andreas, thank you for the detailed reply.

I think you might have described the desired goal correctly but I'm not sure because you asked whether we want to translate "ACF Field Groups", which include field labels, option names, and field values, right?

We want to translate part of the ACF field groups but not all of the field group, the way it used to work in ACFML 1.x, like so:

1. _Do_ translate ACF field values, like we always have. (Well, except for a small number of ACF fields that we set to "Don't Translate".)
2. _Do not_ translate ACF field names.
3. _Do not_ translate ACF field option names, nor field option values. (We set most ACF option groups to "Copy", to prevent translation of our options.)

Our fields groups are set to Expert mode at the moment.

We use the ATE for translations.

We have set the new constant, ACFML_EXCLUDE_FIELD_GROUP_STRINGS_IN_POST_JOBS .

April 20, 2023 at 1:18 pm #13511807

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I am sorry, but at the moment I am unsure if something is actually not working as expected on your site.

You said you do not want to translate the Field Group Name when translating your fields with the WPML Translation Editor and you do not want ACF Field Groups as Post Type on WPML > Translation Management, but I am afraid that according to my test site, these both are expected behaviors.

If you have concerns about this behavior I can offer to consult this internally with the team - please confirm if you would like me to take this step.

Further, do you see a different behavior on the test site compared to your live site?
If so, then I would like to ask for admin access to your site, so that take a closer look.

Also, if you have an issue with some specific field values or settings for custom fields, please let me know and send me screenshots or examples and I can offer to review the settings for you on your site as well.

Best regards
Andreas

April 20, 2023 at 1:20 pm #13511857

Chainalysis

"I am sorry, but at the moment I am unsure if something is actually not working as expected on your site."

Yes, there is a problem.

"You said you do not want to translate the Field Group Name when translating your fields with the WPML Translation Editor and you do not want ACF Field Groups as Post Type on WPML > Translation Management, but I am afraid that according to my test site, these both are expected behaviors."

We are looking to stop this problematic behavior, similar to how you helped us stop this content from appearing in the ATE.

April 20, 2023 at 1:33 pm #13511917

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

As I was unable to visit your site to confirm the issue:

Before I consult this internally, please take note and confirm that the deiscribed behavior is currently expected and that you see the same behavior also on this test site:

hidden link

This means this is not a bug, it is how WPML and ACFML do currently work and you are expecting to forward a feature request, correct?

Further, as this is how our developers intended to design ACFM from now on, I can not guarantee you that the devs would change this behavior on a future version, especially since they would usually only do so if a significant amount of clients would expect such changes.

In order to open a feature request for you, I need specific examples and details.

You wish:

- No Field Group Names on ATE
- No ACF Field Group Post Type on Translation Management

Do you also have an issue with Field Labels showing up on ATE when not expected?

If so, please recreate these unexpected issues on the test site above - screenshots are welcome so that our devs can understand the issues better.

Best regards
Andreas

The topic ‘[Closed] ACFML 2.0: How can we opt-out of field label translations?’ is closed to new replies.