Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Smarty et les sites mutli-langues

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French
View previous topic :: View next topic  
Author Message
laresistance2
Smarty Rookie


Joined: 29 Nov 2010
Posts: 23

PostPosted: Mon Nov 29, 2010 11:00 pm    Post subject: Smarty et les sites mutli-langues Reply with quote

Bonjour,
Voilà je débute en Smarty et je dois faire un site multi-langue.
je voudrais donc avoir vos avis si c'est une bonne idée de créer une fonction ou un modificateur(je ne sais pas lequel est le plus approprié) pour les clés des langues
Car je remarque que beaucoup de scripts (CMS) on des fonctions spécialement pour les langues
Voici un exemple de mon site :
fichier langue (language/lang_french/core.php):
Code:
<?php
$LANG = array (

//---------------//
'title_site_home' => 'Bienvenue sur mon site',
'home' => 'Accueil',
'h1_description' => 'Bienvenue sur mon site',
);
?>


ma page index.php
Code:
<?php
define ('SMARTY_DIR', 'libs/Smarty/Smarty.class.php');
require(SMARTY_DIR);
require_once ('language/lang_french/core.php');
$smarty = new Smarty();
$smarty->assign('LANG', $LANG);
$smarty->display(index.tpl');
}
?>


index.tpl
Code:
{include file="header.tpl"}

<p>{$LANG.title_site_home}</p>

{include file="footer.tpl"}


Et avez vous une idée de la fonction que je pourrais créer
Merci
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: French All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP