MyBB Community Forums
How to switch Logo image based on the chosen language - Printable Version

+- MyBB Community Forums (
+-- Forum: Extensions (
+--- Forum: Translations (
+---- Forum: Translation Discussion and Development (
+---- Thread: How to switch Logo image based on the chosen language (/thread-151491.html)

How to switch Logo image based on the chosen language - megapoopsus - 2014-02-27

Our forum has to support 2 languages English and Russian. We want the header and the logo image switch depending on the user's language preferences.
How can this be done? Maybe it is possbile to embed some kind of language switchable variable into the header template to make image file name switch?
Or maybe I can embed different logo images into the language packs?
Any help where to look for would be appreciated.

Answering my own question:

1. Put the desired header images for each language in the corresponding language dir, e.g. images/english/my_logo.gif and images/russian/my_logo.gif
2. Goto Admin CP->Templates&Styles->Templates->Default templates->Header Templates->header
3. Among the first lines find
<div class="logo"><a href="{$mybb->settings['bburl']}/index.php"><img src="{$theme['logo']}" alt="{$mybb->settings['bbname']}" title="{$mybb->settings['bbname']}" /></a></div>
and change it to
<div class="logo"><a href="{$mybb->settings['bburl']}/index.php"><img src="{$theme['imglangdir']}/my_logo.gif" alt="{$mybb->settings['bbname']}" title="{$mybb->settings['bbname']}" /></a></div>
4. Click Save and see the result.

One drawback is your logo image setting in the Admin CP is no longer effective. Maybe someone can slightly improve the code.