News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Language Drop Down

Started by Matthew K., January 02, 2007, 11:41:04 PM

Previous topic - Next topic

L'AltroWeb

I have test another solution IMHO more efficiently  ;)
For babylon theme:
Find:
</div>
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
<div style="margin-top: 7px;">

Replace With:
</div>
', template_language_select(), '
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
<div style="margin-top: 7px;">

Now Find:
echo '
<form action="" method="post" class="smalltext" style="float: right;">
<select id="language_select" name="language" onchange="this.form.submit()" class="smalltext">';
And Replace With:
echo '
<form action="" method="post" class="smalltext" style="float: right;">
<label for="language_select" class="smalltext">Select Language:</label>
<select id="language_select" name="language" onchange="this.form.submit()" class="smalltext">';

See final result (tested with firefox, opera and IExplorer - guest and also registered user - valid W3C)
http://darkwolf.altervista.org/forum/index.php  8)

dxyy

#101
Quote from: mhf on November 17, 2007, 01:15:27 PM
Can anyone help me add Language Drop Down to the Oxygen theme?
I put the code in and it really messed up the theme - didn't look much like Oxygen anymore - even though the drop-down box was there - so that worked !
I would like the drop-down box to be on the same line as the search box...
Thanks.
I would also like the language drop down box to be on the same line as the search box.

Is there an easy way to do this?

Thanks in advance. :)

EDIT: Oh, and after adding some text such as "Select Language:" the drop down box goes on a new line aligned to the right in IE. It looks fine in Firefox though. ;)

SleePy

We do have a handy doc here on how to install mods on other themes.
http://docs.simplemachines.org/index.php?topic=402.0

If you still need help after reading and trying that I do this :)
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

dxyy

Hmm, well I am on the default theme.

I had no problem installing the mod, it's just that I don't like the way it looked, because it added an extra 'line' to my forum. I don't know much anything about PHP, so I asked for help to get the language drop down box on the same line as the search box.

The other thing I wanted to do was add some text such as "Select language:" I managed to do that after reading this thread, but in IE it adds another line to my forum, and aesthetically it bothers me. :P

So basically there are two things I don't know how to do. :(

SleePy

It hopefully shouldn't add another line. I attempted to not make it do this. What browser size are you using (Different than actual monitor size)?

Can you show me a screenshot or a live forum with this?
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

dxyy

Quote from: SleePy on December 08, 2007, 10:36:45 PM
It hopefully shouldn't add another line. I attempted to not make it do this. What browser size are you using (Different than actual monitor size)?

Can you show me a screenshot or a live forum with this?
Here's a link to my test forum: http://www.daxueyingyu.com/finalforumtest/index.php

EDIT: Oh, and how do I determine my browser size?

SleePy

If you have firefox it has a web dev toolbar addon that tells you.
But for the most part your browser size is only slightly smaller than your monitor size due to the scrollbar, status bar, etc.

Did you remove the news line?
Does it look right on my test forum?
http://sleepycode.com/Forum/?
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

dxyy

SleePy, on your test forum it looks perfect! Well, I would also like to have the text: "Select language," but the positioning is great.

Can you show me how to implement those changes on my forum?

Thanks. :)

SleePy

Try this.

Open Load.php
Find:
<form action="', $scripturl , !empty($_REQUEST['action']) ? '?action=' . $_REQUEST['action'] . (!empty($_REQUEST['sa']) ? ';sa=' . $_REQUEST['sa'] : '' ) : '', '" method="post" class="smalltext" style="float: right;">

Add before
', $txt['select_language'], '</td><td class="titlebg2">

Open Modifications.english.php and before the end add this
$txt['select_anguage'] = 'Select Language:';
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

dxyy

Hmm, I can't find the code you specified in the load.php file.

Sorry, I forgot to mention that I am using SMF 1.1.3. ;)
Don't know if that makes a difference or not.

SleePy

Sorry, that was 2.0, I haven't fixed it the way I had to fix the 1.1 files yet.

It is in index.template.php.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

dxyy

#111
Gosh, I hate to be such a pain, but when I switch from English to simplified Chinese, the text gets larger for some strange reason. :(

Switching back to English reverts the text to it's regular size though.

EDIT: Sorry that only happens in IE.

FragaCampos

Hi there, and thanks for the mod ;)
Where can i edit the $txt[106] string?
I have only two languages in my forum, english and portuguese, and i would like to know how to change the string "portuguese" to "português".

Thanks.

SleePy

Does changing the language via your profile change the size?
My mod shouldn't touch anything like that so it would be either some styling or computer font setup.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

dxyy

