PDA

View Full Version : Adding Languages with Flag Icons


MooseReiver
09-15-2008, 08:17 PM
I wanted to add small flag icons in the navigation section to switch between English and German. The template files are named like "about_DE_template.html". (I chose to use uppercase language codes.)

-Add flag icons to the language directory.

-In the navigation section of the templates, add:
<a href="?lang=DE" title="Deutsch"><img src="language/Deutsch.gif" border=0> </a>
<a href="?lang=EN" title="English"><img src="language/English.gif" border=0> </a>

-Since I used uppercase language codes, I had to edit line 181 to remove the strtolower() function:
$default_language_abr = $PP_supp_lang[$cfgrow['langfile']][0];

Now, by clicking on a flag, the language preference is quickly changed.

See it at: http://www.randalcarr.com/rc/photoblog/index.php

Robbo
09-17-2008, 11:04 AM
Hi MooseReiver, not trying to be pedantic but Durchsuchen or Archiv Durchsuchen is better than brausen as it has nothing to do with browsing.

MooseReiver
09-17-2008, 02:02 PM
Thank you! It's been 25 years since I studied Deutsch. <blushes>

jerome28
10-04-2008, 10:18 AM
WHERE PUT THE IMAGE ( DEUTSCH.GIF and english.gif) ?

austriaka
10-07-2008, 08:29 AM
simplest way to show flags is to replace the wording by the image link in the appropriate language file:
$lang_alt_lang_english ="<img src=\"templates/en.gif\" border=\"0\" alt=\"English\" />";