I fixed this by creating a filter in my themes function.php. I just didn’t have the time (yet) to dig in deep enough to into both WP multilang and Woocommerce to figure out what needed to be be identified at filter level to get the attribute names translated correctly. With my tests this now works.
add_filter( 'woocommerce_cart_item_name', 'cart_variation_description', 20, 3);
function cart_variation_description( $title, $cart_item, $cart_item_key ) {
$item = $cart_item['data'];
$_product = apply_filters( 'woocommerce_cart_item_product', $cart_item['data'], $cart_item, $cart_item_key );
if(!empty($item) && $item->is_type( 'variation' ) ) {
$product_permalink = apply_filters( 'woocommerce_cart_item_permalink', $_product->is_visible() ? $_product->ge$
$translate_name = translate_title($item->get_name());
return sprintf( '<a href="%s">%s</a>', esc_url( $product_permalink ), wpm_translate_string($translate_name));
} else
return sprintf( '<a href="%s">%s</a>', esc_url( $product_permalink ), $title);
}
function translate_title($title) {
$all_matches = array();
preg_match_all("/[^\[\]]*/", $title, $all_matches);
$matches = $all_matches[0];
$lang_string = "";
$user_language = wpm_get_language();
$output_string = "%s[:%s]%s[:]";
$i = 0;
$size = count($matches);
while ($i < $size) {
$val = $matches[$i];
if (strlen($val) == 0) {
$i++;
continue;
}
if (strpos($val, ':') === 0) {
if (strpos($val, $user_language) >= 1) {
$lang_string = sprintf($output_string, $lang_string, $user_language, $matches[$i + 2]);
}
$i += 3;
} else if (strlen($val) > 1) {
$lang_string = sprintf($output_string, $lang_string, $user_language, $val);
$i++;
}
}
return $lang_string;
}