Skip to content

Commit

Permalink
Change locale recognition logic
Browse files Browse the repository at this point in the history
  • Loading branch information
henriquecbuss committed Aug 22, 2022
1 parent 943613c commit 6f566c5
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/scripts/mnemonic.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,11 @@ import * as bip39 from 'bip39'
* @returns {[string,string]}
*/
function generateRandom (userLocale) {
const userLang = userLocale.toLowerCase().split('-')[0]

let wordlist = bip39.wordlists.english
switch (userLang) {
case 'es':
wordlist = bip39.wordlists.spanish
break;
case 'pt':
wordlist = bip39.wordlists.portuguese
break;

default:
break;
if (userLocale.toLowerCase().startsWith('es')) {
wordlist = bip39.wordlists.spanish
} else if (userLocale.toLowerCase().startsWith('pt')) {
wordlist = bip39.wordlists.portuguese
}

const strength = undefined
Expand Down

0 comments on commit 6f566c5

Please sign in to comment.