Kaynağa Gözat

Added langs in configuration

Victor De la Rocha 16 yıl önce
ebeveyn
işleme
d6b78f7d54

+ 4 - 2
admin/themes/admin/install.htm Dosyayı Görüntüle

@@ -29,7 +29,7 @@
29 29
 					<fieldset class="install">
30 30
 						<legend class="install">Database Settings</legend>
31 31
 						<ul>
32
-							<li><label for="login">Are you the admin? please write the database name User</label>
32
+							<li><label for="login">Are you the admin? Write the same data that "DB_User" in config.php</label>
33 33
 								<input type="text" name="db_login" id="db_login" value="{db_login}" class="txt"/>{error.9}</li>
34 34
 						</ul>
35 35
 					</fieldset><br  />
@@ -59,7 +59,9 @@
59 59
 								<input type="text" name="posts_limit" id="posts_limit" value="10" class="txt"/></li>
60 60
 							<li><label for="lang">Language:</label>
61 61
 								<select id="lang" name="lang">
62
-									<option value="en" selected="selected">english</option>
62
+									{block $langs as $k=>$v}
63
+										<option value="{$k}" {if $k=='en'}selected="selected"{/if}>{$v}</option>
64
+									{/block}
63 65
 								</select>
64 66
 							</li>
65 67
 							<li><label for="template">Template:</label>

+ 4 - 2
classes/lang.functions.php Dosyayı Görüntüle

@@ -23,8 +23,10 @@ function initLang($lang = "en") {
23 23
 }
24 24
 
25 25
 function __($text) {
26
-	global $l10n;
27
-	return $l10n->translate($text);
26
+	global $l10n;
27
+	if($l10n)
28
+		return $l10n->translate($text);
29
+	return $text;	
28 30
 }
29 31
 
30 32
 function T_ngettext($single, $plural, $number) {

+ 2 - 3
classes/util.class.php Dosyayı Görüntüle

@@ -402,11 +402,10 @@ class util {
402 402
  		$dir = (substr(PHP_OS, 0, 3) == 'WIN') ? $path."\\".$langs_dir : $path."/".$langs_dir;
403 403
 		$dir = str_replace("admin\\", "", $dir);
404 404
 		$dir = str_replace("admin/", "", $dir);
405
- 		$i=0;
405
+ 		$i=0; 
406 406
 		$cls_lang_dir = @ dir($dir);
407 407
 		while (($directory = $cls_lang_dir->read()) !== false) {
408 408
 			if($directory != "." && $directory != "..") {
409
-
410 409
 				$dir2 = (substr(PHP_OS, 0, 3) == 'WIN') ? $path."\\".$langs_dir."\\".$directory : $path."/".$langs_dir."/".$directory;
411 410
 				$dir2 = str_replace("admin\\", "", $dir2);
412 411
 				$dir2 = str_replace("admin/", "", $dir2);
@@ -669,4 +668,4 @@ class util {
669 668
         }
670 669
 	}
671 670
 }
672
-?>
671
+?>

+ 2 - 1
install.php Dosyayı Görüntüle

@@ -41,7 +41,8 @@ $theme->set('title',isset($install->data['title'])?$install->data['title']:'');
41 41
 $theme->set('description',isset($install->data['description'])?$install->data['description']:'');
42 42
 
43 43
 $theme->set('url_installation',(isset($install->data['url_installation']) and $install->data['url_installation'])?$install->data['url_installation']:(isset($_SERVER['SCRIPT_URI'])?substr($_SERVER["SCRIPT_URI"], 0, -12):''));
44
-$theme->set('themes',util::getThemes());
44
+$theme->set('themes',util::getThemes());
45
+$theme->set('langs',util::getLangs());
45 46
 
46 47
 for($c=1;$c<=10;$c++)$errores[$c] = $install->mostrarerror($c);
47 48
 $theme->set('error',$errores);