LanguageBundleInterface.php 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Intl\ResourceBundle;
  11. /**
  12. * Gives access to language-related ICU data.
  13. *
  14. * @author Bernhard Schussek <bschussek@gmail.com>
  15. */
  16. interface LanguageBundleInterface extends ResourceBundleInterface
  17. {
  18. /**
  19. * Returns the name of a language.
  20. *
  21. * @param string $language A language code (e.g. "en")
  22. * @param string|null $region Optional. A region code (e.g. "US")
  23. * @param string $displayLocale Optional. The locale to return the name in
  24. * Defaults to {@link \Locale::getDefault()}.
  25. *
  26. * @return string|null The name of the language or NULL if not found
  27. */
  28. public function getLanguageName($language, $region = null, $displayLocale = null);
  29. /**
  30. * Returns the names of all known languages.
  31. *
  32. * @param string $displayLocale Optional. The locale to return the names in
  33. * Defaults to {@link \Locale::getDefault()}.
  34. *
  35. * @return string[] A list of language names indexed by language codes
  36. */
  37. public function getLanguageNames($displayLocale = null);
  38. /**
  39. * Returns the name of a script.
  40. *
  41. * @param string $script A script code (e.g. "Hans")
  42. * @param string $language Optional. A language code (e.g. "zh")
  43. * @param string $displayLocale Optional. The locale to return the name in
  44. * Defaults to {@link \Locale::getDefault()}.
  45. *
  46. * @return string|null The name of the script or NULL if not found
  47. */
  48. public function getScriptName($script, $language = null, $displayLocale = null);
  49. /**
  50. * Returns the names of all known scripts.
  51. *
  52. * @param string $displayLocale Optional. The locale to return the names in
  53. * Defaults to {@link \Locale::getDefault()}.
  54. *
  55. * @return string[] A list of script names indexed by script codes
  56. */
  57. public function getScriptNames($displayLocale = null);
  58. }