Shopify Locale File Limit: Cracking the 3,400 Key Mystery in Multi-Language Stores

Hey there, fellow Shopify store owners and developers!

Running a successful online store often means reaching a global audience, and that means offering your content in multiple languages. Shopify does a fantastic job of supporting multi-language stores, but every now and then, you might bump into a quirky technical limit. Recently, we saw a great discussion pop up in the Shopify Community that shed light on one such limit: the 3,400 key limit in theme locale files. It’s a niche issue, but if you hit it, it can be a real head-scratcher!

Decoding the Locale File Limit: What Happened to ivoivo?

Our community member, @ivoivo, ran into this exact problem. They were diligently managing their store’s translations, specifically with their Latvian locale file, lv.json. While their default English file, en.default.json, was a lean 502 keys, their lv.json had ballooned to around 3,400 translatable value keys. Everything looked fine syntactically – no missing commas, broken brackets, or invalid JSON. Yet, Shopify support pointed to the lv.json file hitting a limit.

This is a classic scenario for multi-language stores, especially those that have undergone several theme updates or used various translation apps over time. Old, unused translation keys can accumulate, turning your locale files into digital hoards.

The Community's Consensus: Synchronize Your Keys

The solution, as highlighted by @SectionKit in the thread, is quite straightforward: your translated locale files should ideally mirror the keys found in your default locale file.

As @SectionKit put it, "Your lv.json has way more keys than it needs. Since your en.default.json only has 502 keys, your lv.json should match that. Any extra keys can be safely removed." This is the core principle to remember. If a key doesn't exist in your en.default.json (or whatever your primary language is), it likely doesn't need to be in your translated files either.

Why Not Split the File?

@ivoivo also asked if splitting the locale file was a viable option. This is a natural thought when encountering file size or key limits. However, @SectionKit provided a clear answer: "Splitting the file is not supported by Shopify, so removing unused keys is the right approach!" This is crucial information, as attempting to split files could lead to more headaches and unsupported configurations.

Step-by-Step: How to Clean Up Your Locale Files

So, how do you actually go about cleaning up these files? It's less daunting than it sounds, especially with the right tools. Here’s a practical guide based on the community's advice:

  1. Identify the Culprit: You've already done this if you're reading this article! It's usually a translated locale file that has significantly more keys than your en.default.json.
  2. Access Your Theme Files:
    • From your Shopify admin, go to Online Store > Themes.
    • Find your current theme, click Actions > Edit code.
    • Navigate to the Locales folder.
  3. Download Your Locale Files: Download both your en.default.json file and the oversized locale file (e.g., lv.json). You can click on each file and then click the "Download" button at the top right.
  4. Get a Comparison Tool: This is where @Maximus3's excellent suggestion comes in. Using a code editor with JSON comparison capabilities makes this task much easier.
    • VS Code: Download Visual Studio Code (it's free and fantastic!).
    • Install a JSON Extension: Search for and install a JSON comparison or validation extension within VS Code. @Maximus3 shared a screenshot of one such extension, which helps visualize differences.

  5. Compare and Prune: Open both en.default.json and your oversized file (e.g., lv.json) in VS Code. Use the comparison feature of your chosen extension to identify keys in lv.json that do not exist in en.default.json. Carefully delete these extra keys from lv.json. Be meticulous to avoid accidentally deleting valid keys or introducing syntax errors. Focus on keys related to old apps, removed features, or previous theme versions.
  6. Validate Locally (Optional but Recommended): Before uploading, use an online JSON validator or a VS Code extension to quickly check your modified lv.json for any syntax errors.
  7. Upload the Cleaned File: Back in your Shopify admin's code editor, open the lv.json file, delete its entire content, and then paste in the content of your newly cleaned lv.json file. Save your changes.

This process ensures your translation file is lean, efficient, and well within Shopify's operational limits. It's a bit like spring cleaning for your digital storefront!

Keeping Your Locale Files Tidy

To avoid hitting this limit again, it’s a good practice to periodically review your locale files, especially after major theme updates or when uninstalling apps that might have added their own translation keys. Keeping your default locale file (like en.default.json) as the "source of truth" for your key structure is key. Any other language files should ideally only contain translations for those existing keys, not entirely new ones.

So, if you find yourself staring down a "3,400 key limit" error, don't panic! The community has shown us that a little comparison and careful pruning of unused keys is all it takes to get your multi-language store back on track. It's a testament to the power of a clean codebase and the helpfulness of the Shopify community!

Share:

Use cases

Explore use cases

Agencies, store owners, enterprise — find the migration path that fits.

Explore use cases