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

wordlists add Turkish language support.

Open zinderud opened this issue 1 year ago • 6 comments

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.

zinderud avatar Mar 18 '24 18:03 zinderud

tr.txt turkish file add

zinderud avatar Mar 18 '24 18:03 zinderud

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. :)

ricmoo avatar Mar 18 '24 18:03 ricmoo

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.

zinderud avatar Mar 18 '24 18:03 zinderud

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?

ricmoo avatar Mar 18 '24 19:03 ricmoo

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

zinderud avatar Mar 18 '24 19:03 zinderud

there was an error due to one extra empty character. this has been fixed.

zinderud avatar Mar 19 '24 20:03 zinderud