• As I just looked for strings that may need translation, I found a case of very incorrect use of _n()

    Unfortunately, I only have references to minified files, so you may need to search where the following pair of strings was used placed.

    Singular: <price/>
    Plural: <price/> x <packageCount/> packages
    Translators comment: %1$s name of the product (ie: Sunglasses), %2$d number of units in the current cart package
    References:
    – packages/woocommerce-blocks/build/checkout-blocks/pickup-options-frontend.js:3
    – packages/woocommerce-blocks/build/checkout.js:45

    The problem?
    1. Some languages don’t have separate forms for plural. In those cases, you’ll probably get only “singular”, unless the translator is smart enough to inject the packageCount placeholder.

    2.Some languages use the “singular” string not only for n = 1, but also for, say, 21, 31, 41, etc. Imagine you’ve added 20 units, and then you up it once again, and suddenly it looks as if you’ve only ordered ONE.

    This seems to have been committed by @samueljseay so I’ll mention them to quickly reach attention with the developers.
    If you need more clarification, then in-house you could ask @akirk @nao or @evarlese for more information.

Viewing 1 replies (of 1 total)
  • Plugin Contributor Sam

    (@samueljseay)

    Thanks for raising this!

    I have passed it on to devs responsible for this area and I hear a fix is on it’s way.

Viewing 1 replies (of 1 total)
  • The topic ‘Very incorrect use of _n() in checkout and checkout-blocks’ is closed to new replies.