mirror of
https://github.com/Kareadita/Kavita.git
synced 2026-06-05 06:15:25 -04:00
28 lines
1017 B
C#
28 lines
1017 B
C#
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using Kavita.Models.DTOs;
|
|
|
|
namespace Kavita.API.Services;
|
|
|
|
public interface ILocalizationService
|
|
{
|
|
Task<string> GetAsync(string locale, string key, params object[] args);
|
|
/// <summary>
|
|
/// Returns a translated string for the currently authenticated user (Via <see cref="Kavita.API.Store.IUserContext"/>).
|
|
/// Falling back to English or the key
|
|
/// </summary>
|
|
/// <param name="key"></param>
|
|
/// <param name="args"></param>
|
|
/// <returns></returns>
|
|
Task<string> TranslateAsync(string key, params object[] args);
|
|
/// <summary>
|
|
/// Returns a translated string for a given user's locale, falling back to english or the key if missing
|
|
/// </summary>
|
|
/// <param name="userId"></param>
|
|
/// <param name="key"></param>
|
|
/// <param name="args"></param>
|
|
/// <returns></returns>
|
|
Task<string> TranslateAsync(int userId, string key, params object[] args);
|
|
IEnumerable<KavitaLocale> GetLocales();
|
|
}
|