-
Idea: Multilinguality
While dealing with my customers language files, I came up with a nice Idea for having a language switch between the provided english language and my newly created german language (which I could provide here, when it's finished and you want me to):
Look for
PHP Code:
if (! isset($_SESSION['LANG']))
{
require_once VSHARE_DIR . '/include/class.language.php';
language::cookie();
}
and change it to
PHP Code:
if(!isset($_GET['lang'])){
if (! isset($_SESSION['LANG']))
{
require_once VSHARE_DIR . '/include/class.language.php';
language::cookie();
}
} else {
require_once VSHARE_DIR . '/include/class.language.php';
language::validate($_GET['lang']);
}
All you need now is a link to your actual page with the addition of ?lang=nameyourfolderhere
Seems it works for me ...
-
Forget the above
Forget the above, there is a much more conveniant way to do it. Simply add the following to your .htaccess file:
Code:
RewriteRule ^lang/(.*)/ language.php?lang=$1 [L,QSA]
after that you can change language by using the following stucture:
Seems I am getting deeper into it ;-)