A tumblelog CMS built on AJAX, PHP and MySQL.

lang.functions.php 907B

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