How to translate {{ count }} value in Admin Translation for Japanese audience?

Hello,

The site I’m working on is for a Japanese audience, so I’m making heavy use of the Admin Translation area, and all is going well so far, bar a small issue when displaying the cart (and mini-cart) total item quantity.

I am having issues using any key:value that uses braces, eg. {{ count }}. The value in the {{ count }} is not being pulled into the translation, leaving the original English braces and word {{ count }} in place.

Eg, showing an item count in English – 2 items – in Japanese would be – 商品2点 – but when I use the translation in a liquid template, I get 商品{{ count }}点

Code in the liquid template at the moment as it was working for English formatting;

{{ cart.item_count }} {{ 'collections.general.items_with_count.other' | t }}

How do I get the {{ ‘collections.general.items_with_count.other’ | t }} part to pull in {{ count }} and properly include the quantity?

Image attached showing the desired Translation panel key and values here — https://capture.dropbox.com/F9IaQk7uz68L3a7b

Thanks in advance
jake

Let’s try this code:

From:

{{ cart.item_count }} {{ 'collections.general.items_with_count.other' | t }}

To:

{{ 'collections.general.items_with_count.other' | t: count: cart.item_count }}
1 Like

Thanks for the reply, and apologies for the delay. That works perfectly!

Much appreciated
jake

1 Like