PDA

View Full Version : other menu for language change


jeronimo
6th of January 2007 (Sat), 17:18
At the moment I see only the dropdown menu for changing the language. I would like to have it text driven.
E.g;

Eng | Nl | Sf | Esp

So this would be perfect for me to add it to my header.

Can anyone help me with this?

At the moment I only need it to change 2 languages (English en Dutch)

But offourse it would be nice to make it so that it finds out all the languases by itself (like the dropdown does now).

Lot off thanx for all who helpes.

jeronimo
23rd of January 2007 (Tue), 10:24
Well found some way's to do this by meaning of javascript. But then it does not "remind" the language and display's everything in the default language.

So any help would be apriciated

Thanx

jeronimo
17th of February 2007 (Sat), 04:28
I managed to change it. It is pre programmed, after changing some setting in one of the files it works fine for me.

MMCM
2nd of May 2007 (Wed), 18:08
It would be fine, if you could document what you have changed, so others can do the same without major research ;-)

jeronimo
3rd of May 2007 (Thu), 00:56
I will come back on this later today (this evening local time)

MMCM
3rd of May 2007 (Thu), 07:54
That's my solution, with the language selector moved to the header:
http://photography-on-the.net/forum/showthread.php?p=3144470

jeronimo
3rd of May 2007 (Thu), 16:24
Let me start to remind to make a backup of all the files that I name underneat for editing

What did I do

First you have to open basecode/SCRIPT_language.php

There you browse to line 160
There you see the folowing code

if ($is_editor == "1") {
mysql_data_seek($get_languages,0);


if (mysql_num_rows($get_languages) <= 2) {
print " | ";
while ($row = mysql_fetch_array($get_languages)) {
$lang_variable = $row["ee_language_var"];
$accesskey = strtoupper($lang_variable{0});
print "<a href=\"{$scriptname}?{$link}&amp;ee_lang={$lang_variable}\" style=\"color: #ffff00;\">" . $row["ee_language_menuname"] . "</a> | ";
//ee_option ($lang_variable,$ee_lang,"" . $row["ee_language_menuname"]);
}

This code you completely change with the code underneath

if ($is_editor == "0") {
mysql_data_seek($get_languages,0);


if (mysql_num_rows($get_languages) <= 2) {
print "| ";
while ($row = mysql_fetch_array($get_languages)) {
$lang_variable = $row["ee_language_var"];
$accesskey = strtoupper($lang_variable{0});
print "<a href=\"{$scriptname}?{$link}&amp;ee_lang={$lang_variable}\" class=\"ee_css_hyperlink\">" . $row["ee_language_menuname"] . "</a> | ";
//ee_option ($lang_variable,$ee_lang,"" . $row["ee_language_menuname"]);
}

Also you have to change the code on line 210
if ($is_editor == "0") {

to

if ($is_editor == "1") {

This code make's the menu apear like
| language | language2 | language3| etc |
I see no way (yet) to make it appear like [ L1 | L3 | L2 ]
This is because the script sums languages with the | behind.

All we have to do now is finnishing the menu in the header (or other place)
This we do by putting the next code on the place where you want the menu to apear
<div class="ee_css_paragraph_bold"><?php
print $languagemenu_html;
?></div>


All you have to do now is to go to the admin section. There you go to setting > languages.
In the upper table you change the name of the language in the colum "in menu".
You can make it what ever you want. I prefer two letter code (in my case Nl and En ).

Upload all the files to you server and it should work.
Workint example on my site
www.landmarks.nl

Tini72
29th of January 2008 (Tue), 17:37
Thanks a lot for the efforts about adapting the language menu. Does this solution works only for plain text or for images as well? I would prefer displaying flags instead of the language name. Is there a way to do this?

jeronimo
30th of January 2008 (Wed), 04:31
Well it must be possible for images offcourse. I would not prefer to do this, because some browsers do not display them an other way as you intended it to.

Before starting, backup all the files that you will modifie

But the coding is rather simple, i think;
Put a flag image in your language direction. Name them the same in all the directorys. In the example below the image is called flag.gif

print "<a href=\"{$scriptname}?{$link}&amp;ee_lang={$lang_variable}\" class=\"ee_css_hyperlink\">" . $row["ee_language_menuname"] . "</a> | "; must be changed to

print "<a href=\"{$scriptname}?{$link}&amp;ee_lang={$lang_variable}\" class=\"ee_css_hyperlink\"><img src=\"./languages/\" . $ee_lang . \"/flag.gif\" width=\"5\" height=\"5\"></a> ";

I dit not check if this works. Good luck, and let us know.