Hi,
I am working on a website with two languages. Is there any way to change the header of website when users select another language? (I am running Moodle 1.9). Thanks!!
My header is an image. span lang does not work.
You would need to construct an if else statement in your header.php file that checked which language string was chosen and echoed the appropriate image tag out... Should not be too hard to achieve.
Thank you for your reply. I'd appreciate any information you could give me because I know nothing about php. (should this be header.html?) Now I got everything working on multi-language on my Moodle site except header and footer. I put
<td width="690" align="left"><span lang="en" class="multilang" ><p class="footer_content">content.....</p></span><span lang="id" class="multilang" ><p class="footer_content">content.....</p></span> on footer to display either Indonesian or English based on what language that users have selected, but both languages are shown. I guess language filters do work on header and footer. Is that right? Thanks.
<td width="690" align="left"><span lang="en" class="multilang" ><p class="footer_content">content.....</p></span><span lang="id" class="multilang" ><p class="footer_content">content.....</p></span> on footer to display either Indonesian or English based on what language that users have selected, but both languages are shown. I guess language filters do work on header and footer. Is that right? Thanks.
I wrote this code. It does not work.
<?php
if (empty($USER->lang)) {
// user is guest or anonymous
$lang = optional_param("lang", "en_utf8");
} else {
$lang = $USER->lang;
}
switch ($lang) {
case 'en_utf8': do_sth '<img src="'.$CFG->themewww.'/'.current_theme().'/pix/fire_logo.png" width="950" height="88" alt="home" title="home">'); break;
case 'es_utf8': do_sth '<img src="'.$CFG->themewww.'/'.current_theme().'/pix/fire_header_id.png" width="950" height="88" alt="home" title="home">'); break;
}
?>
<?php
if (empty($USER->lang)) {
// user is guest or anonymous
$lang = optional_param("lang", "en_utf8");
} else {
$lang = $USER->lang;
}
switch ($lang) {
case 'en_utf8': do_sth '<img src="'.$CFG->themewww.'/'.current_theme().'/pix/fire_logo.png" width="950" height="88" alt="home" title="home">'); break;
case 'es_utf8': do_sth '<img src="'.$CFG->themewww.'/'.current_theme().'/pix/fire_header_id.png" width="950" height="88" alt="home" title="home">'); break;
}
?>
I do this and it works!
<?php
$lang = current_language();
if (empty($lang)) {
$lang = optional_param("lang", "en_utf8");
}
switch ($lang) {
case 'en_utf8': echo '<img src="../theme/CRK/pix/fire_logo.png" width="950" height="88" alt="home" title="home">'; break;
case 'id_utf8': echo '<img src="../theme/CRK/pix/fire_header_id.png" width="950" height="88" alt="home" title="home">'; break;
}
?>
Now my another task is how to change topic section when users change their language preference. I embed an iframe in the topic section, but I don't know how to change it when language switch.
<?php
$lang = current_language();
if (empty($lang)) {
$lang = optional_param("lang", "en_utf8");
}
switch ($lang) {
case 'en_utf8': echo '<img src="../theme/CRK/pix/fire_logo.png" width="950" height="88" alt="home" title="home">'; break;
case 'id_utf8': echo '<img src="../theme/CRK/pix/fire_header_id.png" width="950" height="88" alt="home" title="home">'; break;
}
?>
Now my another task is how to change topic section when users change their language preference. I embed an iframe in the topic section, but I don't know how to change it when language switch.