For the complete documentation index, see llms.txt. This page is also available as Markdown.

Trim metafields.shopify translations

Ascent uses Shopify category metafields in places such as the product specification table and the product compare table. Those labels are translated with keys like:

{{ 'metafields.shopify.material' | t }}

Shopify's taxonomy can generate a very large metafields.shopify object in every storefront locale file. You can trim those keys when the store only uses a small set of category metafields.

What can be trimmed

Only trim keys inside:

{
  "metafields": {
    "shopify": {}
  }
}

Do not remove other translation groups unless you have checked where they are used.

Keep a metafields.shopify key when any of these are true:

  • The store has products with that Shopify category metafield.

  • The key is selected in a Product compare table block.

  • You are not sure whether a merchant may use it soon.

If a key is removed but the theme still renders {{ 'metafields.shopify.key' | t }}, the storefront can show a missing translation label. When in doubt, keep the key.

Build a keep list

Create a text file with one key per line:

Use the exact key after metafields.shopify.. For example, keep material for metafields.shopify.material.

Also include any keys configured in product compare table blocks. In Ascent, compare table blocks can read product.metafields.shopify[block.settings.key].

Trim all storefront locale files

Save the keep list as metafields-shopify-keep.txt, then run this script from the theme root:

Check the result

After trimming:

  • Search the theme for metafields.shopify. and confirm the required keys are still in the keep list.

  • Preview products that show the specification table.

  • Preview pages that use the Product compare table.

  • Check each enabled storefront language, especially the default language.

The values displayed for Shopify category metafields come from the product metafield values, such as value.label. The locale keys only control the field names shown by the theme.

Last updated