woocommerce / woocommerce

A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine.
https://woocommerce.com
9.43k stars 10.77k forks source link

"Backordered" meta key shouldn't be translatable? #52698

Open kkmuffme opened 2 weeks ago

kkmuffme commented 2 weeks ago

Prerequisites

Describe the bug

https://github.com/woocommerce/woocommerce/blame/trunk/plugins/woocommerce/includes/class-wc-order-item-product.php#L230

For some reason, this meta key is translatable.

We recently encountered an issue where seemingly out of nowhere backorders were completely broken - turns out, someone in our team updated the (custom) translations including that backordered string.

This is the only meta key that is translatable it seems, what exactly is the purpose of that?

Doesn't this also mean that if we have some (admin) users that use WP in a different language, that the backorders will be broken for them too, eventually creating a huge mess?

Expected behavior

meta key shouldn't be translatable

Actual behavior

Is translatable

Steps to reproduce

  1. Open eyes
  2. Look at the code
  3. Use brain

WordPress Environment

WC 9.3+

Isolating the problem

naman03malhotra commented 2 weeks ago

👋 @kkmuffme thanks for reporting it, seems like a valid bug to us. We'll try to get to it in upcoming cycles. We would also be happy to accept PR for this change if you'd like to expedite this fix.