diff --git a/background.html b/background.html index 59bd31eaa..5e8457eb6 100644 --- a/background.html +++ b/background.html @@ -625,6 +625,12 @@
They can be used to restore your account if you lose access or migrate to a new device. +
+ Language: +
+ +
+
Generate Seed diff --git a/js/views/standalone_registration_view.js b/js/views/standalone_registration_view.js index 248091681..b2eee33c6 100644 --- a/js/views/standalone_registration_view.js +++ b/js/views/standalone_registration_view.js @@ -29,14 +29,12 @@ this.onGenerateMnemonic(); - window.mnemonic.get_languages().forEach(language => { - this.$('#mnemonic-language').append( - $('`; }); + this.$('#mnemonic-language').append(options); + this.$('#mnemonic-display-language').append(options); }, events: { 'validation input.number': 'onValidation', @@ -47,6 +45,7 @@ 'click #register-mnemonic': 'registerWithMnemonic', 'change #mnemonic': 'onChangeMnemonic', 'click #generate-mnemonic': 'onGenerateMnemonic', + 'change #mnemonic-display-language': 'onGenerateMnemonic', 'click #copy-mnemonic': 'onCopyMnemonic', 'click .section-toggle': 'toggleSection', }, @@ -78,7 +77,8 @@ this.$('#status').html(''); }, async onGenerateMnemonic() { - const mnemonic = await this.accountManager.generateMnemonic(); + const language = this.$('#mnemonic-display-language').val(); + const mnemonic = await this.accountManager.generateMnemonic(language); this.$('#mnemonic-display').text(mnemonic) }, onCopyMnemonic() { diff --git a/libtextsecure/account_manager.js b/libtextsecure/account_manager.js index 6c88ea9eb..7795a4a61 100644 --- a/libtextsecure/account_manager.js +++ b/libtextsecure/account_manager.js @@ -446,10 +446,10 @@ ); }); }, - async generateMnemonic() { + async generateMnemonic(language = 'english') { const keys = await libsignal.KeyHelper.generateIdentityKeyPair(); const hex = StringView.arrayBufferToHex(keys.privKey); - return mnemonic.mn_encode(hex); + return mnemonic.mn_encode(hex, language); }, async registrationDone(number, profileName) { window.log.info('registration done'); diff --git a/stylesheets/_global.scss b/stylesheets/_global.scss index d761d3012..12152f21c 100644 --- a/stylesheets/_global.scss +++ b/stylesheets/_global.scss @@ -904,6 +904,17 @@ textarea { margin: 0px 8px; } + .standalone-register-language { + display: flex; + align-items: center; + justify-content: center; + margin-top: 2em; + + span { + margin-right: 8px; + } + } + .display-name-header { margin-bottom: 8px; font-size: 14px;