Make it easier to know outdated translations

Hello,

Right now, it is extremely hard to know if a resource (let’s say a metaobject) has outdated translations. This is useful to instruct a merchant that they must update translations in one or more languages.

To know if a resource has at least one outdated translations, this currently requires two steps:

  1. Retrieving all the locales of a store.
  2. Manually generate a request for each locales:
// Query 1: get all the shop locales
query {
  shopLocales {
    locale
  }
}

// Query 2: based on retrieved locales, generate another query
query {
    translatableResource(resourceId: "gid://shopify/Collection/1007901140") {
      resourceId
      fr: translations(locale: "fr") {
        outdated
      }
      de: translations(locale: "de") {
        outdated
      }
      it: translations(locale: "it") {
        outdated
      }
    }
  }

Those queries can’t be parallelized as query 2 needs to wait for query 1, and manually generating a GraphQL string is cumbersome.

To make it easier, it would be nice if the translatableResource would offer a convenient to get outdatedLocales:

query {
    translatableResource(resourceId: "gid://shopify/Collection/1007901140") {
      resourceId
      outdatedLocales {
        locale
      }
    }
  }

An outdated locale would be a translatable resource with at least one outdated translation.

Thanks.

Hey again @bakura10, hope all’s well :waving_hand:

You’re right that there’s not currently a great way of optimizing a query like this, I’m going to raise this with some folks internally and at the very least set up a feature request for you. We’ll get this looked into :slight_smile:

Hey again @bakura10, I was able to get in touch with the product team for you on this, and right now, I can confirm that there isn’t a way to grab those outdated locale translations, but I we have created a feature request for you on this and it’s been sent up directly to our devs on the translation product team.

Hope this helps a little bit and thanks again for waiting on my answer here!

Thanks a lot for the follow-up :slight_smile:

1 Like