Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Thema gestartet von: [Unknown] in Oktober 03, 2004, 11:40:21 NACHMITTAGS

Titel: Showing languages for easy guest/user selection.
Beitrag von: [Unknown] in Oktober 03, 2004, 11:40:21 NACHMITTAGS
Most, especially smaller, forums are not multilingual.  After all, the prupose of a forum is to dicuss something, so if people are talking in Thai and you speak Hindi... it really doesn't contribute to the conversation :P.

However, there are often times when mutlilingual forums are desirable.  Consider a forum for a game, to be released in many different countries.  Consider one for a movie, or more importantly... an international project such as this one.  Consider a forum for an international foundation or movement.  Obviously, this is why SMF has such a feature, and why it's even used.

However, it's easy to forget about guests.  If I speak German (only), and I find myself looking at an English forum... I may not realize it can switch to German.  I may not realize that there's a board (or several) that contain posts of my langauge.... and I may just leave.  Obviously, this is something to be avoided - but how?

Well, the first trick is that SMF allows anyone (guests, users, spiders, even dancing monkeys) to change their language at any time.  The most noticeable way is in your profile, but that is only for registered members.  The other way works only for as long as your browser is open, but can be used by guests - it is the "query string" method.

To use this method, you just put language=languagename in the URL.  For example, you could use any of the following:

http://www.simplemachines.org/community/index.php?language=english
http://www.simplemachines.org/community/index.php?board=72.0;language=german
http://www.simplemachines.org/community/index.php?action=search;langauge=spanish

But, how can you utilize this?  Well, there are a few ways, but one might be to use flags in the top right corner.  You could then make the flag select the language it's tied to.  The problem is, how do you know where you are?

One way would be to use javascript:

<a href="javascript:window.location += (window.location.indexOf('?') != -1 ? ';' : '?') + 'language=german';void(0);">...</a>

This would send them to the German version of the page they are on. (well, it wouldn't translate posts, or anything...) It's only downside is that if they are on a page that changes when you go to it, or requires input (such as a post preview or search results) it might give an error.

-[Unknown]
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: Anguz in Oktober 04, 2004, 02:11:44 VORMITTAG
Nice one, didn't know you could do that.

One idea would be to point the URL for each language to it's area in the forum. So if someone changes to German, it'd load the German board. Eg: German (http://www.simplemachines.org/community/index.php?board=13.0;language=german)
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: HT in Mai 17, 2005, 12:52:53 NACHMITTAGS
How can a guest chsnge language?
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: Owdy in Mai 17, 2005, 12:57:27 NACHMITTAGS
Did you eaven read first post? http://www.simplemachines.org/community/index.php?language=german
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: guppy in Mai 17, 2005, 11:33:12 NACHMITTAGS
If I have a navigation menu with quick links to some useful posts, how can I code the links so that guests using a different language won't end up back in English?

e.g. if I point to this post using the "standard" code:

<a href="http://www.simplemachines.org/community/index.php?topic=17595.0">....</a>

I'll end up in English since it's a static link
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: [Unknown] in Mai 17, 2005, 11:56:45 NACHMITTAGS
No, once the language has changed the change will "stick" until you change it again.  Try it.

-[Unknown]
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: Serenity in Mai 31, 2005, 05:57:23 VORMITTAG
i use the same thing! only one problem when using SSI on my other pages it goes to my standard language english!

is there a way to fix that?
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: edi67 in Mai 31, 2005, 09:18:59 VORMITTAG
thanx unknown i use your method and clicking in nation flags forum begin in selected language

http://www.forumzoneru.25.com1.ru/index.php

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg67.echo.cx%2Fimg67%2F1188%2Fus5ob.jpg&hash=70982f87040e1da04be9d369770f034ab365287c)
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: Serenity in Juni 02, 2005, 03:13:45 NACHMITTAGS
Zitat von: [Unknown] in Mai 17, 2005, 11:56:45 NACHMITTAGS
No, once the language has changed the change will "stick" until you change it again.  Try it.

-[Unknown]
yes but that means they need to enter the forum first before your index page!  :-\ or not?
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: Ivan Minic in Juni 27, 2005, 06:19:07 VORMITTAG
Zitat<a href="javascript:window.location += (window.location.indexOf('?') != -1 ? ';' : '?') + 'language=german';void(0);">...</a>
No matter how I put this in my forum template i always get template parse error... I moded many things and they work like charm, i edited some stuff myself and also had no problems but this...
I did put links to 2 main languages but, those are fixed links that link to index page and not to specific page that was visited.. as i see ti this is the only way to do this, and this can't be inserted anywhere.... so.. any help would be very welcome
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: [Unknown] in Juni 27, 2005, 12:43:42 NACHMITTAGS
As the parse error page shows, you have to use a \ in front of the 's.

-[Unknown]
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: Ivan Minic in Juni 27, 2005, 03:56:34 NACHMITTAGS
<a href="javascript:window.location += (window.location.indexOf(\'?\') != -1 ? \';\' : \'?\') + \'language=serbian\';void(0);">...</a>
<a href="javascript:window.location += (window.location.indexOf(\'?\') != -1 ? \';\' : \'?\') + \'language=english\';void(0);">...</a>

If i put it like this, it doesn't work, there is no parse error, but doesn't work... I'm probably doing something wrong..
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: [Unknown] in Juni 27, 2005, 04:00:37 NACHMITTAGS
Try:

<a href="javascript:window.location += (window.location.href.indexOf(\'?\') != -1 ? \';\' : \'?\') + \'language=serbian\';void(0);">...</a>
<a href="javascript:window.location += (window.location.href.indexOf(\'?\') != -1 ? \';\' : \'?\') + \'language=english\';void(0);">...</a>


-[Unknown]
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: Ivan Minic in Juni 27, 2005, 04:14:29 NACHMITTAGS
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.burek.co.yu%2Fsmf%2FSmileys%2Fdefault%2Feusa_clap.gif&hash=2f9aa820f8fbf334db7889b8af7f86a209fe25a1)
Bravo! Ave [Unknown] !
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: JustJa in August 15, 2005, 03:35:11 VORMITTAG
 Ok... But... where am I supposed to insert that code?
