Skip Navigation

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 14 replies, has 3 voices.

Last updated by Ahmed Ibrahim 4 years, 3 months ago.

Assigned support staff: Ahmed Ibrahim.

Author Posts
July 23, 2016 at 12:35 pm #972416

Jurgen

I am trying to: show 1 label per language (having the same conditions, but with different label text)

URL of (my) website where problem appears: hidden link (currently no different texts, so only visible in code)

I expected to see: the correct label according to the activate language

Instead, I got: all languages (with absolute positioning so always 1 specific language visible)

Steps to duplicate the issue: Add 1 global label, make it translatable, define other label text for each language & you'll see the same label for every language (others are there too but on a lower "layer").

Screen shot of code: hidden link
1st label is English, 2nd is Dutch (same text) & 3rd is French (there is "en" instead of "in").
All languages show the French text because that is the last one that is positioned on that spot.

July 25, 2016 at 4:33 am #973115

Shekhar Bhandari
Supporter

Languages: English (English )

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

Hi there,

Thank you for contacting WPML support.

It seems you are trying to translate the product status, right? If so could you please confirm if you have followed the below steps properly.

1) Go to WPML->Themes & Plugin localization and check the "Translate the theme and plugins using WPML's String Translation" checkbox
2) Once saved go below the page under "Strings in the plugins"
3) Choose the woocommerce plugin and select the "Scan the themes/plugins for strings" Button
4) Once the scanning process is finished, go to WPML->Strings translation - Search for the strings "In stock" and translate them to the secondary languages. https://wpml.org/documentation/getting-started-guide/string-translation/

Please let me know if the steps are completed properly?

Thanks

July 25, 2016 at 5:21 am #973124

Jurgen

Hello,

No, this has nothing to do with product statuses... This is about a official WooCommerce extension called 'Advanced Product Labels'. I created a condition to check the stock status and then display a certain label.

The string "In stock" (domain 'woocommerce-advanced-product-labels') is visible in WPML String Translation & translated correctly. I removed the label and its translations, created it again (only in English to make String Translation pick up the translations) but no difference. After that I added the 2 translations again via normal duplication via WPML (independent translation) but still it does not show up correctly: the 3 labels are still in the code (cfr my screen shot link in the original post, showing a part of the product detail page), showing the last one (as it is has absolute positioning).

There is a compatibility issue as it should not retrieve the EN or NL text if you are visiting the website in FR.

Thanks for checking.

Best regards,
Jurgen

July 25, 2016 at 7:45 am #973201

Shekhar Bhandari
Supporter

Languages: English (English )

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

Hi there,

Since I don't have the plugin to test this issue further, would you mind sending me the plugin files. I have enabled the private reply for you.

I will wait for your feedback.

Thanks

July 25, 2016 at 11:07 am #973562

Shekhar Bhandari
Supporter

Languages: English (English )

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

Hi there,

I am not able to replicate the issue on my localserver, so I request you to provide me login details so I can check this issue on your site. I need to request temporary access (wp-admin and FTP) to your site in order to be of better help. You will find the needed fields for this below the comment area when you log in to leave your next reply. hidden link

These info is private, and available to you and supporters only. Read more about this: https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

Note that:

#1
Backup (both files and database) your site before giving us your credentials. You can use a plugin for this if you like. I often use the Duplicator plugin for this purpose.
See: http://wordpress.org/plugins/duplicator/

Duplicator instruction
hidden link

#2
It would be better if you give me the test site rather than the live site.

#3
If the issues needs some changes in the plugins updates/disabling we will install a plugin called “duplicator” and replicate the site in our local server for testing.

I will wait for your feedback.

Thanks

July 26, 2016 at 3:13 am #975000

Shekhar Bhandari
Supporter

Languages: English (English )

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

In one of the Global Label you have defined the label text as EN Label as a results, the listing shows "EN Label", could you please go to third global label and change the label and let me know if that helps?

July 26, 2016 at 5:32 am #975073

Jurgen

