A tumblelog CMS built on AJAX, PHP and MySQL.

lang.functions.php 703B

12345678910111213141516171819202122232425262728293031
  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. function initIdioma($lang = "en") {
  12. global $locale, $l10n;
  13. $input = new FileReader(dirname(__FILE__)."/../idiomas/". $locale ."/lang.mo");
  14. $l10n = new gettext_reader($input);
  15. }
  16. function __($text) {
  17. global $l10n;
  18. return $l10n->translate($text);
  19. }
  20. function T_ngettext($single, $plural, $number) {
  21. global $l10n;
  22. return $l10n->ngettext($single, $plural, $number);
  23. }
  24. ?>