ethers.js
ethers.js copied to clipboard
wordlists add Turkish language support.
Hello, I added Turkish language support changed the letters in some words in Turkish (ü,ğ,ş,ı,ö) to their English equivalents (u,g,s,i,o) to be compatible with the tests.
tr.txt turkish file add
Is there an official Turkish wordlist? Please include links to official sources and I will use the generation scripts too, to ensure compact representation using the OWL-A format. :)
I couldn't find an official Turkish wordlist. but I tested the ones already written here https://github.com/zinderud/scure-bip39 and https://github.com/bitcoin/bips/pull/1359. I converted it to OWL-A format for etherjs and ran it for encode-latin.
If there are no accents you can also use OWL (the -A is for accents ;)), but I would expect accents to be present, since they are in the other latin-1 languages. Although, Turkish has the dotless-i, so that might not be handled automatically? It’s been a while since I touched those coders.
I would probably prefer to only allow official wordlists in the core, but I can certainly provide an extension library for your list. The consequences for having more than one canonical list is that using semi-incompatible lists would cause the wrong private keys to be generated for a given mnemonic.
Would that work for you?
the letters (ü,ğ,ş,ı,ö) in Turkish caused an error when I tested with https://github.com/zinderud/scure-bip39. when I replaced these letters with (u,i,g,o,s) the first four letters of the words were similar. i had to replace them. As it is now, I can use it as a Turkish mnemonic in my repo. In order for more people to use it, your use of this structure is also helpful for those who want to use Turkish mnemonic. I shared it for this purpose. good work
there was an error due to one extra empty character. this has been fixed.