Skip to content

valid-schema-translations theme check#1123

Merged
aswamy merged 1 commit intomainfrom
02-05-valid-schema-translations_theme_check
Feb 5, 2026
Merged

valid-schema-translations theme check#1123
aswamy merged 1 commit intomainfrom
02-05-valid-schema-translations_theme_check

Conversation

@aswamy
Copy link
Contributor

@aswamy aswamy commented Feb 5, 2026

What are you adding in this PR?

Part of #942

Added a new theme check called ValidSchemaTranslations that ensures all translation keys (t:) in schema have matching entries in the default schema translations file. This check supersedes the existing ValidSchemaName which only checked the schema.name value (along with a few more things).

The PR:

  • Creates a new check that recursively finds all string values starting with 't:' in schema JSON
  • Verifies each translation key has a corresponding entry in the translations file
  • Reports error messages for missing translations
  • Moves the translation existence check from ValidSchemaName to this new dedicated check

Tophat

Here is a schema you can test out the new theme-check (assuming you don't have t:general.headerfoo in your en.default.schema.json

{% schema %}
{
  "name": "t:general.headerfoo",
  "default": {
    "text": "t:general.headerfoo",
    "select": "option",
    "radio": "option",
  },
  "settings": [
    {
      "type": "text",
      "id": "text",
      "label": "t:general.headerfoo",
    },
    {
      "type": "select",
      "id": "select",
      "label": "t:general.headerfoo",
      "options": [
        {
          "group": "Select Group 1",
          "label": "t:general.headerfoo",
          "value": "option",
        },
        {
          "group": "Select Group 1",
          "label": "Option 2",
          "value": "option2",
        },
      ]
    },
    {
      "type": "radio",
      "id": "radio",
      "label": "Radio",
      "options": [
        {
          "label": "Option",
          "value": "option",
        }
      ],
    }
  ],
  "presets": [
    {
      "name": "Alok Section",
      "category": "t:general.headerfoo",
      "settings": {
        "text": "t:general.headerfoo",
        "select": "option",
        "radio": "option",
      }
    }
  ]
}
{% endschema %}

What's next? Any followup issues?

  • Updating shopify-dev so that we have it documented

Before you deploy

  • This PR includes a new checks or changes the configuration of a check
    • I included a minor bump changeset
    • It's in the allChecks array in src/checks/index.ts
    • I ran yarn build and committed the updated configuration files
    • I've made a PR to update the shopify.dev theme check docs if applicable.
      • I will do so after this PR since we aren't cutting a release for this theme-check yet

Copy link
Contributor Author

aswamy commented Feb 5, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@aswamy aswamy marked this pull request as ready for review February 5, 2026 19:36
@aswamy aswamy requested a review from a team as a code owner February 5, 2026 19:36
Copy link
Contributor

@charlespwd charlespwd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful 👌

Copy link
Contributor Author

aswamy commented Feb 5, 2026

Merge activity

  • Feb 5, 7:56 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Feb 5, 7:56 PM UTC: @aswamy merged this pull request with Graphite.

@aswamy aswamy merged commit 4ff5b8a into main Feb 5, 2026
8 checks passed
@aswamy aswamy deleted the 02-05-valid-schema-translations_theme_check branch February 5, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants