gettext_dngettext-plural.phpt 604 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. Test if dngettext() returns the correct translations (optionally plural).
  3. --EXTENSIONS--
  4. gettext
  5. --SKIPIF--
  6. <?php
  7. if (!setlocale(LC_ALL, 'en_US.UTF-8')) {
  8. die("skip en_US.UTF-8 locale not supported.");
  9. }
  10. --FILE--
  11. <?php
  12. chdir(__DIR__);
  13. putenv('LC_ALL=en_US.UTF-8');
  14. setlocale(LC_ALL, 'en_US.UTF-8');
  15. bindtextdomain('dngettextTest', './locale');
  16. var_dump(dngettext('dngettextTest', 'item', 'items', 1));
  17. var_dump(dngettext('dngettextTest', 'item', 'items', 2));
  18. ?>
  19. --EXPECT--
  20. string(7) "Produkt"
  21. string(8) "Produkte"
  22. --CREDITS--
  23. Till Klampaeckel, till@php.net
  24. PHP Testfest Berlin 2009-05-09