What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Storfront api language doesn't work

Storfront api language doesn't work

pierrealexis
Visitor
3 0 0

I'm trying to have a I18n headless application 

everything is configured it work with a normal theme in liquid and I have all the translation I need

 

but with the store front api I did succeed  to have all the translation I want

I'm on the api/2022-04 version

 

 

 

query getLocalization {
localization {
    # for the current country
    availableLanguages {
      isoCode
      endonymName
    }

    # and for non-current countries
    availableCountries {
      isoCode
      name
      availableLanguages {
        isoCode
        endonymName
      }
    }
  }
}

 

 

 I've got spanish 

 

now I can try this request 

 

 

query getProductList($after: String) @inContext(language: ES) {
  products(first: 12, after: $after) {
    edges {
      node {
        id
        handle
        title
        description(truncateAt: 120)

 

 

And products are still in english 

what did I miss ?

Reply 1 (1)

pierrealexis
Visitor
3 0 0

I tested from a fresh store and it work

 

The main difference is I had to activate the language in Settings / market 

 

And I don't have this access to my main shop because I have translation in Chinese and Portuguese

 

So I don't know how to get around that