themekit
themekit copied to clipboard
theme new is creating en.default.json even if there's already a default language
Describe the bug
So like I was saying in the last issue, we are starting to implement some automations to our workflow. I built something that will setup a project for us which will first do theme download
, then theme new --name="QA Theme" --env=qa
and then theme new --name="Dev - Developer name" --env="development"
. This will work in most cases but I stumbled upon a theme that had a fr.default.json in the locales folder. In this case "theme new" will also create an en.default.json file which will create an error when uploading the files to the "QA Theme" because there can only be one default language.
To Reproduce Steps to reproduce the behavior:
- in the locales folder have a fr.default.json
- run theme new
Expected behavior Skip the creation of en.default.json if there's already another default language file.
Environment (please complete the following information):
- OS [e.g. iOS]: windows 10
- Themekit version (run theme version to check): 1.1.4
- Editor [e.g. atom, sublime]: vs code
Hi, I had the same problem and I resolved renaming my 'en.default.json' to 'en.default.schema.json' and that avoided the duplication of locales. If you have more languages only create 'en-GB.schema.json' names to add.
Resources: https://shopify.dev/themes/architecture/locales