qtranslate / qtranslate-xt

qTranslate-XT (eXTended) - reviving qTranslate-X multilingual plugin for WordPress. A new community-driven plugin soon. Built-in modules for WooCommerce, ACF, slugs and others.
GNU General Public License v2.0
558 stars 107 forks source link

Woocommerce tax classes issue #728

Closed sailinf closed 4 years ago

sailinf commented 5 years ago

Seems there is something not working well with tax classes. Not quite sure what as I do not get very consistent results. However, the tax class name is set to be translated (see image) and when I just edited the classes, the last two classes (but no other class) got duplicated, even though I seemed to have then named the same. The duplication resulted in the tax class called

[:fi]tax class name[:en]tax class name[:] ie, stored "coded"?

I was able to remove these spurious classes by removing the duplicated names, but the names still reappear after saving the "Tax options" page?

tax classes names duplicated

Seems to me there is not need for the tax class name in the "Tax options" to be translated and this would remove any issues?

herrvigg commented 5 years ago

The duplication is definitely wrong if the value is the same for all languages. But here you have the second one which has a different value. But, should this really be a translatable field?

sailinf commented 5 years ago

The window is so small so it does not show that there is a (hidden) duplicate entry also for alv0 class. In my opinion this does not need to be translatable?

herrvigg commented 5 years ago

If you want to disable it, it's here: https://github.com/qtranslate/qtranslate-xt/blob/d7d5b5909086283ecc22dd5d0e7b32b9ed3ad88a/modules/woo-commerce/qwc-admin.php#L171

In general i feel that purely functional fields should not be translated. However it seems this type of encoding called byline was made on purpose for this WooCommerce field. Check byline here: https://github.com/qtranslate/qtranslate-xt/wiki/JSON-Configuration

So better leave it, see what is the real need here and fix the bugs if there are some.

sailinf commented 5 years ago

Thanks, I disabled the field and the problem went away in that I could now delete the extra classes and they did not come back.