A tumblelog CMS built on AJAX, PHP and MySQL.

lang.functions.php 810B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. if (!defined('entry') || !entry) {
  3. die('Not a valid page');
  4. }
  5. /* ===========================
  6. Sorbet CMS - A PHP based tumblelog CMS forked from Gelato CMS
  7. Sorbet CMS is a free software licensed under the GPL 3.0
  8. =========================== */
  9. ?>
  10. <?php
  11. require_once("streams.class.php");
  12. require_once("gettext.class.php");
  13. function initLang($lang = "en")
  14. {
  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. {
  21. global $l10n;
  22. return $l10n->translate($text);
  23. }
  24. function T_ngettext($single, $plural, $number)
  25. {
  26. global $l10n;
  27. return $l10n->ngettext($single, $plural, $number);
  28. }
  29. ?>