Sha256: b4a4843d0f046eb065910f34e0926469e6f02065e0da9429babb28ef353b8d1b

Contents?: true

Size: 1.57 KB

Versions: 43

Compression:

Stored size: 1.57 KB

Contents

# Spot errors in schema translations (`MatchingSchemaTranslations`)

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

## Check Details

Add checks for eliminating translations mistakes in schema tags.

:-1: Examples of **incorrect** code for this check:

```liquid
{% 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 %}
```

:+1: Examples of **correct** code for this check:

```liquid
{% 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:

```yaml
MatchingSchemaTranslations:
  enabled: true
```

## Version

This check has been introduced in Theme Check 0.1.0.

## Resources

- [Rule Source][codesource]
- [Documentation Source][docsource]

[codesource]: /lib/theme_check/checks/matching_schema_translations.rb
[docsource]: /docs/checks/matching_schema_translations.md

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
theme-check-1.15.0 docs/checks/matching_schema_translations.md
theme-check-1.14.0 docs/checks/matching_schema_translations.md
theme-check-1.13.0 docs/checks/matching_schema_translations.md
theme-check-1.12.1 docs/checks/matching_schema_translations.md
theme-check-1.12.0 docs/checks/matching_schema_translations.md
theme-check-1.11.0 docs/checks/matching_schema_translations.md
theme-check-1.10.3 docs/checks/matching_schema_translations.md
theme-check-1.10.2 docs/checks/matching_schema_translations.md
theme-check-1.10.1 docs/checks/matching_schema_translations.md
theme-check-1.10.0 docs/checks/matching_schema_translations.md
theme-check-1.9.2 docs/checks/matching_schema_translations.md
theme-check-1.9.1 docs/checks/matching_schema_translations.md
theme-check-1.9.0 docs/checks/matching_schema_translations.md
theme-check-1.8.0 docs/checks/matching_schema_translations.md
theme-check-1.7.2 docs/checks/matching_schema_translations.md
theme-check-1.7.1 docs/checks/matching_schema_translations.md
theme-check-1.7.0 docs/checks/matching_schema_translations.md
theme-check-1.6.2 docs/checks/matching_schema_translations.md
theme-check-1.6.1 docs/checks/matching_schema_translations.md
theme-check-1.6.0 docs/checks/matching_schema_translations.md