A tumblelog CMS built on AJAX, PHP and MySQL.

lang.php 734B

123456789101112131415161718192021222324252627282930313233343536
  1. <?
  2. $idiomas = array();
  3. $idiomas['es_MX'] = "Espa&ntilde;ol de M&eacute;xico";
  4. $idiomas['en'] = "English";
  5. function esIdioma($test) {
  6. global $idiomas;
  7. if (isset($idiomas[$test]))
  8. return true;
  9. else
  10. return false;
  11. }
  12. function initIdioma($lang = "en") {
  13. global $locale, $l10n;
  14. if (!esIdioma($locale) && esIdioma($lang)) {
  15. $locale = $lang;
  16. }
  17. $input = new FileReader(dirname(__FILE__)."/../idiomas/". $locale ."/lang.mo");
  18. $l10n = new gettext_reader($input);
  19. }
  20. // Standard wrappers for xgettext
  21. function __($text) {
  22. global $l10n;
  23. return $l10n->translate($text);
  24. }
  25. function T_ngettext($single, $plural, $number) {
  26. global $l10n;
  27. return $l10n->ngettext($single, $plural, $number);
  28. }
  29. ?>