In wich php file?

:D
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: [Unknown] in August 15, 2005, 05:11:41 VORMITTAG
Anywhere you like.  I'd suggest index.template.php.

-[Unknown]
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: JustJa in August 16, 2005, 05:15:25 NACHMITTAGS
Parse error: parse error, unexpected '<' in XXX/index.php on line 46
What am I doing wrong?
tryed everything...
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: smacktalk in August 19, 2005, 02:16:34 NACHMITTAGS
Zitat von: Serenity in Mai 31, 2005, 05:57:23 VORMITTAG
i use the same thing! only one problem when using SSI on my other pages it goes to my standard language english!

is there a way to fix that?

We are having the same issue.
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: JustJa in August 20, 2005, 03:41:59 NACHMITTAGS
Hi...
I still have problems with this... I wrote about it on the help desk. Is there anyone willing to help?
Thanks :)
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: [Unknown] in August 26, 2005, 01:14:35 VORMITTAG
Brasileira, can you post three lines above and below where you're trying to insert it, please?

Zitat von: smacktalk in August 19, 2005, 02:16:34 NACHMITTAGS
Zitat von: Serenity in Mai 31, 2005, 05:57:23 VORMITTAG
i use the same thing! only one problem when using SSI on my other pages it goes to my standard language english!

is there a way to fix that?

We are having the same issue.

Are you using subdomains?

-[Unknown]
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: smacktalk in August 26, 2005, 02:42:01 NACHMITTAGS
Zitat von: [Unknown] in August 26, 2005, 01:14:35 VORMITTAG
Are you using subdomains?

-[Unknown]

no. I think we have ours working now. The problem we have is when you click on the link to the topic, it goes to the forum but under the  default language.
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: JustJa in August 26, 2005, 07:06:29 NACHMITTAGS
Hi Unknown  :D
I am sorry, I got it fixed already
Thanks ;D
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: Raves in Oktober 09, 2005, 10:13:39 VORMITTAG
Zitat von: edi67 in Mai 31, 2005, 09:18:59 VORMITTAG
thanx unknown i use your method and clicking in nation flags forum begin in selected language

http://www.forumzoneru.25.com1.ru/index.php

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg67.echo.cx%2Fimg67%2F1188%2Fus5ob.jpg&hash=70982f87040e1da04be9d369770f034ab365287c)

Hi!

Can someone give me the code, in what files to put it and tell where to put images? I am trying to make it look like this above but just can't make it.. idiot, I know..

Please help!
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: Elmacik in November 22, 2005, 02:13:24 VORMITTAG
So, isnt there a way to automatically get th language list?
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: crisje in Januar 19, 2007, 11:29:59 VORMITTAG
I also need this solution ... so that I can place three languages or more ... like romanian dutch and english...

someone please I`m new at this !
But great forum btw  ;) much better than phbbb !

Cheers 2 all !
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: KGIII in März 31, 2007, 02:19:19 VORMITTAG
Hi,

I am going through the old unsolved support topics. Have you tried the language dropdown modification available in the mods downloads section?
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: rospone in November 03, 2007, 06:55:47 NACHMITTAGS
I have installed italian language pack (utf8) together with default english language and I'm trying to use both languages independently

So, after reading this topic, I just  put a link directly to the two languages language like follows:
http://mysitename/community/index.php?language=italian-utf8
http://mysitename/community/index.php?language=english

..and It worked great; the problem is that when you try to register with a new username, after received the activation link you are being redirected to the english page.
Is there a way to change the instructions in the automatic activation mail so to be redirected to the italian language page and not to the english one and viceversa?
Should I change a script command some way? and anybody knows if  there is a way to do it?
Thank you
Titel: Re: Showing languages for easy guest/user selection.
Beitrag von: Deaks in Dezember 09, 2007, 06:36:49 NACHMITTAGS
hi rospone, can i ask did you get this sorted?