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