-
Notifications
You must be signed in to change notification settings - Fork 323
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
Use lang directive #1028
Use lang directive #1028
Conversation
…ase in the provider
31cb73e
to
7e74d4e
Compare
d6b2034
to
67ecff9
Compare
67ecff9
to
0ff34df
Compare
This comment has been minimized.
This comment has been minimized.
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, @michenly! Left a few suggestions as well as a couple comments about two other files that need some minor updates.
fdfcc66
to
661ce0f
Compare
packages/hydrogen/src/components/LocalizationProvider/LocalizationQuery.graphql
Outdated
Show resolved
Hide resolved
packages/hydrogen/src/components/LocalizationProvider/LocalizationQuery.ts
Outdated
Show resolved
Hide resolved
.changeset/hungry-scissors-cross.md
Outdated
'test-server-components': patch | ||
--- | ||
|
||
Starting from SF API version `2022-04`, the prefer way to request for translatable resources is using the `@inContext` directive. See [API docs](https://shopify.dev/api/examples/multiple-languages#retrieve-translations-with-the-storefront-api) on how to do this and which resources have translatable properties. |
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.
It seems a bit unfortunate to me that this can't be more automatic, but has to be so manual.
571ea36
to
ba6bdc6
Compare
e76f326
to
a6bfbe0
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.
Thank you for tackling 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.
Thanks for taking on this work and getting it done! 👍
* remove lang code from shop query's header * add lang directive to localization provider & add languageCode to useShop * add lang directive to all the query that support lang in demo store * fix test * update shopify provider type and conver locale & lang code to upper case in the provider * fix test * update doc * add changeset * update test * edit docs * Remove LocalizationQuery.graphql and its type * doc fix
* v1.x-2022-07: [Hydrogen docs]: Analytics (#962) Analytics (#890) Allow line breaks inside script tags (#1061) Fix encoding of CSS Modules to solve hydration errors (#1062) [Hydrogen docs]: Update guidance on troubleshooting third-party dependencies (#1055) Update Vite RSC Plugin (#1054) Fix link prefetch (#1059) Initial devTools component (#998) Support sub request cache control header `stale-while-revalidate` everywhere (#1049) Fix cookie parsing (#1046) Update 3-external-images-with-a-custom-loader.example.tsx (#1045) Restore scroll position on browser navigation (#1047) Remove old changeset to unblock release (#1042) [ci] release v1.x-2022-07 (#1019) Update to Vite 2.9 (#1039) Use lang directive (#1028)
Description
Switch to using language directive instead of header to query for lang specific content.
https://shopify.dev/api/examples/multiple-languages#translatable-resources
Additional context
Before submitting the PR, please make sure you do the following:
fixes #123
)yarn changeset add
if this PR cause a version bump based on Keep a Changelog and adheres to Semantic Versioning