You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.1 KiB
34 lines
1.1 KiB
using Microsoft.AspNetCore.Mvc;
|
|
using Newtonsoft.Json;
|
|
using NzbDrone.Core.Localization;
|
|
using Prowlarr.Http;
|
|
|
|
namespace Prowlarr.Api.V1.Localization
|
|
{
|
|
[V1ApiController]
|
|
public class LocalizationController : Controller
|
|
{
|
|
private readonly ILocalizationService _localizationService;
|
|
|
|
public LocalizationController(ILocalizationService localizationService)
|
|
{
|
|
_localizationService = localizationService;
|
|
}
|
|
|
|
[HttpGet]
|
|
public string GetLocalizationDictionary()
|
|
{
|
|
// We don't want camel case for transation strings, create new serializer settings
|
|
var serializerSettings = new JsonSerializerSettings
|
|
{
|
|
DateTimeZoneHandling = DateTimeZoneHandling.Utc,
|
|
NullValueHandling = NullValueHandling.Ignore,
|
|
Formatting = Formatting.Indented,
|
|
DefaultValueHandling = DefaultValueHandling.Include
|
|
};
|
|
|
|
return JsonConvert.SerializeObject(_localizationService.GetLocalizationDictionary().ToResource(), serializerSettings);
|
|
}
|
|
}
|
|
}
|