News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Language Drop Down

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

Previous topic - Next topic

SleePy

Sorry, $txt[106] would be in the language files :P
I am giving a guess but try index.<language>.php

As for changing the name there isn't. It is generated off of index.<language>.php and given a capital and any junk removed.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

dxyy

Does anyone know if this mod is xhtml valid?

After I installed it I got some errors from here - http://validator.w3.org/ :(

SleePy

It should be. What errors are you getting? Can you link to one?
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 15, 2007, 11:13:47 PM
It should be. What errors are you getting? Can you link to one?
Well I uninstalled it after noticing the errors, I will reinstall it and let you know. ;)

dxyy

Ok after installing I get 8 errors:

Quote
document type does not allow element "form" here; missing one of "th", "td" start-tag.

...post" class="smalltext" style="float: right;">



The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").


end tag for element "td" which is not open.

            </td>



The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.

If this error occurred in a script section of your document, you should probably read this FAQ entry.


# Line 131, Column 9: XML Parsing Error: Opening and ending tag mismatch: tr line 125 and td.

            </td>


# Error Line 140, Column 8: XML Parsing Error: Opening and ending tag mismatch: table line 124 and tr.

         </tr>


# Error Line 141, Column 10: XML Parsing Error: Opening and ending tag mismatch: div line 80 and table.

      </table>


# Error Line 142, Column 7: XML Parsing Error: Opening and ending tag mismatch: body line 54 and div.

   </div>


# Error Line 824, Column 7: XML Parsing Error: Opening and ending tag mismatch: html line 2 and body.

</body></html>


# Error Line 824, Column 7: XML Parsing Error: Extra content at the end of the document.

</body></html>


Before installing the language drop down my forum was XHTML compliant.
Hope that helps, but if there is something else you need from me, please let me know. ;)

SleePy

Is that your site you have linked in your profile?
It is showing valid html when I view it and when I use w3c on it. The coding looks correct as well :|
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 16, 2007, 12:39:56 PM
Is that your site you have linked in your profile?
It is showing valid html when I view it and when I use w3c on it. The coding looks correct as well :|
Yes, well those errors were only there when I originally installed the mod without making any manual changes. After I made some changes based on your recommendations to get the language bar on the same line with the search window everything was fine.

I think if you take the mod as it is and install it on a clean version of 1.1.4 you might be able to reproduce the XHTML errors I posted above though.

SleePy

I don't know what could be wrong. My edits leave the coding in place and just adds another column. All tags are closed or self-closed.. :|
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

dxyy

Hmm, I guess forget about it. Haha, in my experience 90% of the time when there is a problem, the problem has been me. ::) Well, that's with software and not other things. :P

falguni1

it is showing two times english in drop down.

also it doesnot translate the language in post.
how to translate language in post.

dxyy

It's not meant to translate the actual content of the posts! It's just meant to change the forum's language, so for example "home help profile... etc." :P

mariolone

Hello,

I would like to translate the name of each selectable language from the dropdown list of this mod.

E.g. I would like to change "French" with "Français", "Italian" with "Italiano", "Spanish" with "Espanol" etc.: where I have to change in SMF? Which files?

Thank you in advance

SleePy

Quote from: mariolone on December 23, 2007, 09:46:29 AM
Hello,

I would like to translate the name of each selectable language from the dropdown list of this mod.

E.g. I would like to change "French" with "Français", "Italian" with "Italiano", "Spanish" with "Espanol" etc.: where I have to change in SMF? Which files?

Thank you in advance

If your server supports it just go to your language files and find all instances of *.<language>.php and replace it with *.<new language>.php. * is a wildcard remember ;)
Not all servers support non english file names so this may not work for all languages, which is why we don't do this.

Quote from: falguni1 on December 23, 2007, 02:40:15 AM
it is showing two times english in drop down.

also it doesnot translate the language in post.
how to translate language in post.
This mod does not translate posts, it only changes the forum language. Actually the same as to going to your profile -> account related settings and changing your forum language.

If its showing english twice then You are using English and english-utf8. I swear I had this fixed though.
You can fix this right now by opening Load.php
Finding:
sort($context['languages']);
Replace:
sort(array_unique($context['languages']));

I will update it in my sources but not going to update the packages on the mod site for a while.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

edi67

Installed on SMF 1.1.1 and everything work perfectly ;) thx

crazyzone.ws
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

lonrot

Guys in softmc blue, all the edits in the index are not compatible.
I cannot get together how to make the box appear like it does in the default theme.

SleePy

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


SleePy

Before the end of the file 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];
}


Find:
    echo '
        </td></tr></table>
    </div><br />';


Replace:
    echo template_language_select(), '
        </td></tr></table>
    </div><br />';


Also,
You may want to do this, but it isn't needed.
Find:
            echo '
                                ', $txt['totalTimeLogged1'], '<br />';


Replace:
            echo '
                                ', $txt['totalTimeLogged1'];


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

lonrot

Absolutely outstanding! it works perfectly fine!
Thanks for the solution!!

FreeSporePrints

I've installed LanguageDrop v.1.4 on SMF 1.1.4, with a custom them (basically it's the Stylized Theme), installation went okay but cannot find any drop menu. Have i to activate something?!?

Thanks,
F.

Advertisement: