Translations
Brands

Translations for Brands (Beta)

The Translations Admin GraphQL API is currently available on Catalyst storefronts only.

The brands translatable fields are:

  • Name
  • Page Title
  • Meta Keywords
  • Meta Description
  • Search Keywords

Examples

Below are examples of GraphQL queries and mutations for retrieving and managing translation settings for brands.

Query translations

This query returns a paginated list of translations by resourceType, channel and locale with a maximum of 50 results per request.

Example mutation: Query a translation
GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql
X-Auth-Token: {{token}}
 
query {
  store {
    translations(filters: {
        resourceType: BRANDS,
        channelId: "bc/store/channel/3",
        localeId: "bc/store/locale/en"
      } first: 50) {
      edges {
        node {
          resourceId
            fields {
              fieldName
              original
              translation
            }
          }
        cursor
      }
    }
  }
}

Update a translation

This mutation updates a translation.

Example mutation: Update a translation
GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql
X-Auth-Token: {{token}}
 
mutation {
  translation {
    updateTranslations(input: {
      resourceType: BRANDS,
      channelId: "bc/store/channel/1",
      localeId: "bc/store/locale/en",
      entities: [
        {
          resourceId: "bc/store/brand/18",
          fields: [
            {
              fieldName: "name",
              value: "name (OVR)"
            },
            {
              fieldName: "page_title",
              value: "page_title (OVR)"
            },
            {
              fieldName: "meta_description",
              value: "meta_description (OVR)"
            },
            {
              fieldName: "meta_keywords",
              value: "meta keywords (OVR)"
            },
            {
              fieldName: "search_keywords",
              value: "search_keywords (OVR)"
            }
          ]
        }
      ]
    }) {
      __typename
      errors {
        __typename
        ... on Error {
          message
        }
      }
    }
  }
}

Delete a translation

The following mutation deletes a translation.

Example mutation: Delete a translation
GRAPHQL https://api.bigcommerce.com/stores/{{store_hash}}/graphql
X-Auth-Token: {{token}}
 
mutation {
  translation {
    deleteTranslations(input: {
      resourceType: BRANDS,
      channelId: "bc/store/channel/1",
      localeId: "bc/store/locale/en",
      resources: [
        {
          resourceId: "bc/store/brand/18",
          fields: ["name", "page_title", "meta_description"]
        }
      ]
    }) {
      __typename
      errors {
        __typename
        ... on Error {
          message
        }
      }
    }
  }
}
Did you find what you were looking for?