Schema Translation Issue in Shopify Theme

Topic summary

Issue: A Shopify theme section schema uses per-language objects for labels and preset names (e.g., “label”: {“en”: “Example Setting”, “fr”: “Paramètre Exemple”}) and includes a “locales” block inside the schema. Theme Check warns: “Incorrect type. Expected ‘string’” because schema fields like “label” and “name” must be strings, not objects.

Context: The Liquid translation filter {{ ‘sections’ | t }} works, but the schema localization approach is invalid.

Needed adjustments:

  • Replace objects with translation keys using the t: prefix, e.g.,
    • “name”: “t:sections.slideshow.name”
    • “settings”: [{ “label”: “t:sections.example_setting.label”, … }]
  • Move actual translations to locales files (e.g., locales/en.default.json, locales/fr.json) with matching keys.
  • Remove the “locales” block from the schema; it’s not supported there.

Status: No resolution posted yet; OP is requesting guidance on proper localization in schema and Theme Check compliance.

Summarized with AI on December 16. AI used: gpt-5.
{{ 'sections' | t }}

{% schema %}
{
  "name": "t:sections_title_title",
  "settings": [
    {
      "type": "text",
      "id": "example_setting",
      "label": {
        "en": "Example Setting",
        "fr": "Paramètre Exemple"
      }
    }
  ],
  "presets": [
    {
      "name": {
        "en": "Slideshow",
        "fr": "Diaporama"
      }
    }
  ],
  "locales": {
    "en": {
      "sections_title": "Slideshow"
    },
    "fr": {
      "sections_title": "Diaporama"
    }
  }
}
{% endschema %}

While using {{ ‘sections’ | t }}, it works fine in the Shopify theme. However, I’m getting a warning from theme-check stating: “Incorrect type. Expected ‘string’” for the “label”: { “en”: “Example Setting”, “fr”: “Paramètre Exemple” }" section.

How can I properly translate the section for localization? What adjustments do I need to make?

Thank you, guys!

1 Like