SitePoint Sponsor

User Tag List

Results 1 to 16 of 16
  1. #1
    SitePoint Evangelist NokX's Avatar
    Join Date
    Feb 2003
    Location
    Knoxville, TN
    Posts
    501
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Setting up my site to handle multiple languages

    i love how Facebook handles multiple languages, but i'm not sure how they pull it off.

    what's the best technique for handling this?

    my initial guess is:

    • user picks their language
    • that preference is stored with their info in the database
    • when they view a page, that content is pulled from the database depending on what they're viewing and what language they're viewing it in

    i'm just not sure of the best technique for writing my pages and displaying the correct language.

    any help would be appreciated.

  2. #2
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Well many websites choose to use a cookie on the user’s computer to determine a setting such as the language preference they have. It is probably better then storing it in a database in case a user accidently selects the wrong language. At least they can empty their cookies and reset to the default language.

  3. #3
    SitePoint Evangelist NokX's Avatar
    Join Date
    Feb 2003
    Location
    Knoxville, TN
    Posts
    501
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    aside from how to store a user's timezone, what's the best/recommended way to display pages in the chosen language?

  4. #4
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by NokX View Post
    aside from how to store a user's timezone, what's the best/recommended way to display pages in the chosen language?
    Well I would personally give them the option to choose their location, the last thing you want to do is force a user from a certain country to read a language they may know but would prefer to read english. Provide a menu or something so that they can select their preference. And then save that preference as a cookie, and have the website read the cookie and provide the chosen language.

  5. #5
    SitePoint Evangelist NokX's Avatar
    Join Date
    Feb 2003
    Location
    Knoxville, TN
    Posts
    501
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i am going to give them the option. i said i was going to do this in the first post. the user can pick "Pikey" for all i care.

    i'm wondering what the best way is to translate each page, menu, button, etc... to the various languages i'm going to support. store each translation for each button in a database?

    English : Click Here
    Spanish: Clic Aquí

    etc...

    (the spanish version might be wrong, just a guess)

  6. #6
    Follow: @AlexDawsonUK silver trophybronze trophy AlexDawson's Avatar
    Join Date
    Feb 2009
    Location
    England, UK
    Posts
    8,111
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Have the content for each language stored in a database and request it based on the language chosen from the cookie would be my initial thought.

  7. #7
    SitePoint Guru cyjetsu's Avatar
    Join Date
    May 2008
    Posts
    814
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Having a choice is much better. What happens when someone who speaks english visits china and goes in an internet cafe and views your site... will they be forced to read it in chinese just because they are in china?

    Unless you have an absolutley massive website like facebook, I do not think it is worth the resources of translating your entire site into multiple languages. But then I think everyone should just learn english anyway. And everyone should use the same currency. This may make me sound like a communist but I think it is just practical.

  8. #8
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,026
    Mentioned
    213 Post(s)
    Tagged
    1 Thread(s)
    Off Topic:

    Quote Originally Posted by NokX View Post
    English : Click Here
    Spanish: Clic Aquí

    etc...

    (the spanish version might be wrong, just a guess)
    clic aquí is allright. "haga clic aquí" even better

  9. #9
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,026
    Mentioned
    213 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by cyjetsu View Post
    Having a choice is much better. What happens when someone who speaks english visits china and goes in an internet cafe and views your site... will they be forced to read it in chinese just because they are in china?

    Unless you have an absolutley massive website like facebook, I do not think it is worth the resources of translating your entire site into multiple languages. But then I think everyone should just learn english anyway. And everyone should use the same currency. This may make me sound like a communist but I think it is just practical.
    Geotargetting has always been a problem. Yet, while creating a page in English makes it more open to general public because it is the language used in business at this time, it is not right to think that eveybody speak English and that they should.

  10. #10
    SitePoint Guru cyjetsu's Avatar
    Join Date
    May 2008
    Posts
    814
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know not everyone speaks english. I meant it would be a lot easier if everyone did. Not necessarily english, but the same language... english seems better though since it is the most common -sort of. Don't think Im some kind of weird overpatrioic ultra-nationalist britan, because I think my country sucks.

    Anyway as I mentioned people on holiday in china might want to use your site in english so you should have a choice. Or better yet -have a choice plus some kind of detection which gives you the option of the local language(highlighted in the option page for example"you are in china -view chinese site... or these other options").

  11. #11
    #titanic {float:none} silver trophy
    molona's Avatar
    Join Date
    Feb 2005
    Location
    from Madrid to Heaven
    Posts
    8,026
    Mentioned
    213 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by cyjetsu View Post
    I know not everyone speaks english. I meant it would be a lot easier if everyone did. Not necessarily english, but the same language... english seems better though since it is the most common -sort of. Don't think Im some kind of weird overpatrioic ultra-nationalist britan, because I think my country sucks.
    I am not saying that. I am simply stating that sure, it would be great if we all speak the same language, but the truth is that we don't, and that's why we need to adapt our sites to this reality. As you say, even if we try to guess the prefered language of the user, he will need to have the choice of which language to be used.

    A cookie is ok to remember the user's choice. The way to translate the page is another issue. It really depends on the market you are targetting on. If you expect a high traffic from all the countries you are targetting, then it would be better to have the full site translated by professionals, if it is going to be a occasional thing but you desperately need a professional image then, again, have the site translated by professionals... if that's not so crucial, use the internet translators instead.

  12. #12
    SitePoint Guru cyjetsu's Avatar
    Join Date
    May 2008
    Posts
    814
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think it can be worth translating, but it is a pretty big project. Unless you hire professional translators, then it won't work at all. You also have to research the target market, for example there might already be a better website out there in the target language.... so basically for each extra language you want, you have to do the amount of work of researching and building the website completley over -maybe that is an exagerration, but you get the point. I think for most websites it is better to spend your time optimizing your site for your default language, and only when it is really succesful there, can you expand to other countries. The time you spend translating every piece of content might be better spent creating more content for the same target.

  13. #13
    SitePoint Evangelist NokX's Avatar
    Join Date
    Feb 2003
    Location
    Knoxville, TN
    Posts
    501
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    here's what i was kinda getting at, and i have NO idea if this is how it's done...

    <button><?= SUBMIT_BUTTON_LANG ?></button>

    where SUBMIT_BUTTON_LANG would be set based upon what the user has chosen as their language. and then the database could be something like this...

    Code:
    LANG - - - EN - - - ES
    SUBMIT_BUTTON_LANG - - - Submit --- El Submito (whatever)
    WELCOME_MSG - - - Welcome! - - -  ¡Hola!

  14. #14
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Kent
    Posts
    1,921
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Basically you create a complete duplicate of every your site in each language (assuming you can translate into all of them), and on your index page you tell them to select the version they want via a standard menu. Spanish - English - German - etc

    So you'd have pages such as topicA, topicB, topicC, then spanish-topicA, spanish-topicb, spansih-topicC, then german-topicA, german-topicB, german-topicC, each with it's own menu in the chosen language (probably each in a folder named after the language).

    If you think it's some magic function, sorry, it probably lots of language experts translation things.

  15. #15
    SitePoint Evangelist NokX's Avatar
    Join Date
    Feb 2003
    Location
    Knoxville, TN
    Posts
    501
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no, i know it's not some "magic function". i never said that, either. in my example you'll notice i'm defining the label for a button using a constant. that constant is defined via the value in the database. that way you simply change what's said in certain areas. instead of creating 20 pages for 20 languages you simply refer to the value in the database.

    i'm pretty sure this is how facebook handles their multiple languages, but i'm trying to get a consensus from others on what they think. i've not been able to find any good sites out there that describe the best methods in setting up a multilingual website.

  16. #16
    SitePoint Member
    Join Date
    Apr 2009
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it may be worth visiting a few european sites. they frequently offer different language options. see some examples here

    whatever i cant post links sorry lol


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •