Translations for Products (Beta)
The Translations Admin GraphQL API for managing product translations is available on Catalyst storefronts only.
The products translatable fields are:
- Name
- Description
- Pre-order message
- Warranty Information
- Availability Text
- Search Keywords
- Page Title
- Meta Description
- Image alt text
In addition, the following properties' Name and Value fields are translatable:
- Custom fields
- Options local
- Modifiers local
- Options shared
- Modifiers shared
Querying Product Translations (Storefront API)
Product fields are returned in the current locale determined by the context (e.g., Accept-Language
header, channel settings, or session locale).
Example: Query a product in a given locale
Example query: Query product in a locale
GRAPHQL https://storefront.example.com/graphql
Accept-Language: fr
query {
site {
product(entityId: "123") {
entityId
name
description
pageTitle
metaKeywords
metaDescription
searchKeywords
}
}
}
Managing Product Translations (Admin API)
Product translation management (list, update, delete) is available via the Admin GraphQL API. These mutations and queries are not available on the Storefront API.
Query a List of Product Translations
Example query: Query a list of product translations
GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql
X-Auth-Token: {{token}}
query {
store {
translations(filters: {
resourceType: PRODUCTS,
channelId: "bc/store/channel/3",
localeId: "bc/store/locale/fr"
} first: 50) {
edges {
node {
resourceId
fields {
fieldName
original
translation
}
}
cursor
}
}
}
}
Query a Product Translation by Resource ID
⚠️
When querying a translation by resourceId, you must provide the full resourceId in the format bc/store/product/{product_id}
.
Example query: Query a product translation by id
GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql
X-Auth-Token: {{token}}
query {
store {
translations(filters: {
resourceType: PRODUCTS,
channelId: "bc/store/channel/2",
localeId: "bc/store/locale/it",
resourceIds: ["bc/store/product/123"]
}) {
edges {
node {
resourceId
fields {
fieldName
original
translation
}
}
cursor
}
}
}
}
Update a Product Translation
Example mutation: Update a product translation
GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql
X-Auth-Token: {{token}}
mutation {
translation {
updateTranslations(input: {
resourceType: PRODUCTS,
channelId: "bc/store/channel/1",
localeId: "bc/store/locale/fr",
entities: [
{
resourceId: "bc/store/product/123",
fields: [
{ fieldName: "name", value: "Gadget (FR)" },
{ fieldName: "description", value: "Un gadget utile." },
{ fieldName: "page_title", value: "Page Produit Gadget" }
]
}
]
}) {
__typename
errors {
__typename
... on Error {
message
}
}
}
}
}
Delete a Product Translation
Example mutation: Delete a product translation
GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql
X-Auth-Token: {{token}}
mutation {
translation {
deleteTranslations(input: {
resourceType: PRODUCTS,
channelId: "bc/store/channel/1",
localeId: "bc/store/locale/fr",
resources: [
{
resourceId: "bc/store/product/123",
fields: ["name", "description"]
}
]
}) {
__typename
errors {
__typename
... on Error {
message
}
}
}
}
}
Did you find what you were looking for?