mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-05-24 00:52:23 -04:00
* Implemented the ability to login to the app by passing apiKey to the login. This is for an upcoming feature (but currently blocked by another story) * Added a comment * Ensure locales are sorted * Added a new status badge that shows how many active installs we have via users that use stats. * Bump all GA to latest versions * Bumped dependencies * Bumped backend notifications * Updated ngx-pdf-reader to upcoming beta which fixes some PDFs taking time to load. PDF reader will use browser locale to load localization rather than Kavita locale for now. * Downgraded pdf viewer as beta has lots of bugs.
33 lines
900 B
C#
33 lines
900 B
C#
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
using API.DTOs.Filtering;
|
|
using API.Services;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace API.Controllers;
|
|
|
|
public class LocaleController : BaseApiController
|
|
{
|
|
private readonly ILocalizationService _localizationService;
|
|
|
|
public LocaleController(ILocalizationService localizationService)
|
|
{
|
|
_localizationService = localizationService;
|
|
}
|
|
|
|
[HttpGet]
|
|
public ActionResult<IEnumerable<string>> GetAllLocales()
|
|
{
|
|
var languages = _localizationService.GetLocales().Select(c => new CultureInfo(c)).Select(c =>
|
|
new LanguageDto()
|
|
{
|
|
Title = c.DisplayName,
|
|
IsoCode = c.IetfLanguageTag
|
|
})
|
|
.Where(l => !string.IsNullOrEmpty(l.IsoCode))
|
|
.OrderBy(d => d.Title);
|
|
return Ok(languages);
|
|
}
|
|
}
|