You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

il10n.php 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <?php
  2. /**
  3. * @author Bart Visscher <bartv@thisnet.nl>
  4. * @author Bernhard Posselt <dev@bernhard-posselt.com>
  5. * @author Joas Schilling <nickvergessen@owncloud.com>
  6. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  7. * @author Morris Jobke <hey@morrisjobke.de>
  8. * @author Robin McCorkell <robin@mccorkell.me.uk>
  9. * @author Thomas Müller <thomas.mueller@tmit.eu>
  10. *
  11. * @copyright Copyright (c) 2016, ownCloud, Inc.
  12. * @license AGPL-3.0
  13. *
  14. * This code is free software: you can redistribute it and/or modify
  15. * it under the terms of the GNU Affero General Public License, version 3,
  16. * as published by the Free Software Foundation.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU Affero General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Affero General Public License, version 3,
  24. * along with this program. If not, see <http://www.gnu.org/licenses/>
  25. *
  26. */
  27. /**
  28. * Public interface of ownCloud for apps to use.
  29. * L10n interface
  30. *
  31. */
  32. // use OCP namespace for all classes that are considered public.
  33. // This means that they should be used by apps instead of the internal ownCloud classes
  34. namespace OCP;
  35. /**
  36. * Interface IL10N
  37. *
  38. * @package OCP
  39. * @since 6.0.0
  40. */
  41. interface IL10N {
  42. /**
  43. * Translating
  44. * @param string $text The text we need a translation for
  45. * @param array $parameters default:array() Parameters for sprintf
  46. * @return \OC_L10N_String Translation or the same text
  47. *
  48. * Returns the translation. If no translation is found, $text will be
  49. * returned.
  50. * @since 6.0.0
  51. */
  52. public function t($text, $parameters = array());
  53. /**
  54. * Translating
  55. * @param string $text_singular the string to translate for exactly one object
  56. * @param string $text_plural the string to translate for n objects
  57. * @param integer $count Number of objects
  58. * @param array $parameters default:array() Parameters for sprintf
  59. * @return \OC_L10N_String Translation or the same text
  60. *
  61. * Returns the translation. If no translation is found, $text will be
  62. * returned. %n will be replaced with the number of objects.
  63. *
  64. * The correct plural is determined by the plural_forms-function
  65. * provided by the po file.
  66. * @since 6.0.0
  67. *
  68. */
  69. public function n($text_singular, $text_plural, $count, $parameters = array());
  70. /**
  71. * Localization
  72. * @param string $type Type of localization
  73. * @param int|string $data parameters for this localization
  74. * @param array $options currently supports following options:
  75. * - 'width': handed into \Punic\Calendar::formatDate as second parameter
  76. * @return string|false
  77. *
  78. * Returns the localized data.
  79. *
  80. * Implemented types:
  81. * - date
  82. * - Creates a date
  83. * - l10n-field: date
  84. * - params: timestamp (int/string)
  85. * - datetime
  86. * - Creates date and time
  87. * - l10n-field: datetime
  88. * - params: timestamp (int/string)
  89. * - time
  90. * - Creates a time
  91. * - l10n-field: time
  92. * - params: timestamp (int/string)
  93. * @since 6.0.0 - parameter $options was added in 8.0.0
  94. */
  95. public function l($type, $data, $options = array());
  96. /**
  97. * The code (en, de, ...) of the language that is used for this IL10N object
  98. *
  99. * @return string language
  100. * @since 7.0.0
  101. */
  102. public function getLanguageCode();
  103. }