UI updates to subscriptions

Improved translation coverage
This commit is contained in:
Tzahi12345
2023-01-24 21:45:19 -05:00
parent 840e12db71
commit 970e3834be
9 changed files with 50 additions and 26 deletions

View File

@@ -170,9 +170,9 @@ export class SettingsComponent implements OnInit {
deleteCategory(category: Category): void {
const dialogRef = this.dialog.open(ConfirmDialogComponent, {
data: {
dialogTitle: 'Delete category',
dialogText: `Would you like to delete ${category['name']}?`,
submitText: 'Delete',
dialogTitle: $localize`Delete category`,
dialogText: $localize`Would you like to delete ${category['name']}:category name:?`,
submitText: $localize`Delete`,
warnSubmitColor: true
}
});
@@ -180,12 +180,11 @@ export class SettingsComponent implements OnInit {
if (confirmed) {
this.postsService.deleteCategory(category['uid']).subscribe(res => {
if (res['success']) {
// TODO: Make translatable
this.postsService.openSnackBar(`Successfully deleted ${category['name']}!`);
this.postsService.openSnackBar($localize`Successfully deleted ${category['name']}:category name:!`);
this.postsService.reloadCategories();
}
}, () => {
this.postsService.openSnackBar(`Failed to delete ${category['name']}!`);
this.postsService.openSnackBar($localize`Failed to delete ${category['name']}:category name:!`);
});
}
});