Advertisement:

Author Topic: Showing languages for easy guest/user selection.  (Read 47792 times)

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Showing languages for easy guest/user selection.
« on: October 03, 2004, 11:40:21 PM »
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]

Offline Anguz

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 3,430
  • Gender: Male
    • cristianlavaque.com
Re: Showing languages for easy guest/user selection.
« Reply #1 on: October 04, 2004, 02:11:44 AM »
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
Cristián Lávaque http://cristianlavaque.com

Offline HT

  • Newbie
  • *
  • Posts: 6
    • Balder & Embla
Re: Showing languages for easy guest/user selection.
« Reply #2 on: May 17, 2005, 12:52:53 PM »
How can a guest chsnge language?

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,590
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @@jaoler on Twitter
Re: Showing languages for easy guest/user selection.
« Reply #3 on: May 17, 2005, 12:57:27 PM »
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

Offline guppy

  • Full Member
  • ***
  • Posts: 400
  • I am guppy!
Re: Showing languages for easy guest/user selection.
« Reply #4 on: May 17, 2005, 11:33:12 PM »
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:

Code: [Select]
<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
Somewhere between belief and doubt lies faith ~ Jodi Picoult in Keeping Faith, 1999

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Showing languages for easy guest/user selection.
« Reply #5 on: May 17, 2005, 11:56:45 PM »
No, once the language has changed the change will "stick" until you change it again.  Try it.

-[Unknown]

Offline Serenity

  • Semi-Newbie
  • *
  • Posts: 72
  • Gender: Female
  • I'm insain whats your excuse?
    • Style is Dead
Re: Showing languages for easy guest/user selection.
« Reply #6 on: May 31, 2005, 05:57:23 AM »
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?

Offline edi67

  • SMF Hero
  • ******
  • Posts: 1,532
  • Gender: Male
  • Italian Supporter
    • CrazyZone
Re: Showing languages for easy guest/user selection.
« Reply #7 on: May 31, 2005, 09:18:59 AM »
thanx unknown i use your method and clicking in nation flags forum begin in selected language

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

CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Offline Serenity

  • Semi-Newbie
  • *
  • Posts: 72
  • Gender: Female
  • I'm insain whats your excuse?
    • Style is Dead
Re: Showing languages for easy guest/user selection.
« Reply #8 on: June 02, 2005, 03:13:45 PM »
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?

Offline Ivan Minic

  • Full Member
  • ***
  • Posts: 513
  • Gender: Male
  • Owner: www.Burek.com
    • Burek Forum
Re: Showing languages for easy guest/user selection.
« Reply #9 on: June 27, 2005, 06:19:07 AM »
Quote
<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

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Showing languages for easy guest/user selection.
« Reply #10 on: June 27, 2005, 12:43:42 PM »
As the parse error page shows, you have to use a \ in front of the 's.

-[Unknown]

Offline Ivan Minic

  • Full Member
  • ***
  • Posts: 513
  • Gender: Male
  • Owner: www.Burek.com
    • Burek Forum
Re: Showing languages for easy guest/user selection.
« Reply #11 on: June 27, 2005, 03:56:34 PM »
Code: [Select]
<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..

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Showing languages for easy guest/user selection.
« Reply #12 on: June 27, 2005, 04:00:37 PM »
Try:

Code: [Select]
<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]

Offline Ivan Minic

  • Full Member
  • ***
  • Posts: 513
  • Gender: Male
  • Owner: www.Burek.com
    • Burek Forum
Re: Showing languages for easy guest/user selection.
« Reply #13 on: June 27, 2005, 04:14:29 PM »

Bravo! Ave [Unknown] !

Offline JustJa

  • Jr. Member
  • **
  • Posts: 274
  • Gender: Female
Re: Showing languages for easy guest/user selection.
« Reply #14 on: August 15, 2005, 03:35:11 AM »
 Ok... But... where am I supposed to insert that code?
In wich php file?

 :D

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Showing languages for easy guest/user selection.
« Reply #15 on: August 15, 2005, 05:11:41 AM »
Anywhere you like.  I'd suggest index.template.php.

-[Unknown]

Offline JustJa

  • Jr. Member
  • **
  • Posts: 274
  • Gender: Female
Re: Showing languages for easy guest/user selection.
« Reply #16 on: August 16, 2005, 05:15:25 PM »
Parse error: parse error, unexpected '<' in XXX/index.php on line 46
What am I doing wrong?
tryed everything...

Offline smacktalk

  • Jr. Member
  • **
  • Posts: 222
  • Gender: Male
    • MarcoBarrera.com
Re: Showing languages for easy guest/user selection.
« Reply #17 on: August 19, 2005, 02:16:34 PM »
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.

Offline JustJa

  • Jr. Member
  • **
  • Posts: 274
  • Gender: Female
Re: Showing languages for easy guest/user selection.
« Reply #18 on: August 20, 2005, 03:41:59 PM »
Hi...
I still have problems with this... I wrote about it on the help desk. Is there anyone willing to help?
Thanks :)

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Showing languages for easy guest/user selection.
« Reply #19 on: August 26, 2005, 01:14:35 AM »
Brasileira, can you post three lines above and below where you're trying to insert it, please?

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]