gettext_basic-enus.phpt 578 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Gettext basic test with en_US locale that should be on nearly every system
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded("gettext")) {
  6. die("skip\n");
  7. }
  8. if (!setlocale(LC_ALL, 'en_US.UTF-8')) {
  9. die("skip en_US.UTF-8 locale not supported.");
  10. }
  11. ?>
  12. --FILE--
  13. <?php
  14. chdir(dirname(__FILE__));
  15. setlocale(LC_ALL, 'en_US.UTF-8');
  16. bindtextdomain ("messages", "./locale");
  17. textdomain ("messages");
  18. echo gettext("Basic test"), "\n";
  19. echo _("Basic test"), "\n";
  20. ?>
  21. --EXPECT--
  22. A basic test
  23. A basic test
  24. --CREDITS--
  25. Christian Weiske, cweiske@php.net
  26. PHP Testfest Berlin 2009-05-09