Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translation for units of measure #31486

Open
5 tasks done
renrax opened this issue Dec 20, 2021 · 2 comments
Open
5 tasks done

Translation for units of measure #31486

renrax opened this issue Dec 20, 2021 · 2 comments

Comments

@renrax
Copy link

@renrax renrax commented Dec 20, 2021

Prerequisites

  • I have carried out troubleshooting steps and I believe I have found a bug.
  • I have searched for similar bugs in both open and closed issues and cannot find a duplicate.

Describe the bug

There is no translation for woocommerce units https://imgur.com/a/hzfvuXc.
To be more precise, it is there, but it is not displayed on the product pages https://imgur.com/a/ZR57aLK.

You added a value to the translation file. But it does not work for units.
Please, take a look at these articles, it will help you understand the essence of the existing Woocommerce Bug:
https://qna.habr.com/q/374588
https://soradmin.ru/kak-perevesti-lokalizirovat-edinicy-izmereniya-kg-m-cm-v-woocommerce/

Expected behavior

These articles find a temporary solution:

//You can change to your own units of measurement (kg, ft, m, mm .....)
function localize_weight_units($weight) {
return str_replace('g', 'г', $weight);
}
add_filter('woocommerce_format_weight', 'localize_weight_units');

function localize_demensions_units($dimensions) {
return str_replace('cm', 'см', $dimensions);
}
add_filter('woocommerce_format_dimensions', 'localize_demensions_units');

Actual behavior

...

Steps to reproduce

...

WordPress Environment

At the moment, the site is installed Twenty Twenty-One 1.4 theme and only one woocommerce plugin.

Isolating the problem

  • I have deactivated other plugins and confirmed this bug occurs when only WooCommerce plugin is active.
  • This bug happens with a default WordPress theme active, or Storefront.
  • I can reproduce this bug consistently using the steps above.
@juliaamosova
Copy link
Contributor

@juliaamosova juliaamosova commented Dec 23, 2021

Hi @renrax,

Thank you for opening the issue! It requires further feedback from the WooCommerce Core team. I am adding the needs developer feedback label to this issue so that the Core team could take a look.

Please note it may take a few days for them to get to this issue. Thank you for your patience.

@vedanshujain
Copy link
Contributor

@vedanshujain vedanshujain commented Jan 7, 2022

Thanks for the report @renrax, marking this as a bug. Also this looks like a good first issue, as we have to find where we are rendering this and add internationalization code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants