Skip to content

Commit

Permalink
webapp: Setup Misc Settings: Add translations for drop-down lists
Browse files Browse the repository at this point in the history
  • Loading branch information
bennettpeter committed May 25, 2022
1 parent 88bb3c0 commit 7460396
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
8 changes: 7 additions & 1 deletion mythtv/html/assets/i18n/en_US.json
Expand Up @@ -178,7 +178,13 @@
"disfwr_desc": "By default, MythTV resets the FireWire bus when a FireWire recorder stops responding to commands. If this causes problems, you can disable this behavior here.",
"savesuccess": "Saved successfully.",
"panel_filemgmt": "File Management",
"panel_upnp": "UPnP Server"
"panel_upnp": "UPnP Server",
"sg_balfree": "Balanced free space",
"sg_balpercent": "Balanced percent free space",
"bal_io": "Balanced disk I/O",
"sg_combination": "Combination",
"upnp_recs": "Recordings",
"upnp_videos": "Videos"
},
"networkfail": "ERROR: Backend Network Failure",
"eit": {
Expand Down
@@ -1,20 +1,15 @@
import { Component, OnInit } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';

import { Miscellaneous } from 'src/app/services/interfaces/setup.interface';
import { SetupService } from 'src/app/services/setup.service';


interface Scheduler {
interface ddParam {
name: string,
code: string
}

interface UpnpSource {
name: string,
code: string
}


@Component({
selector: 'app-misc-settings',
templateUrl: './misc-settings.component.html',
Expand All @@ -23,18 +18,25 @@ interface UpnpSource {

export class MiscSettingsComponent implements OnInit {
miscData: Miscellaneous = this.setupService.getMiscellaneousData();
soptions: Scheduler[] = [
{name: "Balanced free space", code: "BalancedFreeSpace" },
{name: "Balanced percent free space", code: "BalancedPercFreeSpace"},
{name: "Balanced disk I/O", code: "BalancedDiskIO"},
{name: "Combination", code: "Combination"}
soptions: ddParam[] = [
{name: 'settings.misc.sg_balfree', code: "BalancedFreeSpace" },
{name: 'settings.misc.sg_balpercent', code: "BalancedPercFreeSpace"},
{name: 'settings.misc.bal_io', code: "BalancedDiskIO"},
{name: 'settings.misc.sg_combination', code: "Combination"}
];
uoptions: UpnpSource [] = [
{name: "Recordings", code: "0" },
{name: "Videos", code: "1"},
uoptions: ddParam [] = [
{name: 'settings.misc.upnp_recs', code: "0" },
{name: 'settings.misc.upnp_videos', code: "1"},
];

constructor(private setupService: SetupService) { }
constructor(private setupService: SetupService, private translate: TranslateService) {
translate.get(this.soptions[0].name).subscribe(data => this.soptions[0].name = data);
translate.get(this.soptions[1].name).subscribe(data => this.soptions[1].name = data);
translate.get(this.soptions[2].name).subscribe(data => this.soptions[2].name = data);
translate.get(this.soptions[3].name).subscribe(data => this.soptions[3].name = data);
translate.get(this.uoptions[0].name).subscribe(data => this.uoptions[0].name = data);
translate.get(this.uoptions[1].name).subscribe(data => this.uoptions[1].name = data);
}

ngOnInit(): void {
}
Expand Down

0 comments on commit 7460396

Please sign in to comment.