Navigation Link translations incorrect when links are reordered

Highlighted
New Member
3 0 0

This an issue with navigation menu item and their translations ordering.

 

It looks like only the link item title is swapped when the menu items are rearranged, but the translations are not.

It gets even more complicated when you have more than two menu items.

 

I have reproduced it on a few stores using the test process below.

This requires access to the test store using Shopify Graphql API.

 

We have a menu with the following ordering

 Menu items ordering 1Menu items ordering 1

 

Each menu item has a translation, created with the Shopify Graphql API, and you can get the translations using this query.

{
    translatableResources(resourceType: LINK, first: 10) {
        edges {
            node {
                resourceId
                translatableContent {
                    key
                    value
                    locale
                }
                translations(locale: "fr") {
                    locale
                    key
                    value
                }
            }
        }
    }
}

 

Keep in mind to change the locale if you are using different language.

translations(locale: "fr")

 

The navigation menu items are accessed using the LINK resource type.

translatableResources(resourceType: LINK, first: 10)

 

And this a sample response from the Graphql API.

{
    "data": {
        "translatableResources": {
            "edges": [
                {
                    "node": {
                        "resourceId": "gid://shopify/Link/172804505681",
                        "translatableContent": [
                            {
                                "key": "title",
                                "value": "Home",
                                "locale": "en"
                            }
                        ],
                        "translations": [
                            {
                                "locale": "fr",
                                "key": "title",
                                "value": "Accueil"
                            }
                        ]
                    }
                },
                {
                    "node": {
                        "resourceId": "gid://shopify/Link/172804538449",
                        "translatableContent": [
                            {
                                "key": "title",
                                "value": "Catalog",
                                "locale": "en"
                            }
                        ],
                        "translations": [
                            {
                                "locale": "fr",
                                "key": "title",
                                "value": "Catalogue"
                            }
                        ]
                    }
                }
            ]
        }
    }
}

 

For the first resource we have

"resourceId": "gid://shopify/Link/172804505681"

content

"value": "Home"

translation

"value": "Accueil"

 

For the second resource we have

"resourceId": "gid://shopify/Link/172804538449"

content

"value": "Catalog"

translation

"value": "Catalogue"

 

When the menu items are reordered like this

img2.png

 

and the query is executed again, we get the following response

{
    "data": {
        "translatableResources": {
            "edges": [
                {
                    "node": {
                        "resourceId": "gid://shopify/Link/172804505681",
                        "translatableContent": [
                            {
                                "key": "title",
                                "value": "Catalog",
                                "locale": "en"
                            }
                        ],
                        "translations": [
                            {
                                "locale": "fr",
                                "key": "title",
                                "value": "Accueil"
                            }
                        ]
                    }
                },
                {
                    "node": {
                        "resourceId": "gid://shopify/Link/172804538449",
                        "translatableContent": [
                            {
                                "key": "title",
                                "value": "Home",
                                "locale": "en"
                            }
                        ],
                        "translations": [
                            {
                                "locale": "fr",
                                "key": "title",
                                "value": "Catalogue"
                            }
                        ]
                    }
                }
            ]
        }
    }
}

 

Here

"resourceId": "gid://shopify/Link/172804505681"

has a content

"value": "Catalog"

and translation

"value": "Accueil"

and for resource

"resourceId": "gid://shopify/Link/172804538449"

content

"value": "Home"

translation

"value": "Catalogue"

 

 

 

 

 

 

 

 

 

 

 

 

0 Likes