News:

Wondering if this will always be free?  See why free is better.

Main Menu

Language Drop Down

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

Previous topic - Next topic

bran8464

I got this working on my site:

Freedpm Island]http://www.noodiebooties.com/69/]Freedpm Island

Running the default theme on 1.1.5 I find I get a load of text above the header after a while:

$txt['no_click'] = 'Sorry , but the right click is disable for guest'; $txt['arrange_nrcg'] = 'Disable the right click for guest'; $txt['colorize_color'] = 'Color'; $txt['pmi_title'] = 'You have %s message(s) unread!'; $txt['pmi_view_all'] = '[View All]';$txt['changeposterid'] = 'Change Poster/Starter'; $txt['changeposteridno'] = 'Poster ID'; $txt['aeiou'] = 'AEIOU'; $txt['aeiou_title'] = 'Auto Email Inactive Ordinary Users'; $txt['aeiou_enable'] = 'Enable Automatic Emailing Of Inactive Users'; $txt['aeiou_email_desc1'] = 'Text-Only (No html, no bbcode)'; $txt

That's just a small sample. Any ideas? BTW it changes the language  in server settings.

Nathaniel

@bran8464,
Thats a simple error which means there has been an issue with the package manager.

You need to open up your '/themes/default/languages/modifications.{language}.php' files and then move the closing php tag " ?> " from before that php code, to after it.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

bran8464

Do you mean this code:

<?php
// Version: 1.1; Modifications
?>

If so I tried as you said and it didn't work. Exactly how should it look?

BTW when the original error occurs it changes in server settings English Utf8 to English. Changing back to Utf8 corrects it until the next time. We have forum members from all over the world so it would be good to get this right.

Nathaniel

Am I right in saying that the code from that file looks something like this:


<?php
// Version: 1.1; Modifications
?>
$txt['no_click'] = 'Sorry , but the right click is disable for guest';
$txt['arrange_nrcg'] = 'Disable the right click for guest';
$txt['colorize_color'] = 'Color';
$txt['pmi_title'] = 'You have %s message(s) unread!';
$txt['pmi_view_all'] = '[View All]';
$txt['changeposterid'] = 'Change Poster/Starter';
$txt['changeposteridno'] = 'Poster ID';
$txt['aeiou'] = 'AEIOU';
$txt['aeiou_title'] = 'Auto Email Inactive Ordinary Users';
$txt['aeiou_enable'] = 'Enable Automatic Emailing Of Inactive Users';
$txt['aeiou_email_desc1'] = 'Text-Only (No html, no bbcode)';


It should really be something like this:

<?php
// Version: 1.1; Modifications

$txt['no_click'] = 'Sorry , but the right click is disable for guest';
$txt['arrange_nrcg'] = 'Disable the right click for guest';
$txt['colorize_color'] = 'Color';
$txt['pmi_title'] = 'You have %s message(s) unread!';
$txt['pmi_view_all'] = '[View All]';
$txt['changeposterid'] = 'Change Poster/Starter';
$txt['changeposteridno'] = 'Poster ID';
$txt['aeiou'] = 'AEIOU';
$txt['aeiou_title'] = 'Auto Email Inactive Ordinary Users';
$txt['aeiou_enable'] = 'Enable Automatic Emailing Of Inactive Users';
$txt['aeiou_email_desc1'] = 'Text-Only (No html, no bbcode)';
?>


Its an issue caused by your package manager, not installing the mod correctly. I think that there is no real reason why it happends, it just happens sometimes.

If you can't find that issue in the 'Modifications.{language}.php' files then try the other language files that the mod edits such as 'Index.{language}.php' files.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

bran8464

#204
The modificationslanguage.php files only contain this code:

<?php
// Version: 1.1; Modifications
?>

nothing else, at least the one's I checked. And the 'Index.{language}.php' files seem ok with ?> at the end.

bran8464


FreeSporePrints

Dear SleePy,
from when i've upgraded SMF 1.1.4 to SMF 2.0 the laguage drop mod does not work anymore(and neither the entire forum).

It gives the error:

Quote
Fatal error: Call to undefined function languageDrop() in /home/freesee1/public_html/raclando/smf/Sources/Load.php(1857)

you can see with your eyes here: www.raclando.com

Thanks,
F.

