Added langs in configuration

master
Victor De la Rocha 2009-01-09 09:15:38 +00:00
parent 44a1d936fd
commit d6b78f7d54
4 changed files with 12 additions and 8 deletions

View File

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

View File

@ -23,8 +23,10 @@ function initLang($lang = "en") {
}
function __($text) {
global $l10n;
return $l10n->translate($text);
global $l10n;
if($l10n)
return $l10n->translate($text);
return $text;
}
function T_ngettext($single, $plural, $number) {

View File

@ -402,11 +402,10 @@ class util {
$dir = (substr(PHP_OS, 0, 3) == 'WIN') ? $path."\\".$langs_dir : $path."/".$langs_dir;
$dir = str_replace("admin\\", "", $dir);
$dir = str_replace("admin/", "", $dir);
$i=0;
$i=0;
$cls_lang_dir = @ dir($dir);
while (($directory = $cls_lang_dir->read()) !== false) {
if($directory != "." && $directory != "..") {
$dir2 = (substr(PHP_OS, 0, 3) == 'WIN') ? $path."\\".$langs_dir."\\".$directory : $path."/".$langs_dir."/".$directory;
$dir2 = str_replace("admin\\", "", $dir2);
$dir2 = str_replace("admin/", "", $dir2);
@ -669,4 +668,4 @@ class util {
}
}
}
?>
?>

View File

@ -41,7 +41,8 @@ $theme->set('title',isset($install->data['title'])?$install->data['title']:'');
$theme->set('description',isset($install->data['description'])?$install->data['description']:'');
$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):''));
$theme->set('themes',util::getThemes());
$theme->set('themes',util::getThemes());
$theme->set('langs',util::getLangs());
for($c=1;$c<=10;$c++)$errores[$c] = $install->mostrarerror($c);
$theme->set('error',$errores);