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..

Re: Add more than one language?

looking for the same thing.. pm me if you have a solution please.

Thumbs up

Re: Add more than one language?

Is this the effect you where aiming for?
http://img710.imageshack.us/img710/4839/previewlang.png
This is based of chevereto 1.7 which has multi language support by default, I just made it switchable.

Thumbs up

Re: Add more than one language?

yes this is what im looking for big_smile

Re: Add more than one language?

Please tell me how to do this big_smile

Re: Add more than one language?

booyaka95 wrote:

Please tell me how to do this big_smile

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 (2010-01-24 06:16:38)

Thumbs up

Re: Add more than one language?

Thank you ;D

Re: Add more than one language?

Does it work with Chevereto 1.6 ?

Re: Add more than one language?

booyaka95 wrote:

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.

Thumbs up

Re: Add more than one language?

Yes it works.
thank you very much !! big_smile