Smoky "Rider" Blue

#207
did you add:

// Generate the Language Drop Down..
function template_language_select()
{
global $context, $txt, $scripturl;

// Do the Function...
languageDrop();

// Hopefully We always have something to show for ourselves.
if (!empty ($context['languages']))
{
echo '
<form action="" method="post" class="smalltext" style="float: right;">
<select id="language_select" name="language" onchange="this.form.submit()" class="smalltext">';
foreach ($context['languages'] as $language)
echo '
<option value="', $language['filename'], '"', isset($context['user']['language']) && $context['user']['language'] == $language['filename'] ? ' selected="selected"' : '', '>', $language['name'], '</option>';
echo '
</select><input type="hidden" name="changelang" value="1" />&nbsp;<noscript><input type="submit" value="', $txt['quick_mod_go'], '" /></noscript></form>';
}
// No languages we can find!
elseif (empty ($context['languages']))
echo 'LanguageDrop: ' . $txt[398];
// If this occurs we are in trouble.
else
echo 'LanguageDrop: ' . $txt[106];
}


right after:


if (empty($button_strip))
return '<td>&nbsp;</td>';

echo '
<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'last' : 'first' , '">&nbsp;</td>
<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_back">', implode(' &nbsp;|&nbsp; ', $button_strip) , '</td>
<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'first' : 'last' , '">&nbsp;</td>';
}


**Take the time to remember friendships and family.. Sometimes it's all we have, and missed very much**

lobo777

I love this mod but just changed my theme - and I do typically know a little about adding to the index.template.php file, and have also read your early suggestions on adding the code where you would like it, but honestly I have no clue where to insert it!  Would you be opposed to me PMing you on here and sending you my link and location of where I want it, as well as my index.template file?  If you want you can just copy and paste and explain where I would put it once you've seen my forum.  It would be MUCH appreciated, as my website is travel and backpacking related (multi-languages are handy!).  No worries if not!

SleePy

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

lobo777

#210
I'm using Anecdota theme (by crip)... I would like to have it down in the bar with the buttons (but over to the right side of the page where there aren't any menu buttons).

Thanks for any help you can give!

SleePy

Alright.
If you open the Themes index.template.php

Find:
  </div>

  <div id="mainarea">


Add Before:
', template_language_select(), '

Make sure you add the other edit to the index.template.php as well. This one works on all themes :)
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

lobo777

Thanks Sleepy!!  Much appreciated... awesome mod!

yosssi

Hello i install it and works ok in the default theme but i used other theme and dont look nother what you need for works in other theme?

SleePy

If you know a little on editing code it should be easy to do this.
You basically just need to have it output the code where you want it.
You do this by adding the required function to index.template.php. Then where you want it to display, you add a call to this function you added :)
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Mraza

#215
hello guys and thanks for this great language choices.. i am developing a forum with 1.7.7 version of smf and i just installed the Greek spanish and french languages , well i have the language drop down mod and i can choose the language which i want. the one thing i can't figure out i have installed an invite mod but when i will choose other language then english it will not be visible any more in the menu, only i can see the picture before to it but the word INVITE will gone. and the other thing is it possible that if i will select other language then english so the posts on my board will also convert to the other language?
thanks for any help
Signature:
Old Software Engineers Never Dies, They Just Log Out...
! ! ! ! ! 5 Best Movies Thread ! ! ! ! !

SleePy

This will not convert posts. This is simply the same language chooser that is in your profile. But at quick access for you and guests :)

If the words are disappearing after changing a language, then the mod you installed doesn't have language strings for that language. You need to ask the author of that mod what language strings you need to copy and to what language files. Most likely they are using the Modifications language file. So if you open the Modifications.english.php file and copy all the text strings into the Modifications.xxx.php (where xxx is the other languages) and add them into the other files, then this would fix it.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Cheese Head

Thanks for the Mod very useful, installed fine on SMF 2.0 RC1 using Default Theme.

Only question, why is the drop down menu soo tiny in the upper right corner of forum pages, hard to find and hard to read the drop down language names.

Thanks again!

SleePy

I did not add any css to style the size of the text. The location was the best one I could think of. You can choose your own and use css to change it up even more.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Cheese Head

Thanks SleePy, sadly I don't know where in the default css file to do that.

Advertisement: