Skip to main content

Translations

Structure for sending translations. For performance reasons, it is appropriate to indicate all translations of a metafield in a single send. It is possible to translate base fields (including SEO information if present in the primary language), metafields and files (some like barcode, sku etc cannot be translated for obvious reasons).

Both metafield and file can be identified by the key alone (key) or by the complete key in the format namespace.key.

For each language, values follow the same rule as product master data for explicit fields:

  • Field or language omitted from the JSON: the translation already present on Shopify is not changed.
  • null: the translation already present on Shopify is kept.
  • "" (empty string): the translation is deleted on Shopify (content falls back to the primary language).
  • Populated value (e.g. "Product description FS-03"): the translation is created or updated on Shopify.

This applies to base fields (title, description, handle, type, metaTitle, metaDescription), to optionKeys and optionValues, and to metafields and files.

For the handle field, if the sent value matches the product handle in the primary language, the translation is deleted and Shopify uses the default handle.

In addition, it is possible to configure redirect URLs via the not-found-handle field to handle cases of archiving or excluding the product from a catalog (market) for each language present in the store. When a not-found-handle translation is provided as an empty string (e.g. "en": ""), if present the translated redirect URL is removed.

In the example we see translations in 2 languages for the above-mentioned fields.

In stores the primary language is Italian below is a list of other languages present:

{
"data": [
{
"sku": "FS-03",
"title": {
"en": "Product title FS-03",
"fr": "Titre du produit FS-03"
},
"description": {
"en": "Product description FS-03",
"fr": "Description du produit FS-03"
},
"handle": {
"en": "product-handle-fs-03",
"fr": "produit-handle-fs-03"
},
"not-found-handle": {
"en": "/collections/all",
"fr": "/collections/all"
},
"type": {
"en": "Product type FS-03",
"fr": "Type de produit FS-03"
},
"files": {
"manual": {
"en": "https://www.orimi.com/pdf-test.pdf",
"fr": "https://www.orimi.com/pdf-test.pdf"
},
"namespace.key1": {
"en": "https://www.orimi.com/pdf-test.pdf",
"fr": "https://www.orimi.com/pdf-test.pdf"
}
},
"metafields": {
"addition_features": {
"en": "Translated metafield",
"fr": "Métachamp traduit"
},
"namespace.key2": {
"en": "Translated metafield",
"fr": "Métachamp traduit"
}
},
"optionKeys": {
"color": {
"en": "color",
"fr": "couleur"
}
},
"variants": [
{
"sku": "FS-03-1",
"optionValues": {
"color": {
"en": "Pink",
"fr": "Rose"
}
},
"files": {
"variantManual": {
"en": "https://www.orimi.com/pdf-test.pdf",
"fr": "https://www.orimi.com/pdf-test.pdf"
},
"namespace.variantKey1": {
"en": "https://www.orimi.com/pdf-test.pdf",
"fr": "https://www.orimi.com/pdf-test.pdf"
}
},
"metafields": {
"variant_addition_features": {
"en": "Translated metafield",
"fr": "Métachamp traduit"
},
"namespace.variantKey2": {
"en": "Translated metafield",
"fr": "Métachamp traduit"
}
}
}
],
"metaTitle": {
"en": "SEO Product Meta Title",
"fr": "Méta-titre du produit SEO"
},
"metaDescription": {
"en": "A detailed meta description for SEO.",
"fr": "Une méta description détaillée pour le référencement."
}
}
]
}

Destination configuration​

Configure a Shopify destination and associate it with the flow, in addition to the basic data flow configuration.

FieldValueNotes
Destination TypeShopify
OperationTranslationsPOST /egress/sync-translation-to-shopify
GraphQL endpoint URLhttps://SHOPIFYURL.myshopify.com/Shopify Admin GraphQL endpoint URL
Admin API access tokenshpat_CODICEALFANUMERICOOr Client ID (API key) + Client secret — see Authentication
Client ID (API key)YOUR_CLIENT_ID
Client secretYOUR_CLIENT_SECRET

Deprecated — previous configuration (HTTP Adapter)​

Deprecated

Configuration via HTTP Adapter with Base Url, Resource Path, and x-api-key header in Settings Override is deprecated. Use the Shopify destination configuration described above.

In addition to the basic data flow configuration, the following Settings Override settings were required:

FieldValueNotes
Base Urlhttps://adapter.flowlyze.ioAdapter URL
Resource Path/api/adp/shopify/egress/sync-translation-to-shopifyAdapter path for translations
Headers :: x-api-key**********API key for endpoint interaction verification
Headers :: x-shopify-graphql-urlhttps://SHOPIFYURL.myshopify.com/Shopify shop URL to connect to
Headers :: x-shopify-access-tokenshpat_CODICEALFANUMERICOSecret of the custom app created for integration