Merge pull request #36890 from nextcloud/bugfix/noid/translation-api-annotation

fix(translation): Allow regular users to use translation api endpoints
pull/36936/head
Julius Härtl 2 years ago committed by GitHub
commit 416efc12d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      core/Controller/TranslationApiController.php

@ -43,6 +43,9 @@ class TranslationApiController extends \OCP\AppFramework\OCSController {
$this->translationManager = $translationManager;
}
/**
* @NoAdminRequired
*/
public function languages(): DataResponse {
return new DataResponse([
'languages' => $this->translationManager->getLanguages(),
@ -50,6 +53,9 @@ class TranslationApiController extends \OCP\AppFramework\OCSController {
]);
}
/**
* @NoAdminRequired
*/
public function translate(string $text, ?string $fromLanguage, string $toLanguage): DataResponse {
try {
return new DataResponse([

Loading…
Cancel
Save