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 26 replies, has 2 voices.

Last updated by Diego Pereira 1 year ago.

Assigned support staff: Diego Pereira.

Author Posts
September 16, 2018 at 11:43 am #2738830

tessvs

Hi Diego,

Thanks. The problem is that I also changed labels in English. For example, I changed 'Out of Stock' to 'Sold Out'. However, I don't know how I can change these labels. How can I use these strings for my webshop when I activate WPML String Translation?

Thanks again.

Greetings,
Tess

September 16, 2018 at 11:46 am #2738833

Diego Pereira
Supporter

Languages: English (English ) Spanish (Español ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi there,

This will require a workaround in order for you to change a hardcoded string without changing it in the theme's actual code.

To do this, please go to WPML > Languages > Add new language -> and add a random language. Then scroll down to Hide languages and hide this new language.

Now go to WPML > String Translation, Select your string then click on "Change language of selected string". Select the new created language.

Now, if you click on translations will have an option to "translate" it on the original language of the theme.

Please let me know if it worked for you.

Regards,
Diego

September 16, 2018 at 3:50 pm #2739024

tessvs

Hi Diego,

I followed all the steps, but the translations are not changing. I changed 'Out of Stock' to 'Sold Out' so it should appear as 'Sold Out' on my website, but it still appears as 'Out of Stock'. Please see screenshot - I can only attach one.

I really want to continue translating my website, but not before I know how I can change the labels of the original language.

Thanks again.

Greetings,
Tess

September 17, 2018 at 2:54 pm #2741516

Diego Pereira
Supporter

Languages: English (English ) Spanish (Español ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

Please send us access to your WordPress dashboard (website URL, login and password) I'll check and do some tests. - Please use the private field to send the sensitive data - do not post if you do not see it.

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

IMPORTANT Please backup a working copy of site files and database before.

Regards,
Diego

September 18, 2018 at 2:41 pm #2745486

Diego Pereira
Supporter

Languages: English (English ) Spanish (Español ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi there,

Thanks. I checked your website and it is set up correctly. I'm not sure why it did not work, maybe it's a compatibility issue with the theme, which is not on our list: https://wpml.org/documentation/theme-compatibility.

Is this the only string that is not working? If you want I can check in which part of the theme it is created and modify it directly in the code.

Kind regards,
Diego

September 18, 2018 at 2:45 pm #2745507

tessvs

Hey Diego,

Thank you for your reply.

Nope, none of the Strings translated with WPML are displayed correctly, so they don't change once translated.

It can't be a compatibility issue with the theme, as it is on your list as you can see on the screenshot (Bridge by Qode). I checked that before I purchased WPML.

How can you solve this? As I'm now constantly waiting... and I can't continue translating my webshop when I don't know if it's gonna work.

Hope to hear from you soon.

Greetings,
Tess

September 18, 2018 at 8:57 pm #2746508

Diego Pereira
Supporter

Languages: English (English ) Spanish (Español ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi there,

Sorry, my mistake, I searched for QODE instead of Bridge.

In this case, we need to test the theme with a clean install to check if it's a new compatbility issue.

I created a test website with a clean WordPress install. You can access it through this link:
hidden link - Through this link you will be automatically logged in.

Please upload the theme to this test install and create some test content to display the strings you need to translate - perhaps you can import the theme demo. Please note that we only need the theme and the related functionality, you don't need to setup a entire website or clone your existing site.

I will do some tests to modify the strings on the original language and forward to our compatibility team if needed.

Kind regards,
Diego

September 20, 2018 at 6:03 am #2750847

tessvs

Hey Diego,

I don't have the theme in a .zip format so I will need to upload it by using hidden link. Could you give me the necessary information of the server, host, etc.?

Greetings,
Tess

September 20, 2018 at 2:26 pm #2752459

Diego Pereira
Supporter

Languages: English (English ) Spanish (Español ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi there,

Sure! The FTP and SSH Credentials are available on the WP-Sanbox menu of the WordPress dashboard.

Please login using the previous link, then access this link: hidden link

Kind Regards,
Diego

September 23, 2018 at 8:13 pm #2758966

tessvs

Hey Diego,

Thank you. Unfortunately, the FTP connection cannot be established through the SFTP server. How else can I upload the theme as I only use/have experience with FileZilla?

Greetings,
Tess

September 24, 2018 at 2:47 pm #2760818

Diego Pereira
Supporter

Languages: English (English ) Spanish (Español ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi there,

You need to select the SFTP protocol (See screenshot). I tested on my filezilla and it worked.

Another option is to add the theme folder to a .zip file, then upload this zip file to the WP dashboard.

Please let me know if it worked for you.

Regards,
Diego

September 27, 2018 at 2:47 pm #2770915

tessvs

Hey,

I managed to upload the theme, so you can check what's not working with translating the string on my website.

Thank you.

Greetings,
Tess

September 27, 2018 at 8:28 pm #2771752

Diego Pereira
Supporter

Languages: English (English ) Spanish (Español ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Thank you!

I created a test content and defined one of the products as "Out of Stock". After that I activated the theme. The string you want to translate is the one that appears on this product page (and also on the product labels), correct? - hidden link

I will do some tests and send you a feedback soon.

Kind regards,
Diego

September 28, 2018 at 7:51 am #2772780

tessvs

Hey Diego,

Thank you. There are more labels I want to translate (mostly WooCommerce), but I started with 'Out of stock' and that didn't work so I didn't continue translating the other labels.

Hope you can find a solution.

Greetings,
Tess

September 28, 2018 at 3:32 pm #2774323

Diego Pereira
Supporter

Languages: English (English ) Spanish (Español ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi there,

It seems that the usual workaround to translate strings on the original language is not working with your theme. So the only waqy is to edit the theme code. You can edit the theme's code on Appearance > Editor. Here is some instructions to edit the strings:

Out of Stock (displayed on the product page)
Add this code snippet at the end of the functions.php file:

function wpmld_custom_get_availability( $availability, $_product ) {
    
    // Change Out of Stock Text
    if ( ! $_product->is_in_stock() ) {
        $availability['availability'] = __('Sold Out', 'woocommerce');
    }
    return $availability;
}
add_filter( 'woocommerce_get_availability', 'wpmld_custom_get_availability', 1, 2);

Out of Stock (displayed on the related products):
Open the bridge/woocommerce/loop/add-to-cart.php file and change the line 34:

<?php echo apply_filters( 'out_of_stock_add_to_cart_text', __( 'Out of stock', 'woocommerce' ) ); ?>

To this:

<?php echo apply_filters( 'out_of_stock_add_to_cart_text', __( 'Sold Out', 'woocommerce' ) ); ?>

Please note that you may need to translate those strings again to the other languages on the String Translator.

This solution worked on the test site: hidden link

If you need more help just let me know.

Regards,
Diego