ngettext.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * SquirrelMail Test Plugin
  4. *
  5. * This page tests the ngettext() function.
  6. *
  7. * @copyright &copy; 2006 The SquirrelMail Project Team
  8. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  9. * @version $Id$
  10. * @package plugins
  11. * @subpackage test
  12. */
  13. include_once('../../include/init.php');
  14. global $oTemplate, $color;
  15. displayPageHeader($color, 'none');
  16. sq_change_text_domain('test');
  17. // NOTE: Not bothering to "templatize" the following output, since
  18. // this plugin is merely an administrative (and not user-facing)
  19. // tool. If this is really important to you, please help by
  20. // submitting the work to the team.
  21. ?>
  22. <strong>ngettext Test Strings:</strong>
  23. <p>The results of this test depend on your current language (translation) selection (see Options ==> Display Preferences) and the corresponding translation strings in locale/xx/LC_MESSAGES/test.mo</p>
  24. <pre>
  25. <?php
  26. for ($i = -10 ; $i <= 250 ; $i++) {
  27. echo sprintf(ngettext("%s squirrel is on the tree.", "%s squirrels are on the tree.", $i), $i);
  28. echo "\n";
  29. }
  30. echo "</pre>";
  31. sq_change_text_domain('squirrelmail');
  32. $oTemplate->display('footer.tpl');