WP Manifestindependent plugin directory
manifest / i18n / woo-email-language-locker

WooCommerce Email Language Locker

Woocomemrce emails language plugin.

by Neevalex · github.com/neevalex/woo-email-language-locker

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/neevalex/woo-email-language-locker/archive/refs/heads/main.zip

Forces WooCommerce emails to use the language that was active when the order was created.

Supports:

  • WordPress\Woocommerce default locale switching
  • TranslatePress language capture/switching (best effort based on available TranslatePress functions/hooks)

Not tested with WPML

Also includes an admin panel with logs of the last 100 WooCommerce emails:

  • Email title
  • Recipient
  • Language
  • Order ID
  • WooCommerce Email ID
  • Timestamp

Install

  1. Copy the woo-email-language-locker folder into your WordPress wp-content/plugins directory.
  2. Activate WooCommerce Email Language Locker from the Plugins page.
  3. Ensure WooCommerce is active.

Where To Find Logs

In wp-admin, go to:

WooCommerce -> Email Language Logs

Settings

In wp-admin, go to:

WooCommerce -> Settings -> Emails -> Email Language Locker

Available setting:

  • Enable Email Logging (on/off)

How It Works

  1. On checkout/order creation, the plugin stores:
    • Current WordPress locale
    • Current TranslatePress language (when available)
  2. During WooCommerce email generation, the plugin switches language context to that saved order language.
  3. It restores the previous language context after rendering.
  4. It logs each rendered WooCommerce email entry (up to last 100 entries).

Notes

  • If an email is not order-based, language forcing is skipped for that email.
  • TranslatePress support is implemented defensively because different versions/installations may expose slightly different language APIs.