Shopify / slate

Slate is a toolkit for developing Shopify themes. It's designed to assist your workflow and speed up the process of developing, testing, and deploying themes.
https://shopify.github.io/slate
MIT License
1.28k stars 364 forks source link

Add @shopify/slate-translations plugin #1010

Closed bertiful closed 5 years ago

bertiful commented 5 years ago

What are you trying to accomplish with this PR?

We recently merged the @shopify/slate-sections-plugin into Slate. My current feels about the package: it focuses on one too many things.

  1. Support for the section folder structure (this is perfect).
  2. Support for separate locale files that then get merged into a schema upon build.

I feel like 2. should be encapsulated in its own package (e.g. @shopify/slate-translations (please let me know if this name sucks 🤦‍♂️, I had slate-locales at first 🤷‍♂️), that @shopify/slate-sections-plugin then imports. And this is what I've done in this PR.

Truth be told, I wouldn’t mind keeping the section plugin as is, but my concern lies when we’ll also need to support the possibility of adding a locales/ folder in src/config - leveraging the same functionality as we currently have in slate-sections-plugin but for the settings_schema.json file. This will be tackled in a future PR.

dan-gamble commented 5 years ago

This looks really awesome @chrisberthe! One question this raises with me is how this relates to https://github.com/Shopify/slate/pull/1001?

harshal317 commented 5 years ago

👋 I can help add the tests

bertiful commented 5 years ago

@dan-gamble while Slate is currently in low maintenance mode, there are things we realize we need to fix to further our own internal theme development, like supporting the same translations folder structure for src/config as we do for sections.

While we no longer have many resources on this project, we'll progressively work on small incremental features that need taking-care-of, like this one. How this applies to the rest of Slate is detailed in the README - this PR (and the next that I will create for src/config translations) will most likely be the last PRs to be merged.

dan-gamble commented 5 years ago

Thank you for the explanation @chrisberthe! Very insightful.

bertiful commented 5 years ago

Still wondering what the better name for this package should be. Have any thoughts on this @harshal317 @t-kelly? Perhaps being more descriptive is better, e.g. @shopify/slate-schema-locales or @shopify/slate-schema-translations.

harshal317 commented 5 years ago

Still wondering what the better name for this package should be. Have any thoughts on this @harshal317 @t-kelly? Perhaps being more descriptive is better, e.g. @shopify/slate-schema-locales or @shopify/slate-schema-translations.

I like the name you have already @shopify/slate-translations, most intuitive name imo

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.