ITranslationProvider.php 603 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Translation;
  8. use RuntimeException;
  9. /**
  10. * @since 26.0.0
  11. */
  12. interface ITranslationProvider {
  13. /**
  14. * @since 26.0.0
  15. */
  16. public function getName(): string;
  17. /**
  18. * @since 26.0.0
  19. */
  20. public function getAvailableLanguages(): array;
  21. /**
  22. * @since 26.0.0
  23. * @throws RuntimeException If the text could not be translated
  24. */
  25. public function translate(?string $fromLanguage, string $toLanguage, string $text): string;
  26. }