This thread is resolved. Here is a description of the problem and solution.
Problem:
The client is using the Klarna Payments for WooCommerce plugin and is unable to find the plugin's strings translated into Greek in the string translation to translate them into English, despite scanning the plugin and theme and using various translation options.
Solution:
We recommend modifying the plugin's code to ensure WPML correctly identifies and translates the strings. Follow these steps:
1. Edit the file at
wp-content/plugins/klarna-payments-for-woocommerce/vendor/krokedil/klarna-onsite-messaging/src/Utility.php
2. Replace the existing
get_locale_from_currency
function with the following code:
public static function get_locale_from_currency() {<br /> $locale = get_locale();<br /> $currency = get_woocommerce_currency();<br /> $country_code = self::get_purchase_country();<br /><br /> if ($is_wpml_configured = apply_filters('wpml_setting', false, 'setup_complete') == 1) {<br /> if ($locale == "en_US") {<br /> $locale = "en-GR";<br /> return $locale;<br /> }<br /> }<br />}
Please ensure to back up your site before implementing these changes.
If this solution does not resolve your issue or seems outdated, we 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. If the problem persists, please open a new support ticket at WPML support forum.
0% of people find this useful.
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: Compatibility
This topic contains 31 replies, has 3 voices.
Last updated by George Botsev 5 months, 2 weeks ago.
Assisted by: Osama Mersal.
Author | Posts |
---|---|
May 20, 2024 at 11:33 am #15645281 | |
nikolaosM |
Hello, We have added Klarna payments in our client's e-shop and we are using Klarna Payments for WooCommerce plugin https://wordpress.org/plugins/klarna-payments-for-woocommerce/. The problem is that the plugin's strings are translated in Greek because the account is in Greek and we can not find them in string translation to translate them in English. Any solution? |
May 20, 2024 at 11:57 am #15645420 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, Thanks for contacting WPML forums support. I'll be glad to help you today. Please try the following steps: 1- Go to WPML-> Theme and plugins localization, select your theme/plugin, and scan Kindly check our guide to know more about translating texts in the admin texts screen. (https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/) Best regards, |
May 20, 2024 at 1:26 pm #15645993 | |
nikolaosM |
I think you did not even read our ticket. |
May 20, 2024 at 2:56 pm #15646625 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, I saw that you scanned the plugin and searched for the strings in String Translation, but I didn't notice that you checked the strings in the Admin Screen strings. Sorry about that. Please share screenshots of the strings in the front end and dashboard (Plugin Settings). Best regards, |
May 20, 2024 at 3:37 pm #15646865 | |
nikolaosM |
The strings are are not in the plugin settings. This is a Greek product page hidden link. And this is an English one hidden link. |
May 20, 2024 at 3:57 pm #15646877 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, Thanks for the screenshots. I can see the string in both languages in English. (Kindly check this hidden link) I would need to look closely at your site, so I would need to request temporary access (WP-Admin and FTP) Your answer will be private, meaning only you and I can access it. ❌ Please backup your database and website ❌ ✙ I need your permission to deactivate and reactivate the plugins and themes and change site configurations. This is also why the backup is critical. ✙ I also need your permission to take a local copy of your site to debug the issue without affecting your live site. Best regards, |
May 21, 2024 at 9:15 am #15649093 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, Thanks for the access details. I checked the issue and tried some workarounds with no luck. When you are logged in, you will see the strings in Greek in both languages and when you are logged out, you will see the strings in English in both languages. Please log in to this sandbox site and add the same message to the product page. (hidden link) I installed the Klarna plugin, created a product, and translated it. (hidden link) If the issue is replicable, please let me know to consult our compatibility team. Best regards, |
May 22, 2024 at 7:30 am #15654366 | |
nikolaosM |
You need to add credentials to be able to view klarna payment method in the front end. We can not use ours because it needs a shop to connect and we have already connected it with our client's shop. Can you contact with Klarna and get test credentials for the demo site? Thanks! |
May 22, 2024 at 10:03 am #15656865 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, I consulted our 2nd tier support team to check if we have a test account. I'll update you as soon as I get their reply. Best regards, |
May 23, 2024 at 12:21 pm #15662836 | |
nikolaosM |
Hello, How long is it going to take? |
May 23, 2024 at 12:33 pm #15662981 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, 1) Our compatibility team is trying to contact the plugin author, and it will take some time to debug the issue and check if we can provide a workaround; hence, the plugin is not officially compatible with WPML. 2) It would be great if you could contact the plugin's support and consult them regarding this issue. Best regards, |
May 27, 2024 at 7:21 am #15672285 | |
nikolaosM |
Hello guys, How is it going? We have been waiting for 2 days to see if you have an account to conect with Klarna. I think we have been waiting for long. Thanks! |
May 27, 2024 at 7:47 am #15672353 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, Sorry for the inconvenience. We are doing our best to reach the plugin author to find out what caused the issue and whether this string is translatable. Please let me know if you contacted the plugin support team regarding this issue. If you did, please let us know their reply. I'll update you as soon as I get an update from our compatibility team. Best regards, |
June 3, 2024 at 7:24 am #15696486 | |
nikolaosM |
Hello Osama, One week has passed. What is going on? |
June 3, 2024 at 11:40 am #15697700 | |
Osama Mersal Supporter
Languages: English (English ) Arabic (العربية ) Timezone: Africa/Cairo (GMT+02:00) |
Hi, Please let me know if you contacted the plugin author. If yes, please let us know their findings. Best regards, |