A tumblelog CMS built on AJAX, PHP and MySQL.

lang.functions.php 903B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. if (!defined('entry') || !entry) {
  3. die('Not a valid page');
  4. }
  5. /* ===========================
  6. gelato CMS - A PHP based tumblelog CMS
  7. development version
  8. http://www.gelatocms.com/
  9. gelato CMS is a free software licensed under the GPL 2.0
  10. Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
  11. =========================== */
  12. ?>
  13. <?php
  14. require_once("streams.class.php");
  15. require_once("gettext.class.php");
  16. function initLang($lang = "en")
  17. {
  18. global $l10n;
  19. $input = new FileReader(dirname(__FILE__).DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."languages".DIRECTORY_SEPARATOR.$lang.DIRECTORY_SEPARATOR."messages.mo");
  20. $l10n = new gettext_reader($input);
  21. }
  22. function __($text)
  23. {
  24. global $l10n;
  25. return $l10n->translate($text);
  26. }
  27. function T_ngettext($single, $plural, $number)
  28. {
  29. global $l10n;
  30. return $l10n->ngettext($single, $plural, $number);
  31. }
  32. ?>