Skip Navigation

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: 

This topic contains 31 replies, has 3 voices.

Last updated by George Botsev 5 months, 1 week ago.

Assisted by: Osama Mersal.

Author Posts
June 20, 2024 at 11:52 am #15763447

nikolaosM

Hello Osama,

Please contact your colleagues from the 2bd tier support and send them this https://wordpress.org/support/topic/wpml-problem-17/#post-17838466. This is how you contact the plugin authors / support team so they can provide you with an easy solution, so that you don't have to search the whole plugin files to find out how the strings are generated and be forced to make changes in the plugin files, changes that will have to be made every time the plugin gets updated.

We can not imagine how a user that has a simple WordPress account can get better support from WPML.

We have been waiting for a whole month to find a solution to this, and the problem was on a live site. This is unacceptable.

June 20, 2024 at 1:15 pm #15764002

George Botsev
Supporter

Languages: English (English )

Timezone: Europe/Sofia (GMT+02:00)

Hello! I am George from the second level of support.
Thank you for sharing the link to your support ticket, and I am sorry for the slow experience that you are having with our support.

At present, the plugin `Klarna Payments for WooCommerce` is not one of the supported plugins that our compatibility team tested.
This usually means that once we assess such a plugin, we attempt to provide a suitable workaround and attempt to contact the plugin author.

Your ticket in the plugin support forum definitely helped as we also received a feedback by the plugin author a couple of days ago -> roughly at the same time as they responded to you: https://wordpress.org/support/topic/wpml-problem-17/#post-17835768

Once we have established proper assistance and compatibility with the plugin author, the plugin will be listed among our officially compatible plugins. Until then you have to be aware that there is always a potential for other problems - as the plugin was not thoroughly tested, so it might not be entirely suitable for production use.