Hello Konrad, thanks for the feedback. I will add the details of the issue below.
It was reported here: https://wpml.org/forums/topic/acf-exteded-breaks-label-in-backend/
Description
After updating ACFML to 2.0.2, when using ACF Extended Pro plugin, with fields set to be the same for all languages, the ACF field group label appear like this !!__(!!’testtttdasdf!!’, !!’theme!!’)!! in Custom Fields -> Field Groups.
Steps to Reproduce
1. Install ACF, ACF Pro and ACF Extended Pro plugins with latest WPML plugins.
2. Create folders in the theme for acfe_php and acf_json
3. Create a test field group and add a field, and make sure you check the box to auto sync php and json int he advanced settings box to the right.
4. After this, when you edit the field group, the label will look like this: !!__(!!’testtttdasdf!!’, !!’theme!!’)!!
5. You can see if you look at the the acfe-php:
‘label’ => __(‘wpml test text field’, ‘theme’),
(before installing ACF Extender Pro, that field looks like ‘label’ => ‘wpml test text field’)
NOTE: this only happens with the extender pro add on plugin and when the multilingual setup is set to “same fields across languages”
Debug
The issue happens on?ACFE_AutoSync::save_file()
?–?wp-content\plugins\acf-extended-pro\includes\modules\autosync.php?at the following snippet:
acf_update_setting('l10n_var_export', true);
$field_group = acf_translate_field_group($field_group);
// reset store to allow fields translation
$store = acf_get_store('fields');
$store->reset();
$field_group['fields'] = acf_get_fields($field_group);
acf_update_setting('l10n_var_export', false);
It seems related to:
acf_update_setting('l10n_var_export', true);
It seems expected as we have the following snippet on?acf_translate()
?– wp-content\plugins\advanced-custom-fields-pro\includes\api\api-helpers.php:
// allow for var_export export
if ( acf_get_setting( 'l10n_var_export' ) ) {
// bail early if already translated
if ( substr( $string, 0, 7 ) === '!!__(!!' ) {
return $string;
}
// return
return "!!__(!!'" . $string . "!!', !!'" . $textdomain . "!!')!!";
}
Workaround
If we disable it, the issue does not happen.
// acf_update_setting('l10n_var_export', true);