2013-02-16, 21:29:25
(2013-02-16, 20:55:08)mvlcek Wrote:(2013-02-16, 20:32:52)alex_d Wrote: Is there a way to call other (language specific) include template within main template when switching language?
So lets say I have ‘template.php’ for English with one include template<?php include(name-EN.inc.php'); ?>.
Now when I switch to the second language for example German, the ‘template.php’ should load only second (German specific) include template <?php include(name-DE.inc.php'); ?>
The currently displayed language can be found in the global variable $language.
So your main template file could look like this:
and the language specific templates would be template-en.inc.php, etc.Code:<?php
global $language;
include('template-'.$language.'.inc.php');
If there are just small differences between the languages, you could also just add the language as style to the body tag and do the styling with css - template.php:
CSS file:Code:...
<body class="lang-<?php global $language; echo $language; ?>">
...
Code:...
body.lang-de p { /* special styles for paragraphes in german */ }
...
HI Mvlicek,
Thanx for your quick response!
Alex