Get translations of product tags and metafields

Get translations of product tags and metafields

domozhirov
Visitor
1 0 0

I translate fields in Translate&Currency - LangShop
The main language of the store is German and translations are in English
domozhirov_0-1647930961209.png
Query to graphql api that returns translations of fields

 

{
  products(first: 1) {
    pageInfo {
      hasNextPage
      hasPreviousPage
    }
    edges {
      cursor
      node {
        title
        description
        featuredImage {
          url
        }
        descriptionHtml
        totalVariants
        delivery_period_weeks: metafield(
          namespace: "my_fields"
          key: "delivery_period_weeks"
        ) {
          key
          value
        }
        tags
        en: translations(locale: "en") {
          key
          locale
          value
        }
        variants(first: 1) {
          edges {
            node {
              price
            }
          }
        }
      }
    }
  }
}

 


The response from the server contains only the title and body_html

 

{
  "data": {
    "products": {
      "pageInfo": {
        "hasNextPage": true,
        "hasPreviousPage": false
      },
      "edges": [
        {
          "cursor": "...",
          "node": {
            "title": "Produkt testen",
            "description": "Test beschreibung",
            "featuredImage": null,
            "descriptionHtml": "Test beschreibung",
            "totalVariants": 2,
            "delivery_period_weeks": null,
            "tags": [
              "Raumteiler"
            ],
            "en": [
              {
                "key": "body_html",
                "locale": "en",
                "value": "Test description<br>"
              },
              {
                "key": "title",
                "locale": "en",
                "value": "Test product"
              }
            ],
            "variants": {
              "edges": [
                {
                  "node": {
                    "price": "1000.00"
                  }
                }
              ]
            }
          }
        }
      ]
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 9,
      "actualQueryCost": 9,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 991,
        "restoreRate": 50
      }
    }
  }
}

 

The same applies to collections where you want to get a translation of a metafield
Is it possible to get translations of metafields and tags?

Reply 1 (1)

Aheadworks_team
Shopify Partner
67 1 5

Hello,
The LangShop Team is here!

 

Thank you for your question.
Unfortunately, Shopify does not have native functionality translating tags. So, the possibility to translate tags with the help of LangShop is implemented through theme localization. Thus, translated tags are only visible in the LangShop theme. You can preview tag translations in the original theme. However, you won't be able to search for products, collections, or blogs on the storefront. Find more information on tags translation and theme localization here.

 

As for the metafields, with the help of the LangShop application, you can translate meta fields for products, collections, pages, blogs, and articles.

 

Note: Meta fields are used by store applications and may contain system data, such as JSON objects. LangShop does not provide bulk auto-translation for meta fields via background tasks to prevent incorrect or broken data.

 

To translate meta fields, follow these steps:

 

1. Find the meta fields, which you want to translate. In our example, we will translate the product's meta fields. So, we go to the Products section of the app and open the product with meta fields.

2. Click on the language into which you want to translate meta fields.

3. Scroll the page and find the Metafields block.

4. Select fields, that you want to translate, by clicking on checkboxes.

5. Click Translate.

 

Note: LangShop uses different translation drivers. Thus, the app provides translation suggestions. You can choose the translation that suits you best.

 

I hope that this information help and in case any other question occur - you can always contact us via e-mail ([email protected]) or in Intercom chat.

 

Best regards,
LangShop team

 
 
banned