Browse Source

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

Victor De la Rocha 18 years ago
parent
commit
009d010937
3 changed files with 1 additions and 18 deletions
  1. 0 0
      classes/gettext.class.php
  2. 1 18
      classes/lang.functions.php
  3. 0 0
      classes/streams.class.php

classes/gettext.php → classes/gettext.class.php View File


classes/lang.php → classes/lang.functions.php View File

1
-<?
2
-$idiomas = array();
3
-$idiomas['es_MX'] = "Espa&ntilde;ol de M&eacute;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
 function initIdioma($lang = "en") {
2
 function initIdioma($lang = "en") {
15
 	global $locale, $l10n;
3
 	global $locale, $l10n;
16
 
4
 
17
-	if (!esIdioma($locale) && esIdioma($lang)) {
18
-		$locale = $lang;
19
-	}
20
-
21
 	$input = new FileReader(dirname(__FILE__)."/../idiomas/". $locale ."/lang.mo");
5
 	$input = new FileReader(dirname(__FILE__)."/../idiomas/". $locale ."/lang.mo");
22
 	$l10n = new gettext_reader($input);
6
 	$l10n = new gettext_reader($input);
23
 }
7
 }
24
 
8
 
25
-// Standard wrappers for xgettext
26
 function __($text) {
9
 function __($text) {
27
 	global $l10n;
10
 	global $l10n;
28
 	return $l10n->translate($text);
11
 	return $l10n->translate($text);

classes/streams.php → classes/streams.class.php View File