Building translation app

Hello all, I’m going to start a little project and I was hoping to get some guidance.

I want to build a scenario to translate my Shopifynstore into multiple languages with Google Translate.

Id assume the steps would be as follows:

  1. Fetch untranslated text via Shopify API
  2. Translate with Google API
  3. Post to Shopify via Shopify API

I looked at the Shopify API and I don’t seem to find a specific call to get untranslated text or anything to do with translations. I find this odd and I wonder am I missing something.

If anyone can shed some light I’d be very grateful

Hey @miwelo - thanks for getting in touch, great question! In terms of pulling text content directly through the Shopify API, it depends on the content you’re wanting to query and modify through the API. For example, if you want to pull a product description, you could make a call like this via our GraphQL Admin API:

{
product (id:“gid://shopify/Product/productID”) {
description
}
}

This would pull the content you could then translate through the Google API and then you could push the translated info back via the API using a productUpdate mutation. That said, we do also go over a workflow here in our dev docs that might work a bit better. This would leverage how “locales” work on Shopify, but it does also allow you to create translations of various parts of different resources via the API directly. This approach might work better!

Hope this helps - let us know if we can clarify anything further on our end!

Al | Shopify Developer Support