I modified the label title & label text for all to make a clear difference between all languages. Now you can clearly see the differences, but also that "French" is always shown, no matter which language is active.

As said before: you can modify whatever it needs to check on the issue (instead waiting for my action).

July 26, 2016 at 6:57 am #975109

Shekhar Bhandari
Supporter

Languages: English (English )

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

Hi there,

It seems the issue happens when stock quantity is selected as conditional statement. This seems to be like compatibility issue, To ensure that this theme/plugin is made compatible with WPML we need to contact the theme/plugin author and work with him on resolving the issue.

Could you please provide a link to your theme's/plugin’s download ( or purchase) page as well as contact information(email?) to the theme's/plugin’s author so we can contact him?

You do not need to do anything other than providing the theme's author name and email. We will contact the author.

I look forward to your reply.

Thanks

July 26, 2016 at 7:14 am #975164

Jurgen

I only configured 1 condition (stock status) as that is what I am looking for. I did not test any of the other criteria, so I don't know if it is restricted to that one.

It is an official WooCommerce extension: https://woocommerce.com/products/woocommerce-advanced-product-labels/ . You can refer to my ticket #438644 with them where I came up with the issue, but they said I had to check with you.

July 26, 2016 at 7:30 am #975174

Shekhar Bhandari
Supporter

Languages: English (English )

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

Could you please paste the full link of the ticket that you are referring? "You can refer to my ticket #438644"

July 26, 2016 at 7:33 am #975175

Jurgen

Unfortunately that's not possible as tickets are always private at WooCommerce (you need to log on & you only see your own tickets). But that's the reference of the ticket.

July 26, 2016 at 10:32 am #975713

Shekhar Bhandari
Supporter

Languages: English (English )

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

Thank you for the details you provided.

I will forward the details to our Themes & Plugins Compatibility Team and they will contact the author. Please note that this process may take a while as it depends on how soon the author will reply to our efforts to contact him.

It would be great if you can also contact the author asking him to reply us. You could also refer them to our Go Global program so that we can help them make their theme compatible with WPML. https://wpml.org/documentation/theme-compatibility/go-global-program/ This may help expedite the process.

We are closing the ticket but we will keep it in our records. You will be notified the moment we have the author’s cooperation in this process.

August 17, 2016 at 11:23 am #1006716

Ahmed Ibrahim
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi, this is Ahmed Ibrahim from the second tier support team.

So I did some debugging and found the issue. it happened because the two global labels have the same condition so the plugin applying the two labels but the french one stays because it is the last one configured, so to fix the issue we need to filter the labels according to the language.

Go to : wp-content/plugins/woocommerce-advanced-product-labels/class-wapl-global-labels.php line:147 and add these lines after the declaration of the foreach

            $current_language = apply_filters( 'wpml_current_language',null);
            $post_id = $global_label->ID;
            $my_post_language_details = apply_filters( 'wpml_post_language_details', NULL, $post_id) ;
            if($current_language == $my_post_language_details['language_code']):

And close the if statement before the end of the for each at : wp-content/plugins/woocommerce-advanced-product-labels/class-wapl-global-labels.php line 189

endif;

Please let me know if that helps you.
Best Regards.

August 19, 2016 at 1:55 pm #1010742

Jurgen

Hi Ahmed Ibrahim,

Thanks for checking the issue.

Yes, this solves the issues, I just implemented this with success on a dev copy of the web shop. But can't this be done via some code in functions.php? Or ideally by the theme author in his plugin via your compatibility program? I don't want to modify a plugin file & having to remember which modifications that need to be done again upon each and every plugin update...

Thanks again!

Best regards,
Jurgen

August 19, 2016 at 4:07 pm #1010933

Ahmed Ibrahim
Supporter

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+02:00)

Hi, and thanks for your reply.

This is just a workaround for you to move on with your project now, and Themes & Plugins Compatibility Team will contact the author. Please note that this process may take a while as it depends on how soon the author will reply to our efforts to contact him. It would be great if you can also contact the author asking him to reply us. This may help expedite the process.

Best Regards.