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.
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 31 replies, has 3 voices.
Last updated by 5 months, 1 week ago.
Assisted by: Osama Mersal.