Skip to content

Commit

Permalink
fix(translation): Allow regular users to use translation api endpoints
Browse files Browse the repository at this point in the history
Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr committed Feb 28, 2023
1 parent a3ab0ce commit a0ecc37
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/Controller/TranslationApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,19 @@ public function __construct($appName, IRequest $request, ITranslationManager $tr
$this->translationManager = $translationManager;
}

/**
* @NoAdminRequired
*/
public function languages(): DataResponse {
return new DataResponse([
'languages' => $this->translationManager->getLanguages(),
'languageDetection' => $this->translationManager->canDetectLanguage(),
]);
}

/**
* @NoAdminRequired
*/
public function translate(string $text, ?string $fromLanguage, string $toLanguage): DataResponse {
try {
return new DataResponse([
Expand Down

0 comments on commit a0ecc37

Please sign in to comment.