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.

This topic contains 7 replies, has 2 voices.

Last updated by Michael 2 months, 3 weeks ago.

Assigned support staff: Shekhar Bhandari.

Author Posts
July 19, 2019 at 10:47 am

Michael

I am trying to get my linked variations (as made with Iconic's Linked Variation plugin) to display in the correct languages.

I expected to see:
On page: hidden link
What should happen: The first variable option button should be “Brass TEST” and the second should “Nickel TEST”. When you hover over what should be “Nickel TEST”, the variable option should read "Nickel TEST"

On page: hidden link
What should happen: The first variable option button should be “Brass TEST” and the second should “Nickel TEST”. When you hover over what should be “Brass TEST”, the variable option should read "Brass TEST"

hidden link
What should happen: Everything here is nearly correct. The variable option should read "Messing TEST"

hidden link
What should happen: Everything here is nearly correct. The variable option should read "vernickelt TEST"

The language switcher is located in the footer, bottom right.

I reached out the the guys at Iconic, but they directed me to you. Do you know where this glitch may be?

Many thanks,
Michael

July 19, 2019 at 12:44 pm
July 19, 2019 at 12:52 pm #4246533

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

I am working on this issue and will respond to you soon.

Thanks

July 19, 2019 at 2:44 pm #4247045

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

Please follow the below steps to fix the issue and let me know if this helps:
- Backup your site
- Login to your ftp
- Go to wp-content/iconic-woo-linked-variations-premium/inc/class-product.php Line no. 41 and add the following code

$label = '';
if ( is_plugin_active( 'sitepress-multilingual-cms/sitepress.php' ) ) {
    $original_string = $attribute_data['label'];
    $current_language = apply_filters('wpml_current_language', NULL);
    $label = apply_filters('wpml_translate_single_string', $original_string, 'WordPress', 'taxonomy singular name: Test', $current_language);
} else {
    $label = $attribute_data['label'];
}

- Then Search for the following line

<strong class="iconic-wlv-variations__label"><?php echo $attribute_data['label']; ?></strong>:

and replace it with

<strong class="iconic-wlv-variations__label"><?php echo $label; ?></strong>:

You can also suggest this code to the plugin developer, so it's not needed to use the code every time it's updated.

Let me know if this helps.

Thanks

July 19, 2019 at 4:32 pm #4247505

Michael

Hi Shekhar,

Thank you so much for taking so much time to help me figure this out.
Unfortunately the code you gave did not seem to work. I most likely entered into the class-product.php wrong.

Line no. 41 is a table row (<tr>) in my file. For step 1, I assume I need to wrap that is a <?php ?> clause, but should this go above the <tr> or should it go after?

If you were able to get it work, could you perhaps send me the file somehow? Then I can compare it with the version on my staging site.

Many thanks,
Michael

July 22, 2019 at 3:50 am #4253717

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

You can use the class-product.php from the test site, as I have already fixed the issue on it.

You can find the file from here: hidden link

Let me know if this helps.

Thanks

July 22, 2019 at 3:11 pm #4259189

Michael

Hi Shekhar,

Thanks so much for this, you really have been a great help!
At first, I could not get the code to work for me, but after some digging around, I found out why it wasn't working.

It is this line here:

$label = apply_filters('wpml_translate_single_string', $original_string, 'WordPress', 'taxonomy singular name: Test', $current_language);

To make it work, I had to change taxonomy singular name from "Test" to my actual taxonomy name.

However, I have several different names for difference linked products. Is there a way to slightly adjust the code so the taxonomy singular name is automatically adjusted in the filter?

Many thanks,
Michael

July 23, 2019 at 1:35 am #4261967

Shekhar Bhandari
Supporter

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

You can use this

$label = apply_filters('wpml_translate_single_string', $original_string, 'WordPress', 'taxonomy singular name: '. $original_string, $current_language);

Let me know if this helps.

Thanks

July 24, 2019 at 2:48 pm #4275835

Michael

My issue is resolved now. Thank you!

I will also pass this on to the plugin developers to help them make their plugin capital with WPML.