Make table header translatable and add language get param

This commit is contained in:
Djuri Baars 2022-05-26 14:16:37 +02:00
parent 64ed51e5db
commit 257a484699
4 changed files with 21 additions and 12 deletions

View file

@ -22,7 +22,7 @@
</div>
<div class="mb-3">
<label for="pubkeys">Import groupnodes from 🧀 CheeseRobot ₿ <small>(or use <a
<label for="pubkeys"><span translate>Settings.IMPORT_AREA</span> <small>(or use <a
href="https://t.me/ringtools_bot" target="_blank">@ringtools_bot</a> command
<code>/ringurl</code>)</small></label>
<textarea class="form-control" id="pubkeys" rows="3" [(ngModel)]="pubkeysText"
@ -104,12 +104,12 @@
<th scope="row" class="no-padding" colspan="1">
<input class="form-control form-control-sm" type="text" id="pubkey" formControlName="pubKey"
name="pubKey" placeholder="Public Key">
name="pubKey" placeholder="{{ 'General.PUBLIC_KEY' | translate }}">
</th>
<td>{{ tempNodename }}</td>
<td class="no-padding">
<input class="form-control form-control-sm" type="text" id="TG username" formControlName="tgUsername"
name="tgUsername" placeholder="TG username">
name="tgUsername" placeholder="{{ 'General.TG_USERNAME' | translate }}">
</td>
<td><button class="btn btn-primary btn-small btn-sm" id="addNodeOwnerBtn">{{ 'Settings.BTN_ADD' | translate }}</button>
</td>

View file

@ -89,9 +89,18 @@ export class SettingsComponent implements OnInit {
ngOnInit(): void {
const loadRingNew = this.route.snapshot.queryParamMap.get('l');
const langQs = this.route.snapshot.queryParamMap.get('lang');
if (loadRingNew) {
this.parseLoadQueryString(loadRingNew);
}
console.log(langQs)
if (langQs && this.locales.includes(langQs)) {
this.translate.use(langQs)
this.store.dispatch(setLocale(langQs));
}
}
parseLoadQueryString(loadRing: string) {

View file

@ -1,19 +1,19 @@
<table class="table table-sm table-striped small">
<thead>
<tr>
<th scope="col">Channel ID</th>
<th scope="col">Node 1</th>
<th scope="col">Node 2</th>
<th scope="col">N1 Base fee</th>
<th scope="col">N1 Fee rate</th>
<th scope="col">N2 Base fee</th>
<th scope="col">N2 Fee rate</th>
<th scope="col" translate>Overview.TH_CH_ID</th>
<th scope="col"><span translate>Overview.TH_NODE</span> 1</th>
<th scope="col"><span translate>Overview.TH_NODE</span> 2</th>
<th scope="col">N1 <span translate>Overview.BASE_FEE</span></th>
<th scope="col">N1 <span translate>Overview.FEE_RATE</span></th>
<th scope="col">N2 <span translate>Overview.BASE_FEE</span></th>
<th scope="col">N2 <span translate>Overview.FEE_RATE</span></th>
</tr>
</thead>
<tbody>
<ng-container *ngFor="let item of participants; let i = index">
<tr [class.error]="item[2] && (!item[3][0]|| !item[3][1] || item[3][0].disabled === true || item[3][1].disabled === true)">
<ng-template #popTitle let-title="title">Node policy <strong>{{title}}</strong></ng-template>
<ng-template #popTitle let-title="title"><span translate>Overview.NODE_POLICY</span> <strong>{{title}}</strong></ng-template>
<ng-template #popContent let-value="value">
<pre><code [innerHTML]="value"></code></pre>
</ng-template>

@ -1 +1 @@
Subproject commit 5cd98e0ebcb2b15ecf0c0e0354777dc903bf83f4
Subproject commit ad50e3d0a3be36b82ca60245dfc36624ef3e1185