Skip to content

Latest commit

 

History

History
93 lines (77 loc) · 1.57 KB

matching_schema_translations.md

File metadata and controls

93 lines (77 loc) · 1.57 KB

Spot errors in schema translations (MatchingSchemaTranslations)

Validates translations in schema tags ({% schema %}).

Check Details

Add checks for eliminating translations mistakes in schema tags.

👎 Examples of incorrect code for this check:

{% comment %}
  - fr.missing is missing
  - fr.extra is not in the default locale
{% endcomment %}
{% schema %}
  {
    "locales": {
      "en": {
        "title": "Welcome",
        "missing": "Product"
      },
      "fr": {
        "title": "Bienvenue",
        "extra": "Extra"
      }
    }
  }
{% endschema %}

{% comment %}
  - The French product label is missing.
{% endcomment %}
{% schema %}
  {
    "name": {
      "en": "Hello",
      "fr": "Bonjour"
    },
    "settings": [
      {
        "id": "product",
        "label": {
          "en": "Product"
        }
      }
    ]
  }
{% endschema %}

👍 Examples of correct code for this check:

{% schema %}
  {
    "name": {
      "en": "Hello",
      "fr": "Bonjour"
    },
    "settings": [
      {
        "id": "product",
        "label": {
          "en": "Product",
          "fr": "Produit"
        }
      }
    ]
  }
{% endschema %}

Check Options

The default configuration for this check is the following:

MatchingSchemaTranslations:
  enabled: true

Version

This check has been introduced in Theme Check 0.1.0.

Resources