change the name of files in classes for gettext (multi languages)
parent
b4b10c94da
commit
009d010937
|
|
@ -1,28 +1,11 @@
|
||||||
<?
|
<?php
|
||||||
$idiomas = array();
|
|
||||||
$idiomas['es_MX'] = "Español de Mé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);
|
||||||
Loading…
Reference in New Issue