A tumblelog CMS built on AJAX, PHP and MySQL.

lang.functions.php 848B

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