ethers.js icon indicating copy to clipboard operation
ethers.js copied to clipboard

Register a new wordlist for a browser application

Open vrde opened this issue 3 years ago • 1 comments

Ethers Version

5.7.0

Search Terms

wordlist

Describe the Problem

I'm using ethers.js in the browser. I tried to register new wordlists following the documentation.

I installed @ethersproject/wordlists, version 5.7.0, and I tried something like

import { ethers } from "ethers";
import { langEs as es } from "@ethersproject/wordlists";
ethers.Wordlist.register(es);

But it didn't work, printing ethers.wordlists didn't show es but just en.

I ended up doing this:

import { ethers } from "ethers";

import { langEs as es } from "@ethersproject/wordlists/lib/lang-es";
import {
  langZhCn as zh_cn,
  langZhTw as zh_tw,
} from "@ethersproject/wordlists/lib/lang-zh";

ethers.wordlists.es = es;
ethers.wordlists.zh = zh_cn;
ethers.wordlists.zh_cn = zh_cn;
ethers.wordlists.zh_tw = zh_tw;

Code Snippet

No response

Contract ABI

No response

Errors

No response

Environment

Ethereum (mainnet/ropsten/rinkeby/goerli)

Environment (Other)

No response

vrde avatar Oct 10 '22 17:10 vrde

up! @etherproject/wordlists does not export other languages except EN in wordlists constant

ko1ebayev avatar May 28 '24 10:05 ko1ebayev