fix(translations): 🌐 Localization - Ensuring all of the app including backend are localized #4366

* Localize TV and movies titles in requests

* Add missing release statuses

* Localize collection request

* Localize TV shows in newsletter

Uses TMDB instead of TVMaze for title, genres and synopsis

* Localize error messages

* Localize albums requests

* Use current language for TV and movies requests

* Remove unecessary console log
This commit is contained in:
sephrat 2021-11-02 16:00:25 +01:00 committed by GitHub
parent d8d1091564
commit 5e140ab618
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 205 additions and 137 deletions

View file

@ -6,6 +6,7 @@ using System.Security.Principal;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Ombi.Core.Authentication;
using Ombi.Core.Engine;
using Ombi.Core.Rule.Interfaces;
using Ombi.Helpers;
using Ombi.Store.Entities.Requests;
@ -34,7 +35,7 @@ namespace Ombi.Core.Rule.Rules.Request
{
if (await _manager.IsInRoleAsync(user, OmbiRoles.RequestMovie) || await _manager.IsInRoleAsync(user, OmbiRoles.AutoApproveMovie))
return Success();
return Fail("You do not have permissions to Request a Movie");
return Fail(ErrorCode.NoPermissionsRequestMovie, "You do not have permissions to Request a Movie");
}
if (obj.RequestType == RequestType.TvShow)
@ -44,7 +45,7 @@ namespace Ombi.Core.Rule.Rules.Request
return Success();
}
return Fail("You do not have permissions to Request a TV Show");
return Fail(ErrorCode.NoPermissionsRequestTV, "You do not have permissions to Request a TV Show");
}
if (obj.RequestType == RequestType.Album)
@ -54,7 +55,7 @@ namespace Ombi.Core.Rule.Rules.Request
return Success();
}
return Fail("You do not have permissions to Request an Album");
return Fail(ErrorCode.NoPermissionsRequestAlbum, "You do not have permissions to Request an Album");
}
throw new InvalidDataException("Permission check failed: unknown RequestType");