change the name of files in classes for gettext (multi languages)

master
Victor De la Rocha 2007-07-20 05:24:11 +00:00
parent b4b10c94da
commit 009d010937
3 changed files with 1 additions and 18 deletions

View File

@ -1,28 +1,11 @@
<? <?php
$idiomas = array();
$idiomas['es_MX'] = "Espa&ntilde;ol de M&eacute;xico";
$idiomas['en'] = "English";
function esIdioma($test) {
global $idiomas;
if (isset($idiomas[$test]))
return true;
else
return false;
}
function initIdioma($lang = "en") { function initIdioma($lang = "en") {
global $locale, $l10n; global $locale, $l10n;
if (!esIdioma($locale) && esIdioma($lang)) {
$locale = $lang;
}
$input = new FileReader(dirname(__FILE__)."/../idiomas/". $locale ."/lang.mo"); $input = new FileReader(dirname(__FILE__)."/../idiomas/". $locale ."/lang.mo");
$l10n = new gettext_reader($input); $l10n = new gettext_reader($input);
} }
// Standard wrappers for xgettext
function __($text) { function __($text) {
global $l10n; global $l10n;
return $l10n->translate($text); return $l10n->translate($text);