woocommerce is not using Wordpress language

Hi there

on the page www.muster-schmidt.ch I have issues with the language. It still displays certain texts in English instead of German. (I tried the languages "Germain" and German - Swiss"

I tried already deactivated all plugins, updates are done but still it is not working. Attached you find some screenshot of the chart not being partly in English and as well in the confirmation email of the client, there are English phrases too, whereas in the mails of woocommerce to the admin (you received a new order) all is fine.


In the Child-Theme there is under /languages/woocommerce/ the po and mo-Datea of woocommerce-de_CH displayed. Under /woocommerce/emails/ there are also some templates with small changes but nothing that should change the languages:

In functions.php I Force the load of de_CH language:

// Setze die Locale für WooCommerce auf Deutsch (Schweiz)

function custom_override_woocommerce_locale($locale, $domain) {

  if ($domain === 'woocommerce') {

    return 'de_CH';

  }

  return $locale;

}

add_filter('plugin_locale', 'custom_override_woocommerce_locale', 10, 2);


// Lade die WooCommerce-Übersetzungsdateien aus dem Child-Theme-Verzeichnis zur richtigen Zeit

function custom_load_woocommerce_translations() {

  $path = get_stylesheet_directory() . '/languages/woocommerce/woocommerce-de_CH.mo';

  if ( file_exists($path) ) {

    load_textdomain('woocommerce', $path);

    error_log('Sprachdatei erfolgreich geladen: ' . $path);

  } else {

    error_log('Sprachdatei nicht gefunden: ' . $path);

  }

}

add_action('init', 'custom_load_woocommerce_translations‘);


I have no idea what I can do to fix it - can you help me with it?

Many thanks, Tanja

Comments

Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.