Languages.php 516 B

123456789101112131415161718192021
  1. <?php
  2. /**
  3. * Wrapper function for translation which match the API
  4. * of gettext()/_() and ngettext().
  5. *
  6. * Not doing translation for now.
  7. *
  8. * @param string $text Text to translate.
  9. * @param string $nText The plural message ID.
  10. * @param int $nb The number of items for plural forms.
  11. *
  12. * @return String Text translated.
  13. */
  14. function t($text, $nText = '', $nb = 0) {
  15. if (empty($nText)) {
  16. return $text;
  17. }
  18. $actualForm = $nb > 1 ? $nText : $text;
  19. return sprintf($actualForm, $nb);
  20. }