Quote from: SleePy on December 10, 2007, 05:14:50 PM
Does changing the language via your profile change the size?
My mod shouldn't touch anything like that so it would be either some styling or computer font setup.
Yes, if I change it via the profile it still changes the font size.

Anyway, you are correct, this has nothing to do with your mod as after I uninstalled it I still had the problem. I guess another mod is causing the problem, possibly the felblog mod as it is the only one I remember installing on my test forum recently. :(

Ok, well thanks for your help, I'm going to add your mod to my real forum now. Haha, this is a really helpful mod given the nature of my forum. Thank you! :)

dxyy

Quote from: SleePy on December 10, 2007, 01:06:38 AM
Try this.

Open Load.php
Find:
<form action="', $scripturl , !empty($_REQUEST['action']) ? '?action=' . $_REQUEST['action'] . (!empty($_REQUEST['sa']) ? ';sa=' . $_REQUEST['sa'] : '' ) : '', '" method="post" class="smalltext" style="float: right;">

Add before
', $txt['select_language'], '</td><td class="titlebg2">

Open Modifications.english.php and before the end add this
$txt['select_[color=blue][b]l[/b][/color]anguage'] = 'Select Language:';
Ok, I hope this is the last thing I need to bug you about - hopefully you're not tired of me as yet. ::)

Anyway, I tried to implement those changes as you suggested. There was a slight problem since in my index.template.php file, the code is not
<form action="', $scripturl , !empty($_REQUEST['action']) ? '?action=' . $_REQUEST['action'] . (!empty($_REQUEST['sa']) ? ';sa=' . $_REQUEST['sa'] : '' ) : '', '" method="post" class="smalltext" style="float: right;">
but rather it was
<form action="" method="post" class="smalltext" style="float: right;">

So now the drop down is on the same line with the search box, but for some reason the text "Select language:" is on a line above that, which once again adds an additional like to my forum.

SleePy

#116
Quote from: hugodiaz on December 11, 2007, 01:28:57 PM
Yes, if I change it via the profile it still changes the font size.

Anyway, you are correct, this has nothing to do with your mod as after I uninstalled it I still had the problem. I guess another mod is causing the problem, possibly the felblog mod as it is the only one I remember installing on my test forum recently. :(

Ok, well thanks for your help, I'm going to add your mod to my real forum now. Haha, this is a really helpful mod given the nature of my forum. Thank you! :)

It may be just how things are done. If I remember right those are using specail symbols like 枆摖. So they may be blown up a little to be better seen.

Edit,
Quote from: hugodiaz on December 11, 2007, 01:44:03 PM
Ok, I hope this is the last thing I need to bug you about - hopefully you're not tired of me as yet. ::)

Anyway, I tried to implement those changes as you suggested. There was a slight problem since in my index.template.php file, the code is not
<form action="', $scripturl , !empty($_REQUEST['action']) ? '?action=' . $_REQUEST['action'] . (!empty($_REQUEST['sa']) ? ';sa=' . $_REQUEST['sa'] : '' ) : '', '" method="post" class="smalltext" style="float: right;">
but rather it was
<form action="" method="post" class="smalltext" style="float: right;">

So now the drop down is on the same line with the search box, but for some reason the text "Select language:" is on a line above that, which once again adds an additional like to my forum.

Sorry about the language string error I will correct that.
<form action="" method="post" class="smalltext" style="float: right;">

That is correct and would do just fine :)

Did you get rid of the <td> before that code you inserted? It should of been there.

My mode does this:
<td class="titlebg2" nowrap="nowrap" valign="top">';
template_language_select();
echo '
</td>


So adding that code should of just ended a table row and added another for the text.
Does your code look like this?

Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

dxyy

Quote from: SleePy on December 11, 2007, 02:19:24 PM
It may be just how things are done. If I remember right those are using specail symbols like 枆摖. So they may be blown up a little to be better seen.
Well, I'm confident that something I changed - either through a mod or otherwise is responsible, because on my real forum there is no change in font size when members change their language.

Anyway, do you have any idea why the text: "Select language:" is being displayed on the additional line above the language and search windows?

I believe I followed your instructions as best as I could, but it didn't quite do the trick. The language drop down window's location is fine, but the text "Select language" is not. :(

SleePy

Did you look at my edit? I forgot to post that in :P
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

FragaCampos

#119
Quote from: FragaCampos on December 10, 2007, 03:54:19 PM
Hi there, and thanks for the mod ;)
Where can i edit the $txt[106] string?
I have only two languages in my forum, english and portuguese, and i would like to know how to change the string "portuguese" to "português".

Thanks.

Herr... bump? :P

Edit: I realized that $txt[106] as nothing to do with that... still, is it possible to change the names of languages?

Advertisement: