Language Drop Down

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

Previous topic - Next topic

Mike_R

I PM'd you, hope you have all the info you need and thanks!  Not sure if I said it is the DilberMC theme I am trying to use this on.


Quote from: SleePy on April 22, 2008, 04:04:19 PM
Can you pm me your ftp and site details? I an make the change.



SleePy

Hows that :)
I think I found the best location as well?
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Mike_R

#182
That looks awsome!!!  Thanks sooo much! I really appreciate it and our Quebec friends will love it! 

Does this also change the language of the posts as well?  I noticed it changes the menus etc.. is it supposed to change the language of the posts? If it doesn't- no worries, just asking :)

I know I said it already... but thanks again!!!  :)

SleePy

No it doesn't.

This is just a simple version of the language chooser in your profile or on the admin panel (for default language).
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Mike_R

Looks good!! Much Appreciated :)

Nathaniel

Any chance of an upgrade so that this Mod supports SMF 2 beta 3.1? I figure that it would work anyway if I install it manually because the changes weren't huge from Beta 3.0 to 3.1, but it would be nice if the package did it itself.  ;)

Also I was wondering, I have used this Mod before and I noticed that the languages in the dropdown menu are always in English because it takes the smf language names which are in English, maybe this Mod could be expanded to allow for languages to be put in the list in their own languages? So Francais instead of French , Espanol instead of Spanish and etc. This would be useful for non-english forums and for forums which support other languages because if their non-english users cannot see their languages name in their own language then they may not recognize it.

I managed to achieve this with a nasty hack to the languageDrop() function which changed the language that the names are in, but it would be nice if this was a part of the Mod somehow.

2 possible methods of implementation:
1. Include a large list of language name translations and then allow admin to pick whether they want to use English names or language specific names.
2. Allow admin to customize the names of each language which is being listed.

Just a suggestion, it may not be feasible but it could work. :)
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.

FragaCampos

That is something i think would be much appreciated by everyone.
Can you share that hack of yours? :D

SleePy

Quote from: LHVWB on May 27, 2008, 03:42:41 AM
Any chance of an upgrade so that this Mod supports SMF 2 beta 3.1? I figure that it would work anyway if I install it manually because the changes weren't huge from Beta 3.0 to 3.1, but it would be nice if the package did it itself.  ;)

Also I was wondering, I have used this Mod before and I noticed that the languages in the dropdown menu are always in English because it takes the smf language names which are in English, maybe this Mod could be expanded to allow for languages to be put in the list in their own languages? So Francais instead of French , Espanol instead of Spanish and etc. This would be useful for non-english forums and for forums which support other languages because if their non-english users cannot see their languages name in their own language then they may not recognize it.

I managed to achieve this with a nasty hack to the languageDrop() function which changed the language that the names are in, but it would be nice if this was a part of the Mod somehow.

2 possible methods of implementation:
1. Include a large list of language name translations and then allow admin to pick whether they want to use English names or language specific names.
2. Allow admin to customize the names of each language which is being listed.

Just a suggestion, it may not be feasible but it could work. :)

I am not planning on upgrading my mods until 2.0 Beta 4 is released. You can simply use version emulate to have it install.
The reason they are in english is because how the rest of the SMF handles languages is the same. I am sure it wouldn't be to hard to do a $txt['language' . $language_name] = 'Language';
But that again would require all those text strings to be in each language file.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Nathaniel

#188
Quote from: FragaCampos on May 27, 2008, 08:25:15 AM
That is something i think would be much appreciated by everyone.
Can you share that hack of yours? :D

Here are some better instructions then the nasty hack which I was using, please note that I have only tried this with SMF 2 Beta 3.1.

1. Install the Mod normally.
2. Find the template_language_select() function in the index.template.php file for each of the templates that you want to change, add this code to the begginning of the function.

loadlanguage('Modifications');

Find the line in that function which displays the actual option for each language.
<option value="', $language['filename'], '"', isset($context['user']['language']) && $context['user']['language'] == $language['filename'] ? ' selected="selected"' : '', '>', $txt['languagename_'.$language['name']], '</option>';

Replace the code near the end of the line which says "$language['name']" with "isset($txt['languagename_'.$language['name']]) ? $txt['languagename_'.$language['name']] : $language['name']".

3. Edit your language files for each template: Find the "Modifications.(language).php" files for each language and then add the language name strings that you want, to the beginning of each of these files in the following format.

$txt['languagename_language in english'] = 'languagename';

For example
$txt['languagename_French'] = 'Francais';
$txt['languagename_Spanish'] = 'Espanol';
$txt['languagename_English'] = 'English';

Please note that if you do not define these names in every Modifications.(language).php then because of the edit to the language function, it will show the english name anyway.
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.

edi67

why after install mod i see only this in my index.page:

LanguageDrop: but nothing else not menu to scroll

look:
http://ediboard.altervista.org/index.php
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

SleePy

I don't see it at all.
Did you uninstall it?

Do you have more than 1 language pack installed?
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

edi67

Quote from: SleePy on June 18, 2008, 03:42:12 PM
I don't see it at all.
Did you uninstall it?

Do you have more than 1 language pack installed?

i have 2 language english and italian, yes installed
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

SleePy

Do you get an error in the error log?

Do you have caching enabled?

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

edi67

Level 1 of caching

such errors i have:

Apply Filter: Only show the errors with the same message
8: unserialize() [<a href='function.unserialize'>function.unserialize</a>]: Error at offset 5 of 174 bytes
Apply Filter: Only show the errors from this file
File: /membri/ediboard/Sources/Load.php
Riga: 2614
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

SleePy

Hmm, well its saying the array of languages is empty..

Does it go away after some time? It should be going away after a bit when the cache gets old.
If its not, then its still not finding the languages :|
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

edi67

i get this error immediately after installation of mod
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

SleePy

I wonder if its because of the bad cache it has :|

Uninstall it and try this one. Its a early push of 1.4.4 I was working on. But it uses proper SMF caching system and I changed how things work. Hopefully this one gets all the bugs out of the 2.0 version.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

edi67

GREATT i changed something but now work perfectly thx

take a look
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

m107

hi
now i want to install a mode and after i click on "install" it says me that want to edit "./Themes/default/index.template.php" but i want to install this mode on another theme in this path "./Themes/bluBlur/index.template.php" .

how can i solve this problem?

thanks in advance

m107

?!!!
why this forum is son inactive?!
how can i solve my problem with installing mods on non-default forum?

sorry for any inconvenience

Advertisement: