|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using NzbDrone.Core.Localization;
|
|
|
|
|
using Radarr.Http;
|
|
|
|
|
|
|
|
|
@ -11,12 +12,21 @@ namespace Radarr.Api.V3.Localization
|
|
|
|
|
{
|
|
|
|
|
_localizationService = localizationService;
|
|
|
|
|
|
|
|
|
|
GetResourceSingle = GetLocalizationDictionary;
|
|
|
|
|
Get("/", x => GetLocalizationDictionary());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private LocalizationResource GetLocalizationDictionary()
|
|
|
|
|
private string GetLocalizationDictionary()
|
|
|
|
|
{
|
|
|
|
|
return _localizationService.GetLocalizationDictionary().ToResource();
|
|
|
|
|
// 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);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|