-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added an internationalization sample app #94
Conversation
Should this be a completely different app? Or should we just augment and improve the existing one |
I think the other app should stay identical to the tutorial, so 3p and 1p can refer to it without surprises. |
There's also this sample app. Should we update/reuse that? |
It looks like this is demonstrating how we can do i18n inside a Rust function. Given that most of this is the app boilerplate, which is unrelated to i18n in the function, should we just add a function example here? |
Makes sense. I'll move the extension code to |
I think this is one folder too high, it should be put into one of the API folders ( |
@@ -0,0 +1,21 @@ | |||
# Shopify Function development with Rust |
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.
Should we start updating this READMEs with information about the function example? I think adding a description here would be useful for partners looking at this.
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.
Hm- is this examples repository intended to be browsed? 🤔
There's a lot of misc stuff in here, notably functions for unreleased APIs. I think there might be a fair amount of work involved in polishing this to be a good source of truth.
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 was under the impression that since it's public, and we have a set of examples here, that partners might take a look at it. If that's not the case, then ignore my comment 😄
} | ||
} | ||
discountNode { | ||
metafield(namespace: "discounts-tutorial", key: "volume-config") { |
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.
Should we be reusing the discounts-tutorial
namespace or should we have unique namespaces per example?
Should this be closed? 🤔 |
Why
We want to provide an example of i18n both here and on the Functions docs. This provides a way to localize the messages/display test in the Function depending on the buyers language.
How
I chose to use to
[rust-i18n](https://crates.io/crates/rust-i18n)
crate because it is popular and actively maintained. Similarly to the ruby-i18n gem, you store the translations in a YAML file, and these translations are loaded at runtime depending on a locale. In our case, the locale is obtained via the input query.What should the reviewer focus on
The extensions/volume part is the only part that differs from the tutorial.