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.