translation missing: en.products.back_to_collection - FIX? Photo Provided

Solved
LELLY
Tourist
4 0 1

Currently trying to figure out why every product page has this at the bottom of every product.

Seems like there may be a typo somewhere in the code (not sure) but cannot seem to find it. Where should I be looking to fix this issue?

I tried going to Edit Languages and to the Products tab but that doesn't fix it.

Any feedback is appreciated!

 

2020-08-31 08_54_08.png

0 Likes
BryanB21
Tourist
9 1 0

Can you post the code from your products.liquid file? That is where the translation error is occurring.

0 Likes
LELLY
Tourist
4 0 1

Hi Bryan. i've pasted the code below from the products.liquid file...

 

{%- include 'bold-product' with product, hide_action: 'break', output: 'none' -%}
{% comment %}
  The contents of the product.liquid template can be found in /sections/product-template.liquid
{% endcomment %}

{% section 'product-template' %}
{% section 'product-recommendations' %}

{% if collection %}
  <div class="text-center return-link-wrapper page-width">
    <a href="{{ collection.url }}" class="btn btn--secondary btn--has-icon-before return-link">
      {% include 'icon-arrow-left' %}
      {{ 'products.back_to_collection' | t: title: collection.title }}
    </a>
  </div>
{% endif %}

<script>
  // Override default values of shop.strings for each template.
  // Alternate product templates can change values of
  // add to cart button, sold out, and unavailable states here.
  theme.productStrings = {
    addToCart: {{ 'products.product.add_to_cart' | t | json }},
    soldOut: {{ 'products.product.sold_out' | t | json }},
    unavailable: {{ 'products.product.unavailable' | t | json }}
  }
</script>

{% assign current_variant = bold_selected_or_first_available_variant %}
{%- include 'bold-variant' with current_variant, output: 'none' -%}

<script type="application/ld+json">
{
  "@context": "http://schema.org/",
  "@type": "Product",
  "name": {{ product.title | json }},
  "url": {{ shop.url | append: product.url | json }},
  {%- if product.featured_media -%}
    {%- assign media_size = product.featured_media.preview_image.width | append: 'x' -%}
    "image": [
      {{ product.featured_media | img_url: media_size | prepend: "https:" | json }}
    ],
  {%- endif -%}
  "description": {{ product.description | strip_html | json }},
  {%- if current_variant.sku != blank -%}
    "sku": {{ current_variant.sku | json }},
  {%- endif -%}
  "brand": {
    "@type": "Thing",
    "name": {{ product.vendor | json }}
  },
  "offers": [
    {%- for variant in product.variants -%}
{%- include 'bold-variant' with variant, hide_action: 'skip' -%}
      {
        "@type" : "Offer",
        {%- if variant.sku != blank -%}
          "sku": {{ variant.sku | json }},
        {%- endif -%}
        "availability" : "http://schema.org/{% if product.available %}InStock{% else %}OutOfStock{% endif %}",
        "price" : {{ bold_variant_price | divided_by: 100.00 | json }},
        "priceCurrency" : {{ cart.currency.iso_code | json }},
        "url" : {{ shop.url | append: variant.url | json }}
      }{% unless forloop.last %},{% endunless %}
    {%- endfor -%}
  ]
}
</script>

 

0 Likes
BryanB21
Tourist
9 1 0

This is an accepted solution.

Lets make sure the href is going to where you need it to go. Where is says  <a href="{{ collection.url }}" class="btn btn--secondary btn--has-icon-before return-link"> {% include 'icon-arrow-left' %} {{ 'products.back_to_collection' | t: title: collection.title }} </a>  in the file, replace it with this:

 <a href="{{ collection.url }}" class="btn btn--secondary btn--has-icon-before return-link"> {% include 'icon-arrow-left' %} {{  'Back to Collections'  }} </a> 

If it shows no error then its the way the t is being called. You may have to change it to {{ 'products.back_to_collection' | t | title: collection.title }}

0 Likes
LELLY
Tourist
4 0 1

First code replacement worked great, second change recommendation showed the same error as I had before.

 

But thank you Bryan, really appreciate your knowledge and time!

ASKARI
Tourist
8 0 2

hi Bryan,

i got the same problem and still have actually. this happened righter after installing GTranslate.

i dont what to do  

0 Likes
BryanB21
Tourist
9 1 0

What page are you having this issue on? Can you paste the code or screen shot? This happened after installing Google Translate correct? It could be that the code is not picking up the cdn for google and still trying to pull from the language in the schema.

0 Likes
ASKARI
Tourist
8 0 2

Hi Bryan, 

no GTranslate is not google translate in this case, it is another third party app ( which their support shut the help down) for translation and language switching. i uninstalled the app ofcourse but didnt help either.

i have the same issue (translation on every page of my shop. see the screenshots. thanks for your time and knowledge.

photo_2020-11-06_11-31-44.jpgphoto_2020-11-06_11-31-56.jpgphoto_2020-11-06_11-32-12.jpgphoto_2020-11-06_12-03-15.jpg

0 Likes
BryanB21
Tourist
9 1 0

Well there are two ways to fix this. The first is to manual put in the name and not rely on the translation feature. This is what I usually do since I modify a lot on my store. But it will involve going into to each of the liquid pages and changing them like the example above. The second is the modify the schema in the language section and make sure the translations are being called correctly. The first way shouldn't take more than 30 mins to do. 

It looks like even though you removed the app, there is still a script running most likely in the theme.liquid file that is causing this issue. It looks like every translation call is being overwritten. If you go to the pages that have this issue and press F12 you can possibly debug it from there before messing with the live code.

If you have any questions on that please let me know. But I would recommend finding the script that is causing this first.

0 Likes
ASKARI
Tourist
8 0 2

dear Bryan,

i went for the second way, in which i fixed going through language section and fixed the missing errors manaualy. since i'm not that good with codes. this way seemed easier but took longer as u mentioned. now i have no more missing translation, however i'm worried about the snippet or leftover of the app in my script! which i assume are still there. is it very bad or ..?! 

thanks for your time and help.

regards,

askari

0 Likes