diff --git a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts index 56002c9e9..0907404a8 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts +++ b/src/Ombi/ClientApp/src/app/discover/components/card/discover-card.component.ts @@ -2,6 +2,7 @@ import { Component, OnInit, Input } from "@angular/core"; import { IDiscoverCardResult } from "../../interfaces"; import { RequestType } from "../../../interfaces"; import { MessageService, RequestService, SearchV2Service } from "../../../services"; +import { TranslateService } from "@ngx-translate/core"; import { MatDialog } from "@angular/material/dialog"; import { ISearchTvResultV2 } from "../../../interfaces/ISearchTvResultV2"; import { ISearchMovieResultV2 } from "../../../interfaces/ISearchMovieResultV2"; @@ -30,7 +31,7 @@ export class DiscoverCardComponent implements OnInit { private tvSearchResult: ISearchTvResultV2; constructor(private searchService: SearchV2Service, private dialog: MatDialog, private requestService: RequestService, - public messageService: MessageService) { } + public messageService: MessageService, private translate: TranslateService) { } public ngOnInit() { if (this.result.type == RequestType.tvShow) { @@ -98,13 +99,13 @@ export class DiscoverCardComponent implements OnInit { public getAvailbilityStatus(): string { if (this.result.available) { - return "Available"; + return this.translate.instant("Common.Available"); } if (this.result.approved) { - return "Approved"; + return this.translate.instant("Common.Approved"); } if (this.result.requested) { - return "Pending"; + return this.translate.instant("Common.Pending"); } return ""; } @@ -129,7 +130,7 @@ export class DiscoverCardComponent implements OnInit { rootFolderOverride: result.radarrFolderId, }).subscribe(x => { if (x.result) { this.result.requested = true; - this.messageService.send(x.message, "Ok"); + this.messageService.send(this.translate.instant("Requests.RequestAddedSuccessfully", { title: this.result.title }), "Ok"); } else { this.messageService.send(x.errorMessage, "Ok"); } @@ -140,7 +141,7 @@ export class DiscoverCardComponent implements OnInit { this.requestService.requestMovie({ theMovieDbId: +this.result.id, languageCode: null, requestOnBehalf: null, qualityPathOverride: null, rootFolderOverride: null }).subscribe(x => { if (x.result) { this.result.requested = true; - this.messageService.send(x.message, "Ok"); + this.messageService.send(this.translate.instant("Requests.RequestAddedSuccessfully", { title: this.result.title }), "Ok"); } else { this.messageService.send(x.errorMessage, "Ok"); } diff --git a/src/Ombi/ClientApp/src/app/discover/components/collections/discover-collections.component.html b/src/Ombi/ClientApp/src/app/discover/components/collections/discover-collections.component.html index 6c892fae6..23a7791f0 100644 --- a/src/Ombi/ClientApp/src/app/discover/components/collections/discover-collections.component.html +++ b/src/Ombi/ClientApp/src/app/discover/components/collections/discover-collections.component.html @@ -7,8 +7,7 @@
{{collection.overview}}
diff --git a/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.ts b/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.ts index 9cb446656..ea9b24b1d 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.ts +++ b/src/Ombi/ClientApp/src/app/media-details/components/movie/movie-details.component.ts @@ -9,6 +9,7 @@ import { AuthService } from "../../../auth/auth.service"; import { IMovieRequests, RequestType, IAdvancedData } from "../../../interfaces"; import { DenyDialogComponent } from "../shared/deny-dialog/deny-dialog.component"; import { NewIssueComponent } from "../shared/new-issue/new-issue.component"; +import { TranslateService } from "@ngx-translate/core"; import { MovieAdvancedOptionsComponent } from "./panels/movie-advanced-options/movie-advanced-options.component"; import { RequestServiceV2 } from "../../../services/requestV2.service"; import { RequestBehalfComponent } from "../shared/request-behalf/request-behalf.component"; @@ -39,7 +40,8 @@ export class MovieDetailsComponent { private sanitizer: DomSanitizer, private imageService: ImageService, public dialog: MatDialog, private requestService: RequestService, private requestService2: RequestServiceV2, private radarrService: RadarrService, - public messageService: MessageService, private auth: AuthService, private settingsState: SettingsStateService) { + public messageService: MessageService, private auth: AuthService, private settingsState: SettingsStateService, + private translate: TranslateService) { this.route.params.subscribe(async (params: any) => { if (typeof params.movieDbId === 'string' || params.movieDbId instanceof String) { if (params.movieDbId.startsWith("tt")) { @@ -97,7 +99,7 @@ export class MovieDetailsComponent { if (requestResult.result) { this.movie.requested = true; this.movie.requestId = requestResult.requestId; - this.messageService.send(requestResult.message, "Ok"); + this.messageService.send(this.translate.instant("Requests.RequestAddedSuccessfully", { title: this.movie.title }), "Ok"); this.movieRequest = await this.requestService.getMovieRequest(this.movie.requestId); } else { this.messageService.send(requestResult.errorMessage, "Ok"); @@ -110,7 +112,7 @@ export class MovieDetailsComponent { this.movie.requested = true; this.movie.requestId = result.requestId; this.movieRequest = await this.requestService.getMovieRequest(this.movie.requestId); - this.messageService.send(result.message, "Ok"); + this.messageService.send(this.translate.instant("Requests.RequestAddedSuccessfully", { title: this.movie.title }), "Ok"); } else { this.messageService.send(result.errorMessage, "Ok"); } @@ -151,7 +153,7 @@ export class MovieDetailsComponent { this.movie.approved = true; const result = await this.requestService.approveMovie({ id: this.movieRequest.id }).toPromise(); if (result.result) { - this.messageService.send("Successfully Approved", "Ok"); + this.messageService.send(this.translate.instant("Requests.SuccessfullyApproved"), "Ok"); } else { this.movie.approved = false; this.messageService.send(result.errorMessage, "Ok"); @@ -162,7 +164,7 @@ export class MovieDetailsComponent { const result = await this.requestService.markMovieAvailable({ id: this.movieRequest.id }).toPromise(); if (result.result) { this.movie.available = true; - this.messageService.send(result.message, "Ok"); + this.messageService.send(this.translate.instant("Requests.NowAvailable"), "Ok"); } else { this.messageService.send(result.errorMessage, "Ok"); } @@ -173,7 +175,7 @@ export class MovieDetailsComponent { const result = await this.requestService.markMovieUnavailable({ id: this.movieRequest.id }).toPromise(); if (result.result) { this.movie.available = false; - this.messageService.send(result.message, "Ok"); + this.messageService.send(this.translate.instant("Requests.NowUnavailable"), "Ok"); } else { this.messageService.send(result.errorMessage, "Ok"); } @@ -204,7 +206,7 @@ export class MovieDetailsComponent { public reProcessRequest() { this.requestService2.reprocessRequest(this.movieRequest.id, RequestType.movie).subscribe(result => { if (result.result) { - this.messageService.send(result.message ? result.message : "Successfully Re-processed the request", "Ok"); + this.messageService.send(result.message ? result.message : this.translate.instant("Requests.SuccessfullyReprocessed"), "Ok"); } else { this.messageService.send(result.errorMessage, "Ok"); } diff --git a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html index 62908b361..1aafc30bf 100644 --- a/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html +++ b/src/Ombi/ClientApp/src/app/media-details/components/movie/panels/movie-information-panel.component.html @@ -17,7 +17,7 @@