-
Notifications
You must be signed in to change notification settings - Fork 198
[Feature] Add l10n support to CheckoutUiExtension #2009
Conversation
4de0d27
to
f1338d9
Compare
f1338d9
to
a03df68
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work, @ginmrt ✨
lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb
Show resolved
Hide resolved
lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb
Outdated
Show resolved
Hide resolved
test/project_types/extension/models/specification_handlers/checkout_ui_extension_test.rb
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some early feedback. Looks fine overall. I still need to tophat.
lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb
Show resolved
Hide resolved
lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb
Outdated
Show resolved
Hide resolved
lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb
Outdated
Show resolved
Hide resolved
a03df68
to
88d6e2b
Compare
@ginmrt do you mind rebasing this PR onto latest |
bccaa1d
to
e961448
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I 🎩'd with a handpicked list of test scenarios and they all checked out for me. Great work Martin.
There is one additional fix that I am requesting before merge though. Once that is addressed, then I can approve.
lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb
Outdated
Show resolved
Hide resolved
e961448
to
c936b9e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still have open feedback that should be given consideration. But overall, I've seen enough from this PR to approve.
c936b9e
to
a189992
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a few suggestions, but the only important one would be to extract the error messages. Otherwise, the code and tests look great (I haven't tested it, as it was done before) 👌
lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb
Outdated
Show resolved
Hide resolved
lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb
Outdated
Show resolved
Hide resolved
lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb
Show resolved
Hide resolved
lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb
Outdated
Show resolved
Hide resolved
test/project_types/extension/models/specification_handlers/checkout_ui_extension_test.rb
Outdated
Show resolved
Hide resolved
a189992
to
bcdae00
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes! It looks great 👍
WHY are these changes introduced?
Fixes internal issue
WHAT is this pull request doing?
As part of the Localized Checkout Ui Extensions project, we must update the
shopify-cli
codebase to allow developers to submit localization files along with their code updates when the Shopify CLIshopify extension push
command is executed.This change applies to the Checkout Extension type of extensions only, for now.
Screenshots
Valid submission
This will be what is shown in the CLI when we will have merged in the code in the Shopify backend that will support this new localization feature.
Valid submission with unrecognized key warning
This will be what is shown in the CLI before and until we will have merged in the code in the Shopify backend that will support this new localization feature.
Note that attempting to publish an extension with this data pushed in before support has been added will fail.
Invalid submission: Invalid locale code
This error appears if the locale code of a given file name is invalid.
Invalid submission: Invalid file extension
This error appears if a file under the
/locales
folder has an extension type other than.json
Invalid submission: File too large
This error appears if a localization file is larger than the declared limit
Invalid submission: File empty
This error appears if a localization file is completely empty
Invalid submission: Sum of all file sizes too large
This error appears if the combined total size of all localization files exceeds the declared limit
Invalid submission: No default / too many defaults
This error appears if none of the provided locale files are declared as the default locale, or if more than one of them are.
How to test your changes?
CheckoutUiExtension
extension project setup.locales
directory at the root of the created extension project of type Checkout Extension.default
, e.g.en.default.json
andfr.json
shopify extension push
command.Various simple validations exist, which can be tested by playing around with the filenames under
locales
and their content. Refer to the screenshots provided above.Update checklist