TranslatorLoaderInterface.php 804 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * This file is part of Hyperf.
  5. *
  6. * @link https://www.hyperf.io
  7. * @document https://hyperf.wiki
  8. * @contact group@hyperf.io
  9. * @license https://github.com/hyperf/hyperf/blob/master/LICENSE
  10. */
  11. namespace Hyperf\Contract;
  12. interface TranslatorLoaderInterface
  13. {
  14. /**
  15. * Load the messages for the given locale.
  16. */
  17. public function load(string $locale, string $group, ?string $namespace = null): array;
  18. /**
  19. * Add a new namespace to the loader.
  20. */
  21. public function addNamespace(string $namespace, string $hint);
  22. /**
  23. * Add a new JSON path to the loader.
  24. */
  25. public function addJsonPath(string $path);
  26. /**
  27. * Get an array of all the registered namespaces.
  28. */
  29. public function namespaces(): array;
  30. }