Просмотр файла vendor/symfony/translation/TranslatorInterface.php

Размер файла: 2.14Kb
  1. <?php
  2.  
  3. /*
  4. * This file is part of the Symfony package.
  5. *
  6. * (c) Fabien Potencier <fabien@symfony.com>
  7. *
  8. * For the full copyright and license information, please view the LICENSE
  9. * file that was distributed with this source code.
  10. */
  11.  
  12. namespace Symfony\Component\Translation;
  13.  
  14. /**
  15. * TranslatorInterface.
  16. *
  17. * @author Fabien Potencier <fabien@symfony.com>
  18. */
  19. interface TranslatorInterface
  20. {
  21. /**
  22. * Translates the given message.
  23. *
  24. * @param string $id The message id (may also be an object that can be cast to string)
  25. * @param array $parameters An array of parameters for the message
  26. * @param string|null $domain The domain for the message or null to use the default
  27. * @param string|null $locale The locale or null to use the default
  28. *
  29. * @return string The translated string
  30. *
  31. * @throws InvalidArgumentException If the locale contains invalid characters
  32. */
  33. public function trans($id, array $parameters = array(), $domain = null, $locale = null);
  34.  
  35. /**
  36. * Translates the given choice message by choosing a translation according to a number.
  37. *
  38. * @param string $id The message id (may also be an object that can be cast to string)
  39. * @param int $number The number to use to find the indice of the message
  40. * @param array $parameters An array of parameters for the message
  41. * @param string|null $domain The domain for the message or null to use the default
  42. * @param string|null $locale The locale or null to use the default
  43. *
  44. * @return string The translated string
  45. *
  46. * @throws InvalidArgumentException If the locale contains invalid characters
  47. */
  48. public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null);
  49.  
  50. /**
  51. * Sets the current locale.
  52. *
  53. * @param string $locale The locale
  54. *
  55. * @throws InvalidArgumentException If the locale contains invalid characters
  56. */
  57. public function setLocale($locale);
  58.  
  59. /**
  60. * Returns the current locale.
  61. *
  62. * @return string The locale
  63. */
  64. public function getLocale();
  65. }