Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
You are trying to translate the currency sign (лв.) to BGN on the English version of your site.
Solution:
First, ensure you have a backup of your site. Then, insert the following code into your theme's functions.php file:

add_filter("woocommerce_currency_symbol", "change_existing_currency_symbol", 10, 2);

function change_existing_currency_symbol($currency_symbol, $currency) {
    switch ($currency) {
        case "BGN": // Assuming BGN is the currency code for Bulgarian Lev
            if (ICL_LANGUAGE_CODE == "en") {
                $currency_symbol = __("лв.", "your-domain-name-here");
            } else {
                $currency_symbol = __("лв.", "your-domain-name-here"); // You can provide a different symbol for other languages if needed
            }
            break;
    }
    return $currency_symbol;
}

Please check if this resolves your issue. If this solution does not work or seems outdated, or if it does not apply to your case, we recommend opening a new support ticket. We also highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. For further assistance, please visit our support forum at https://wpml.org/forums/.

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.

Tagged: 

This topic contains 6 replies, has 2 voices.

Last updated by Kor 2 months ago.

Assisted by: Kor.

Author Posts
September 9, 2024 at 2:33 pm #16156742

aleksandarP

Background of the issue:
I am trying to translate the currency sign (лв.) to the English version of the site. The currency is the same but in English it should be BGN, not лв. The site I need help with is hidden link. Here are some examples: hidden link and hidden link.

Symptoms:
The currency sign (лв.) is not translating to BGN on the English version of the site.

Questions:
How do I translate the currency sign (лв.) to BGN on the English version of the site?

September 9, 2024 at 2:57 pm #16157218

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your patience.

I didn't get any response from your end and I've converted the chat into this ticket so that we could follow up.

Please let me know if the solution that I've suggested works for you.

September 10, 2024 at 9:06 am #16160067

aleksandarP

Hi again,

I'm sorry, but something urgent came up.
Can you send me the code to put on the site?

September 10, 2024 at 9:25 am #16160260
aleksandarP

I have two more issues:

1. How to translate "Show only products on sale" - I tried with String translation but it couldn't find this string - hidden link

2. The same issue with "BUY NOW", "Stock:", "In stock" and "Details" - hidden link

New threads created by Kor and linked to this one are listed below:

https://wpml.org/forums/topic/woocommerce-strings-cannot-be-translated/

Screenshot 2024-09-10 at 12.25.04.png
September 10, 2024 at 12:11 pm #16161209

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

Please backup and insert the code below into your theme's functions.php file.

add_filter("woocommerce_currency_symbol", "change_existing_currency_symbol", 10, 2);

function change_existing_currency_symbol($currency_symbol, $currency)
{
    switch ($currency) {
        case "BGN": // Assuming BGN is the currency code for Bulgarian Lev
            if (ICL_LANGUAGE_CODE == "en") {
                $currency_symbol = __("лв.", "your-domain-name-here");
            } else {
                $currency_symbol = __("лв.", "your-domain-name-here"); // You can provide a different symbol for other languages if needed
            }
            break;
    }
    return $currency_symbol;
}

Let me know if it works for you.

As for your other questions, I've split the ticket here https://wpml.org/forums/topic/woocommerce-strings-cannot-be-translated/ so that we could follow up.

September 11, 2024 at 8:34 am #16165077

aleksandarP

Hello,

The currency has changed.
Thank you very much.
I will give you an FTP access on the other ticket - https://wpml.org/forums/topic/woocommerce-strings-cannot-be-translated/

Regards

September 11, 2024 at 12:31 pm #16166495

Kor
Supporter

Languages: English (English )

Timezone: Asia/Singapore (GMT+08:00)

Thanks for your reply.

It looks like you've solved the issue for your other ticket. Marking this ticket as resolved.