change the name of files in classes for gettext (multi languages)
parent
b4b10c94da
commit
009d010937
|
|
@ -1,28 +1,11 @@
|
|||
<?
|
||||
$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;
|
||||
}
|
||||
|
||||
<?php
|
||||
function initIdioma($lang = "en") {
|
||||
global $locale, $l10n;
|
||||
|
||||
if (!esIdioma($locale) && esIdioma($lang)) {
|
||||
$locale = $lang;
|
||||
}
|
||||
|
||||
$input = new FileReader(dirname(__FILE__)."/../idiomas/". $locale ."/lang.mo");
|
||||
$l10n = new gettext_reader($input);
|
||||
}
|
||||
|
||||
// Standard wrappers for xgettext
|
||||
function __($text) {
|
||||
global $l10n;
|
||||
return $l10n->translate($text);
|
||||
Loading…
Reference in New Issue