OpenLogin ui_locales not working

Please provide the following details too when asking for help in this category:

  • SDK Version: 6.1.4
  • Platform: Web/Nextjs
  • Browser Console Screenshots:

Shows that locale is being set, but language does not reflect the setting. Tried with many other options as well.

Reference: web3auth-locales/Openlogin-locale/locales-passwordless.json at main · Web3Auth/web3auth-locales · GitHub

Please provide the Web3Auth initialization and login code snippet below:

  const loginWithEmail = async () => {
    if (!web3auth) {
      uiConsole("web3auth not initialized yet");
      return;
    }
    const web3authProvider = await web3auth.connectTo(WALLET_ADAPTERS.OPENLOGIN, {
      loginProvider: "email_passwordless",
      extraLoginOptions: {
        login_hint: "hello@web3auth.io",
        ui_locales: "PT",
        // also tried ui_locales: "portuguese fr-CA fr PT ",
      },
    });
    setProvider(web3authProvider);
    setLoggedIn(true);
  };

Hey @ishmael

There’s no field such as ui_locale in ExtraLoginOptions. You will have to pass the defaultLanguage as pt to see the changes.

Please refer to this https://web3auth.io/docs/pnp/features/whitelabel/user-flow-screens#web

import OpenloginAdapter from "@web3auth/openlogin-adapter";

const openloginAdapter = new OpenloginAdapter({
  adapterSettings: {
    clientId, //Optional - Provide only if you haven't provided it in the Web3Auth Instantiation Code
    network: "cyan", // Optional - Provide only if you haven't provided it in the Web3Auth Instantiation Code
    uxMode: "popup",
    whiteLabel: {
      name: "Your App Name",
      url: "https://yourapp.com",
      logoLight: "https://web3auth.io/images/w3a-L-Favicon-1.svg",
      logoDark: "https://web3auth.io/images/w3a-D-Favicon-1.svg",
      defaultLanguage: "en", // en, de, ja, ko, zh, es, fr, pt, nl
      dark: true, // whether to enable dark mode. defaultValue: false
      theme: {
        primary: "#00B4FF",
      },
    },
  },
  privateKeyProvider,
});
web3auth.configureAdapter(openloginAdapter);
1 Like
  1. Thank you! With your example, it is working now in test env.

  2. In this reference Usage | Documentation ExtraLoginOptions extends BaseLoginOptions which includes a ui_locales param, but perhaps the API defined there is not applicable to Web3Auth implementation.

  3. Also, question, language setting then only available in plans that include white labeling?

  4. Side notes:
    Some broken links related to this topic…
    web3auth io /docs/whitelabel/login-modal
    web3auth io /docs/whitelabel/user-flow-screens
    Source of broken links is github, ie: github com /Web3Auth/web3auth-locales/blob/main/README.md

Thank you

(only one link allowed in posts by new users)

This is Torus documentation, yes, Web3Auth API is different.

Yes, please check Web3Auth | Pricing - Personalised plans for everyone! for more details.

Thanks for reporting, I have updated that with the latest links.