How can i get the language used by merchant in admin?

Hi,

i’m creating an app and i’m working on the translation.

But i don’t know how to get the current language in the admin dashboard.

Here is my code :

const locale = 'fr';
  const i18nManager = new I18nManager({
    locale,
    onError(error) {
      console.log(error);
    },
  });

I need to set the variable “locale” dynamically with the current language used by the merchant in his admin.

Could you help me ?

Hello, i found a solution using :

const locale = new URL(location).searchParams.get("locale")
1 Like