Skip to content

Commit

Permalink
Merge pull request #2000 from Web3Auth/fix/uiconfig-lan-selection
Browse files Browse the repository at this point in the history
language selection fix
  • Loading branch information
chaitanyapotti authored Oct 30, 2024
2 parents 70143f4 + 4a13158 commit 75724bc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/ui/src/loginModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export class LoginModal extends SafeEventEmitter {
const darkState = { isDark: this.isDark };

const useLang = this.uiConfig.defaultLanguage || LANGUAGES.en;

// Load new language resource

if (useLang === LANGUAGES.de) {
Expand Down Expand Up @@ -171,6 +172,15 @@ export class LoginModal extends SafeEventEmitter {
.catch((error) => {
log.error(error);
});
} else if (useLang === LANGUAGES.en) {
import(`./i18n/english.json`)
.then((messages) => {
i18n.addResourceBundle(useLang as string, "translation", messages.default);
return i18n.changeLanguage(useLang);
})
.catch((error) => {
log.error(error);
});
}

return new Promise((resolve) => {
Expand Down

0 comments on commit 75724bc

Please sign in to comment.