I appreciate your patience.
I have looked into this, and it turned out to be a known issue under specific circumstances planned for one of the future releases (might be in WCML 5.6.0).
I have done the following to make the label appear in the translated product:
1. Replaced in \WPML_Autoregister_Save_Strings::get_source_lang in wp-content/plugins/wpml-string-translation/classes/filters/autoregister/class-wpml-autoregister-save-strings.php:
public function get_source_lang( $name, $domain ) {
$domain_lang = $this->lang_of_domain->get_language( $domain );
if ( ! $domain_lang ) {
$flag = 0 === strpos( $domain, 'admin_texts_' )
|| WPML_ST_Blog_Name_And_Description_Hooks::is_string( $name );
$domain_lang = $flag ? $this->sitepress->get_user_admin_language( get_current_user_id() ) : 'en';
}
return $domain_lang;
}
to
public function get_source_lang( $name, $domain ) {
$domain_lang = $this->lang_of_domain->get_language( $domain );
if ( ! $domain_lang ) {
$flag = 0 === strpos( $domain, 'admin_texts_' )
|| WPML_ST_Blog_Name_And_Description_Hooks::is_string( $name );
$domain_lang = $flag ? $this->sitepress->get_user_admin_language( get_current_user_id() ) : apply_filters('wpml_default_language', NULL );
}
return $domain_lang;
}
2. Replaced in wp-content/plugins/woocommerce-multilingual/inc/class-wcml-wc-strings.php, line 43
public function add_hooks() {
add_action( 'init', [ $this, 'add_on_init_hooks' ] );
// Needs to run before WC registers taxonomies on init priority 5.
foreach ( wc_get_attribute_taxonomies() as $tax ) {
add_filter(
'woocommerce_taxonomy_args_' . wc_attribute_taxonomy_name( $tax->attribute_name ),
function ( $args ) use ( $tax ) {
return $this->translate_attribute_labels( $args, $tax->attribute_label );
}
);
}
}
to
public function add_hooks() {
add_action( 'init', [ $this, 'add_on_init_hooks' ] );
// Needs to run before WC registers taxonomies on init priority 5.
foreach ( wc_get_attribute_taxonomies() as $tax ) {
add_filter(
'woocommerce_taxonomy_args_' . wc_attribute_taxonomy_name( $tax->attribute_name ),
function ( $args ) use ( $tax ) {
if ( !isset( $_POST["action"] ) || ( $_POST["action"] != "wpml_get_terms_and_labels_for_taxonomy_table" && $_POST["action"] != "wpml_tt_save_labels_translation" ) ) {
return $this->translate_attribute_labels( $args, $tax->attribute_label );
} else {
return $args;
}
}
);
}
}
3. Went to WPML → String Translation, find the label Halogen-free, and delete it. I have also searched for Halogeenvrij for the same attribute name, as it was registered twice.
4. Translated it from WPML → Taxonomy Translations
I have attached the screenshots for your review.
Please note that this is a temporary workaround and will be lost after the plugin is updated. I recommend saving the code in a safe place so you can reapply it after updating WPML String Translation and WCML.
Our developers are already investigating this issue and considering a permanent fix in one of the future releases.