Integrating the new collection and product slugs #1068
-
Hi! I saw that there was an update we all(?) have been waiting for. The ability to translate collection and product slugs is an awesome update in terms of UX and SEO. Now my question is: How can we use this in Hydrogen 2. I use Sanity (Connect) to source my web store but I am not that concerned on how to setup that with the new update. The only thing I have troubles with is figuring out how to build /collections/collectieA and en/collections/collectionA |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 7 replies
-
The following handle is the default handle which we wanted to translate to an English handle. The only way to get the English page is to input the original handle. Using the translated handle will return null. query getTranslatedCollection @inContext(language: EN) {
collection(handle: "kerstboomversiering") {
id
handle
}
} Output: "data": {
"collection": {
"id": "gid://shopify/Collection/448104005942",
"handle": "christmas-tree-decoration"
}
}, |
Beta Was this translation helpful? Give feedback.
-
Someone on the Discord channel responded that this is probably an oversight by the API team. Do we know how much time it will take to sort out something like this? Do we talk about days, weeks or months? |
Beta Was this translation helpful? Give feedback.
-
Did you find any solution? I'm trying to get the other internationalized slug when i query a product or collection |
Beta Was this translation helpful? Give feedback.
I think everything should work properly. For example, see mock.shop with the handle
sweatpants
localized tojogginghose
for the German market. Note that@inContext
is providing the german language and country.Make sure that you have the
Translate & Adapt
app installed, and the language published in the admin.