inContext doesn't apply when fetching a product

Hi, we’re having issues getting the correct translations for our store when viewing a product. The query looks something like this:

const PRODUCT_QUERY = #graphql query Product( $country: CountryCode $handle: String! $language: LanguageCode $selectedOptions: [SelectedOptionInput!]! ) @inContext(country: $country, language: $language) { product(handle: $handle) { ...Product media(first: 6) { ... }

Even though the language is hardcoded to English, it doesn’t fetch the english translates values in Shopify. Even if we hardcode the language variables in the query it doesn’t apply.

Any help is appreciated!

Do you have your products and collections translated to the desired language in the admin?

Please make sure that you have the desired language translated by using the Translate & adapt app Shopify Translate & Adapt - Shopify Translate & Adapt: Ecommerce Translation App | Shopify App Store before making the SFAPI query with the desired language. If the translated information isn’t available, the SFAPI query will default to the original language that you have set up your shop with.

2 Likes