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

Translation File Cleanup

Krank displays Shopify category metafields in areas such as Product Specifications and Product Compare Table. Field names are output through translation keys similar to:

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

Shopify category taxonomy can generate a very large metafields.shopify object in each storefront language file. If a store only uses a small set of category metafields, these keys can be trimmed as needed to reduce translation file size.

What To Trim

Only trim keys inside this range:

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

Do not remove other translation groups unless they have been confirmed unused by the theme.

Keep a metafields.shopify key when:

  • Store products actually use this Shopify category metafield.

  • A Product Compare Table block is configured with this key.

  • The merchant may continue using this field later.

  • The field label needs exact wording, punctuation, acronyms, or special capitalization.

If a key is removed while the theme still renders {{ 'metafields.shopify.key' | t }}, the storefront may show a missing translation string or a machine-style key. When unsure, keep the key.

Where Krank Uses These Keys

Krank builds category metafield labels dynamically in:

The Product Specifications block loops through product.metafields.shopify. The Product Compare Table category block reads keys from block settings and then uses product.metafields.shopify[key].

Also check product templates and listing presets:

For example, a compare table may use configured keys such as shopify.vehicle-oil-features or shopify.viscosity.

Prepare A Keep List

Create a text file with one key per line:

Only write the part after metafields.shopify.. For example, metafields.shopify.material becomes material.

Include:

  • Keys used by real products.

  • Keys configured in Product Compare Table blocks.

  • Keys used by presets or demo products.

  • Keys that should keep exact human-written labels.

Batch Trim Storefront Locale Files

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

This trims only storefront translation files. It skips schema translation files such as en.default.schema.json.

Optional Fallback

If the theme should tolerate missing category metafield translations, add a Liquid fallback before trimming aggressively:

This keeps labels readable when a low-priority key is removed, but exact translations are still better for labels with acronyms, symbols, slash-separated wording, or unusual capitalization.

Check The Result

After trimming:

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

  • Preview a product that displays Product Specifications.

  • Preview a page that uses Product Compare Table.

  • Check all enabled storefront languages, especially the default language.

  • Confirm the storefront does not show raw strings such as metafields.shopify. or unresolved hyphenated keys.

The category metafield values come from the product metafield itself, such as value.label. These locale keys only control the displayed field names.

Last updated