cancel
Showing results for 
Search instead for 
Did you mean: 

Magento GraphQL localization issue

Magento GraphQL localization issue

Hello,

 

I have a Magento 2 website and I'm currently building an external app that uses the Magento GraphQL and REST APIs.

 

In my Magento site, I have a unique store with two store views,one for english and one for french. I also have a working french language pack installed. When i'm using the GraphQL's createCustomer mutation in order to create a new customer account, it works well but the welcome email sent to the customer is always in english, even tough I specify the french store code in my request. It's like the GraphQL API doesn't seem to care about the store view's locale setting.

 

I don't think it's an issue with the language pack since when I create an account on my french website using the Magento frontend, evything works well.

 

I've also noticed that GraphQL always returns its error messages in english no matter the locale of the store view used for the request. Maybe both issues are linked.

 

Here's my GraphQL request:

Headers: Store fr (fr being my french store view code)

mutation {
  createCustomer(
    input: {
      firstname: "Test"
      lastname: "Test"
      email: "test@test.com"
      password: "b0bl0bl@w"
      is_subscribed: true
    }
  ) {
    customer {
      firstname
      lastname
      email
      is_subscribed
    }
  },
}

Has anyone had this issue or know if GraphQL even supports localization at this point?

 

Thank you

1 REPLY 1

Re: Magento GraphQL localization issue

Maybe this is just a really old issue, that should be closed by now. But to confirm, under Magento 2.3.1 or so, I experienced some issues here. But since then, localization has been working fine for me. I just retested this in Magento 2.4.2 and it works perfectly. But for exceptions. Untranslated exception messages is a known issue which is currently being investigated via the following ticket: https://github.com/magento/magento2/issues/31351 Also see https://stackoverflow.com/questions/61770306/while-working-with-the-magento-2-graphql-it-seems-that-... for a temporary solution instead.