OptionInterface.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\Locale;
  7. /**
  8. * Interface for classes that return array of locales.
  9. */
  10. interface OptionInterface
  11. {
  12. /**
  13. * Get array of deployed locales.
  14. *
  15. * Function result has next format:
  16. * ```php
  17. * [
  18. * 0 => [
  19. * 'value' => 'de_DE'
  20. * 'label' => 'German (Germany)'
  21. * ],
  22. * 1 => [
  23. * 'value' => 'en_GB'
  24. * 'label' => 'English (United Kingdom)'
  25. * ],
  26. * ]
  27. * ```
  28. *
  29. * @return array
  30. */
  31. public function getOptionLocales();
  32. /**
  33. * Get array of deployed locales with translation.
  34. *
  35. * Function result has next format:
  36. * ```php
  37. * [
  38. * 0 => [
  39. * 'value' => 'de_DE'
  40. * 'label' => 'Deutsch (Deutschland) / German (Germany)'
  41. * ],
  42. * 1 => [
  43. * 'value' => 'en_GB'
  44. * 'label' => 'English (United Kingdom) / English (United Kingdom)'
  45. * ],
  46. * ]
  47. * ```
  48. *
  49. * @return array
  50. */
  51. public function getTranslatedOptionLocales();
  52. }