woocommerce-blocks icon indicating copy to clipboard operation
woocommerce-blocks copied to clipboard

ProductDetails should have a translation independent class name on the <li> element

Open helgatheviking opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe.

The output of ProductDetails renders an unordered list

<ul class="wc-block-components-product-details">
    <li class="wc-block-components-product-details__includes"><span class="wc-block-components-product-details__name">Includes:</span> <span class="wc-block-components-product-details__value">Chocolate Chip Cookie × 1</span></li>
    <li class="wc-block-components-product-details__includes"><span class="wc-block-components-product-details__name">Includes:</span> <span class="wc-block-components-product-details__value">Macadamia Nut Cookie × 1</span></li>
    <li class="wc-block-components-product-details__includes"><span class="wc-block-components-product-details__name">Includes:</span> <span class="wc-block-components-product-details__value">Oatmeal Raisin Cookie × 1</span></li>
</ul>

The wc-block-components-product-details__includes class is generated from a translatable string (in this example "Includes"). That means the class will change depending on the translation.

Describe the solution you'd like

I'd like to see the CSS class be static and separate from the name that is displayed... likely need to not use name for both class and display.

helgatheviking avatar Jun 02 '22 14:06 helgatheviking

Thank you! this seems like a bug more than an enhancement request, I labeled it correctly.

senadir avatar Jun 04 '22 14:06 senadir

You're probably right! I just wasn't sure. If key and name both are in the props, I think key could be used as the class? And then display name which seems more likely to be translated?

helgatheviking avatar Jun 04 '22 15:06 helgatheviking

This issue has been marked as stale because it has not seen any activity within the past 60 days. Our team uses this tool to help surface issues for review. If you are the author of the issue there's no need to comment as it will be looked at.

Internal: After 10 days with no activity this issue will be automatically be closed.

github-actions[bot] avatar Aug 04 '22 09:08 github-actions[bot]