theme-tools icon indicating copy to clipboard operation
theme-tools copied to clipboard

`TranslationKeyExists` check not detecting translations in section schema

Open david-w-shopify opened this issue 11 months ago • 2 comments

Describe the bug When using the locales object in a section schema, Theme Check incorrectly flags them as missing

Image

Source

// section/test-section.liquid

<p>{{ 'sections.test-section.title' | t }}</p>
<p>{{ 'sections.test-section.description.desktop' | t }}</p>
<p>{{ 'sections.test-section.description.mobile' | t }}</p>

{% schema %}
{
  "name": "Section",
  "locales": {
    "en": {
      "title": "Title",
      "description": {
        "desktop": "Lorem ipsum dolor sit amet consectetur, adipisicing elit.",
        "mobile": "Lorem ipsum dolor sit amet"
      }
    }
  }
}
{% endschema %}

Expected behaviour No errors

Actual behaviour The first three lines all have TranslationKeyExists errors

Debugging information

  • OS: Mac
  • OS Version: Sequoia 15.2
  • Theme Check Version: 3.73.2

david-w-shopify avatar Jan 20 '25 10:01 david-w-shopify

Good catch. Seems like the auto-completion also ignores in-file translations.

Image

aswamy avatar Jan 21 '25 22:01 aswamy

Ah looks like you already reported that too ❤ https://github.com/Shopify/theme-tools/issues/720

aswamy avatar Jan 21 '25 22:01 aswamy