Skip to content

Commit 32643cb

Browse files
authored
Mini bug (#159)
* fixed to translate the create.ts page * fixed to translate the key.ts page * missing public key added
1 parent 3bd374d commit 32643cb

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed

src/app/connect/create/create.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { ClipboardModule } from '@angular/cdk/clipboard';
1717
import { CommonModule } from '@angular/common';
1818
import { bytesToHex, hexToBytes } from '@noble/hashes/utils';
1919
import { MatButtonModule } from '@angular/material/button';
20+
import { TranslateService } from '@ngx-translate/core'; //Added this for the transalation i18n
2021

2122
@Component({
2223
selector: 'app-create',
@@ -41,14 +42,17 @@ export class CreateProfileComponent {
4142
mnemonic = '';
4243

4344
constructor(
45+
private translate: TranslateService, // Add TranslateService
4446
private utilities: Utilities,
4547
private dataService: DataService,
4648
private profileService: ProfileService,
4749
private authService: AuthenticationService,
4850
public theme: ThemeService,
4951
private router: Router,
5052
private security: SecurityService
51-
) {}
53+
) {
54+
this.translate.use('en'); // This ensures translations are loaded
55+
}
5256

5357
ngOnInit() {
5458
// this.mnemonic = bip39.generateMnemonic(wordlist);

src/app/connect/key/key.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,19 @@ import { FormsModule } from '@angular/forms';
1616
import { bytesToHex, hexToBytes } from '@noble/hashes/utils';
1717
import { MatInputModule } from '@angular/material/input';
1818
import { MatButtonModule } from '@angular/material/button';
19+
import { TranslateService } from '@ngx-translate/core'; //Added this for the transalation i18n
1920

2021

2122
@Component({
2223
selector: 'app-key',
2324
templateUrl: './key.html',
2425
styleUrls: ['../connect.css', './key.css'],
25-
imports: [CommonModule, MatButtonModule, RouterModule, MatIconModule, MatCardModule, TranslateModule, MatFormFieldModule, MatInputModule, FormsModule],
26+
imports: [CommonModule,
27+
MatButtonModule,
28+
RouterModule,
29+
MatIconModule,
30+
MatCardModule,
31+
TranslateModule, MatFormFieldModule, MatInputModule, FormsModule],
2632
})
2733
export class ConnectKeyComponent {
2834
privateKey: string = '';
@@ -34,7 +40,15 @@ export class ConnectKeyComponent {
3440
step = 1;
3541
mnemonic: string = '';
3642

37-
constructor(public dialog: MatDialog, public theme: ThemeService, private router: Router, private security: SecurityService) {}
43+
constructor(
44+
private translate: TranslateService,
45+
public dialog: MatDialog,
46+
public theme: ThemeService,
47+
private router: Router,
48+
private security: SecurityService
49+
) {
50+
this.translate.use('en'); // This ensures translations are loaded
51+
}
3852

3953
setPrivateKey() {
4054
this.privateKeyHex = bytesToHex(privateKeyFromSeedWords(this.mnemonic));

src/assets/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
"PrivateKeyImportDescription": "First choose if your backup is a secret recovery phrase or a private key.",
8282
"SecretRecoveryPhrase": "Secret Recovery Phrase",
8383
"PrivateKey": "Private Key",
84+
"PublicKey": "Public Key",
8485
"ScanQRCode": "Scan QR-code",
8586
"SecretRecoveryPhraseImport": "Secret Recovery Phrase Import",
8687
"Continue": "Continue",

src/assets/i18n/no.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
"PrivateKeyImportDescription": "First choose if your backup is a secret recovery phrase or a private key.",
8080
"SecretRecoveryPhrase": "Secret Recovery Phrase",
8181
"PrivateKey": "Private Key",
82+
"PublicKey": "Public Key",
8283
"ScanQRCode": "Scan QR-code",
8384
"SecretRecoveryPhraseImport": "Secret Recovery Phrase Import",
8485
"Continue": "Continue",

src/assets/i18n/ru.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
"PrivateKeyImportDescription": "First choose if your backup is a secret recovery phrase or a private key.",
8080
"SecretRecoveryPhrase": "Secret Recovery Phrase",
8181
"PrivateKey": "Private Key",
82+
"PublicKey": "Public Key",
8283
"ScanQRCode": "Scan QR-code",
8384
"SecretRecoveryPhraseImport": "Secret Recovery Phrase Import",
8485
"Continue": "Continue",

0 commit comments

Comments
 (0)