Table of Contents

Class TranslationController

Namespace
GastroSky.Controllers.V1
Assembly
GastroSky.dll

All endpoints concerning translations and GastroSky's Glitched Locale Server integration.

[ApiController]
[Authorize]
[Route("api/v1/translations")]
[Produces("application/json", new string[] { })]
public class TranslationController : GastroSkyControllerBase
Inheritance
TranslationController
Inherited Members

Constructors

TranslationController(ITranslationService)

All endpoints concerning translations and GastroSky's Glitched Locale Server integration.

public TranslationController(ITranslationService translationService)

Parameters

translationService ITranslationService

Methods

ForceRefresh()

Forces a refresh of the localization cache and fetches the most recent translations from the Glitched Locale Server.

[HttpPost]
[Authorize(Policy = "https://api.gastrosky.ch/identity/claims/resources/translations:W")]
[Route("refresh")]
[ProducesResponseType(200)]
public Task<IActionResult> ForceRefresh()

Returns

Task<IActionResult>

IActionResult

GetTranslations(string)

Gets frontend translations as a translation.json file from the Glitched Locale Server for a given localeId.

[HttpGet]
[AllowAnonymous]
[Route("{localeId}")]
[ProducesResponseType(200)]
[ProducesResponseType(404)]
public IActionResult GetTranslations(string localeId)

Parameters

localeId string

Locale ID as per POSIX ISO/IEC 15897:2011. E.g: en_US.UTF-8

Returns

IActionResult

IActionResult