mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-03-31 09:00:56 +03:00
Fixed broken translations for snackbars
This commit is contained in:
@@ -58,31 +58,31 @@ export class ShareMediaDialogComponent implements OnInit {
|
||||
}
|
||||
|
||||
copiedToClipboard() {
|
||||
this.openSnackBar('Copied to clipboard!');
|
||||
this.postsService.openSnackBar($localize`Copied to clipboard!`);
|
||||
}
|
||||
|
||||
sharingChanged(event) {
|
||||
if (event.checked) {
|
||||
this.postsService.enableSharing(this.uid, this.is_playlist).subscribe(res => {
|
||||
if (res['success']) {
|
||||
this.openSnackBar('Sharing enabled.');
|
||||
this.postsService.openSnackBar($localize`Sharing enabled.`);
|
||||
this.sharing_enabled = true;
|
||||
} else {
|
||||
this.openSnackBar('Failed to enable sharing.');
|
||||
this.postsService.openSnackBar($localize`Failed to enable sharing.`);
|
||||
}
|
||||
}, err => {
|
||||
this.openSnackBar('Failed to enable sharing - server error.');
|
||||
this.postsService.openSnackBar($localize`Failed to enable sharing - server error.`);
|
||||
});
|
||||
} else {
|
||||
this.postsService.disableSharing(this.uid, this.is_playlist).subscribe(res => {
|
||||
if (res['success']) {
|
||||
this.openSnackBar('Sharing disabled.');
|
||||
this.postsService.openSnackBar($localize`Sharing disabled.`);
|
||||
this.sharing_enabled = false;
|
||||
} else {
|
||||
this.openSnackBar('Failed to disable sharing.');
|
||||
this.postsService.openSnackBar($localize`Failed to disable sharing.`);
|
||||
}
|
||||
}, err => {
|
||||
this.openSnackBar('Failed to disable sharing - server error.');
|
||||
this.postsService.openSnackBar($localize`Failed to disable sharing - server error.`);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { MatDialogRef, MatDialog } from '@angular/material/dialog';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { PostsService } from 'app/posts.services';
|
||||
import { ArgModifierDialogComponent } from '../arg-modifier-dialog/arg-modifier-dialog.component';
|
||||
|
||||
@@ -70,7 +69,6 @@ export class SubscribeDialogComponent implements OnInit {
|
||||
];
|
||||
|
||||
constructor(private postsService: PostsService,
|
||||
private snackBar: MatSnackBar,
|
||||
private dialog: MatDialog,
|
||||
public dialogRef: MatDialogRef<SubscribeDialogComponent>) { }
|
||||
|
||||
@@ -81,7 +79,7 @@ export class SubscribeDialogComponent implements OnInit {
|
||||
if (this.url && this.url !== '') {
|
||||
// timerange must be specified if download_all is false
|
||||
if (!this.download_all && !this.timerange_amount) {
|
||||
this.openSnackBar('You must specify an amount of time');
|
||||
this.postsService.openSnackBar($localize`You must specify an amount of time`);
|
||||
return;
|
||||
}
|
||||
this.subscribing = true;
|
||||
@@ -97,7 +95,7 @@ export class SubscribeDialogComponent implements OnInit {
|
||||
this.dialogRef.close(res['new_sub']);
|
||||
} else {
|
||||
if (res['error']) {
|
||||
this.openSnackBar('ERROR: ' + res['error']);
|
||||
this.postsService.openSnackBar($localize`ERROR: ` + res['error']);
|
||||
}
|
||||
this.dialogRef.close();
|
||||
}
|
||||
@@ -118,11 +116,4 @@ export class SubscribeDialogComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public openSnackBar(message: string, action = '') {
|
||||
this.snackBar.open(message, action, {
|
||||
duration: 2000,
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { PostsService } from 'app/posts.services';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { UpdaterStatus } from '../../../api-types';
|
||||
|
||||
@Component({
|
||||
@@ -14,7 +13,7 @@ export class UpdateProgressDialogComponent implements OnInit {
|
||||
updateInterval = 250;
|
||||
errored = false;
|
||||
|
||||
constructor(private postsService: PostsService, private snackBar: MatSnackBar) { }
|
||||
constructor(private postsService: PostsService) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.getUpdateProgress();
|
||||
@@ -28,16 +27,9 @@ export class UpdateProgressDialogComponent implements OnInit {
|
||||
if (res) {
|
||||
this.updateStatus = res;
|
||||
if (this.updateStatus && this.updateStatus['error']) {
|
||||
this.openSnackBar('Update failed. Check logs for more details.');
|
||||
this.postsService.openSnackBar($localize`Update failed. Check logs for more details.`);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public openSnackBar(message: string, action: string = '') {
|
||||
this.snackBar.open(message, action, {
|
||||
duration: 2000,
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user