missning translation en.layout.cart.cart

Highlighted
New Member
3 0 0

Getting  a message very quick as soon as homepage loads saying translation missing: en.layout.cart.cart

I checked the edit language under the theme actions and nothing seems to be missing. What is causing this and how do i fix this?

0 Likes
Highlighted
Astronaut
1112 150 285

There's a missing translation in one of your theme files. Open up your Locales folder in Online Store > Themes > Actions > Edit Code on the theme you want to correct. In the locales folder there will be a file called en.default.json. You're looking for your layout section, the sections look like this:

 

  "layout": {
    "navigation": {
      "search": "Search",
      "expand": "expand",
      "collapse": "collapse",
      "menu": "Menu"
    },
    "cart": {
      "title": "Cart",
      "items_count": {
        "one": "item",
        "other": "items"
      }
    },

Whatever text you want to appear where you see the error, you could add the property to the "cart" object inside of the "layout" object. Your file is referencing "layout.cart.cart" so it's going into the layout section and looking for an object called cart, and then looking inside of cart for a property called cart. This is my default debut theme, and as you can see, there is no property inside of cart called cart. Not sure if someone made a typo somewhere in your theme, but in my case if you typed:

 

{{ 'layout.cart.title'  | t }}

This would output the word "Cart". So you either have to find in the code where that little snippet is and change:

 

{{ 'layout.cart.cart'  | t }}

to what I have typed above, or you can add a property to the cart object inside your layout object for whatever you want to say:

 

  "layout": {
    "navigation": {
      "search": "Search",
      "expand": "expand",
      "collapse": "collapse",
      "menu": "Menu"
    },
    "cart": {
      "cart": "Cart",
      "title": "Cart",
      "items_count": {
        "one": "item",
        "other": "items"
      }
    },

I'd suggest fixing it where it is written out however, because all your other locale files that do any kind of translating will not have the additional property you add. 

If my solution helped you, please like and accept as solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes
Highlighted
New Member
3 0 0

it looks like my code has it all there correct. not seeing anything in the code showing cart.cart.

"layout": {
    "cart": {
      "title": "Cart"
    },
    "customer": {
      "account": "Account",
      "logged_in_as_html": "{{ first_name }}",
      "log_out": "Log out",
      "log_in": "Log in",
      "create_account": "Create account"

i only see the code on the page before everything loads then it seems to get covered up. but when i look at the page source im seeing this

 

<span class="icon icon-cart"></span>
            translation missing: en.layout.cart.cart 
<span id="cartCount" class="hidden-count">0</span>

am i totally missing something?

0 Likes
Highlighted
Astronaut
1112 150 285
Yeah so, you can see in your layout object there is a "cart" object inside of it, and you can see in your cart object that there is no "cart" property, there is only a "title" property. That means that there is a typo wherever in your theme the liquid output is. If you'd like, I can track this down for you and fix it. Otherwise if you think you can find it, you just need to change it from:

{{ 'layout.cart.cart' | t }}

to

{{ 'layout.cart.title' | t }}

I will just need your url to ask for access to your themes
If my solution helped you, please like and accept as solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes
Highlighted
New Member
3 0 0

actually just found this in my theme.liquid file

<a href="/cart" class="header-cart-btn cart-toggle">
            <span class="icon icon-cart"></span>
            {{ 'layout.cart.cart' | t }} <span id="cartCount" {% if cart.item_count == 0 %}class="hidden-count"{% endif %}>{{ cart.item_count }}</span>
          </a>

What should that be changed to?

0 Likes
Astronaut
1112 150 285

change it to 

 

{{ 'layout.cart.title' | t }}
If my solution helped you, please like and accept as solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes