Topic: Add more than one language?
Can someone help me i would at more languages on my image hoster..
in the right corner a flag for german etc..
Comunity dedicated to the development and improvement of Chevereto NB
You are not logged in. Please login or register.
Can someone help me i would at more languages on my image hoster..
in the right corner a flag for german etc..
looking for the same thing.. pm me if you have a solution please.
Please tell me how to do this
Ok well, it's nothing fancy but here's it:
Find in engine.php :
// LANGUAGE
include('lang/'.LANG.'.php');
if (LANG!=='es') { $lang = LANG; }Replace it with this:
// LANGUAGE
//if (LANG !=='es') { $lang = LANG; }
if (isset($_GET['lang'])) {
$lang = $_GET['lang'];
$_SESSION['chev_lang'] = $_GET['lang']; //storing current language in session
} elseif (isset($_SESSION['chev_lang'])) {
$lang = $_SESSION['chev_lang']; //getting the language from the session
} else {
$lang = LANG;
}
include('lang/'.$lang.'.php');Find in index.php
<!-- selector -->Replace it with:
<!--language selector-->
<div id="languages" class="lang_selector">
<!--dutch/ used this a template-->
<a href="<?=$_SERVER['PHP_SELF']?>?lang=nl" title="Dutch"><img src="<?=PATH_SCRIPT;?>site-img/lang/nl.png" alt="dutch"></a>
<a href="<?=$_SERVER['PHP_SELF']?>?lang=fr" title="French"><img src="<?=PATH_SCRIPT;?>site-img/lang/fr.png" alt="French"></a>
<a href="<?=$_SERVER['PHP_SELF']?>?lang=es" title="Spanis"><img src="<?=PATH_SCRIPT;?>site-img/lang/es.png" alt="Spanis"></a>
<a href="<?=$_SERVER['PHP_SELF']?>?lang=en" title="English"><img src="<?=PATH_SCRIPT;?>site-img/lang/gb.png" alt="English"></a>
<a href="<?=$_SERVER['PHP_SELF']?>?lang=cn" title="Chinees"><img src="<?=PATH_SCRIPT;?>site-img/lang/cn.png" alt="Chinees"></a>
</div>
<!-- selector -->Now all these languages are hard coded. If want to add more just adding another line copied from one of the examples.
Now add to the end of estilo.css
/* Langauge selectors */
div#languages {
position:relative;
float:right;
border:0px;
text-decoration:none;
}
#languages img {
border:0px;
}Finally download and extract this zip
into site-image/lang
http://www.famfamfam.com/lab/icons/flags/
This should give you the same result as the image I showed earlier. If not don't hesitate to ask.
[Edit]
Sorry if anyone already followed this but if forgot to tell that you need to put
session_start();right after the <? in index.php
This is so that it remembers which language the user selected.
Last edited by gamerlv (01/24/2010 06:16:38)
Does it work with Chevereto 1.6 ?
I haven't tested it but looking at the 1.6rev2 zip it should. As long as it has multiple language support it should work.