I think there’s an error in andreu’s post and I found 2 sulutions to this case.
For example, we have a page in English with id 1 and it’s translation to Spanish with id 2. And we have an ACF field group with a rule to match id 1
Andreu’s first code compares current page ID translated to current language of backend/frontend and the ID. If the user is viewing the translated page (ID=2), the function still returns 2 and the match is 2!=1, but that’s not what we want.
The first solution is to use WPML function to get ID not for the current language, but for the default language, that the match is set in (note that icl_object_id function is now considered deprecated in WPML):
//get the default language code
$default_lang = $sitepress->get_default_language();
/* icl_object is deprecated in WPML, but I leave it here as an example:
$translated_id = icl_object_id($options['post_id'],'page',true, $default_lang);*/
// Proper way to do it now:
$translated_id = apply_filters( 'wpml_object_id', $options['post_id'], 'page', true, $default_lang);//add defualt lang parameter
The second and better, IMO, solution is to translate the ID to match instead: