SitePoint Sponsor

User Tag List

Results 1 to 11 of 11

Thread: Bilingual site

  1. #1
    SitePoint Evangelist Rodney H.'s Avatar
    Join Date
    Sep 2005
    Location
    Chicago, IL
    Posts
    479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Bilingual site

    Hi, everyone.

    Do you have any experience building a bilingual web site?

    I would like to create one using English and Spanish, but I am not sure how to begin.

    Can any of you suggest some methodologies that have worked for you, or show me some articles as reference material for this project?

    Much obliged for your help.

    Thanks.

  2. #2
    SitePoint Wizard chris_fuel's Avatar
    Join Date
    May 2006
    Location
    Ventura, CA
    Posts
    2,750
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    That depends on what level you're looking to go bilingual at. Everything in your site? Only certain areas?

  3. #3
    monitormensch oerdec's Avatar
    Join Date
    Sep 2004
    Location
    Hamburg
    Posts
    706
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Im currently working on a German/English website where Im using a template system. That means I have always one php script file and two templates. Aside from that I store all error messages in a database. For example. A user wants to log in and enters a wrong password. Then the script
    will pass $lg['login_message_wrong_password'] to the template. My table has basically three fields: key, de and en. Key is login_message_wrong_password de the German message and en the English.

    If you just have a few messages you could also include a language file with all variables.

  4. #4
    SitePoint Wizard silver trophy Jelena's Avatar
    Join Date
    Feb 2005
    Location
    Universum, 3rd Corner
    Posts
    3,000
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    -- Jelena --

  5. #5
    SitePoint Member
    Join Date
    Jan 2006
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have an english/spanish site that identifies the user's primary language based on their accept-language header from their browser. If it is one of the variations of spanish, I give them spanish and anything else defaults to english.

    I use a templated system and pull the different text sections from "language files." These are also template files but are set up to provide the different languages that can be included from the other templates.

  6. #6
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    One of the best ways to get multilingual traffic is to get a domain with ccTLD.
    If not, you'd rather place the content in the folder, such as website.com/en, website.com/de, etc.

    The benefit of having a country specific domain is that you will get links from local directories and the site will have more chances of getting ranked in local searches.

  7. #7
    SitePoint Evangelist Rodney H.'s Avatar
    Join Date
    Sep 2005
    Location
    Chicago, IL
    Posts
    479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by trshtkr
    I have an english/spanish site that identifies the user's primary language based on their accept-language header from their browser. If it is one of the variations of spanish, I give them spanish and anything else defaults to english.

    I use a templated system and pull the different text sections from "language files." These are also template files but are set up to provide the different languages that can be included from the other templates.

    That sounds like what we should do. Can you provide any basic code samples as to how you do things, and/or one of your language templates?

    THanks.

  8. #8
    SitePoint Evangelist Rodney H.'s Avatar
    Join Date
    Sep 2005
    Location
    Chicago, IL
    Posts
    479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh, and thanks everybody, for your input.

    I appreciate it.

  9. #9
    SitePoint Member
    Join Date
    Apr 2006
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The main issue with such approach is how search engines view your site.
    Can Spanish people find your site from their local search engine?
    Do you get enough traffic from the Spanish search engines?

  10. #10
    SitePoint Member
    Join Date
    Jan 2006
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Browsers send over an Accept-Language header. You can custom-write your own library to read that. I use mod_perl and there are existing modules such as this one http://search.cpan.org/~gozer/Apache...4/Language.pod

    I then use the appropriate language based on the language (note than, when parsing the Accept-Language header, individuals can select multiple languages and give them a weight between 0 and 1...you need to make sure to select the one with the highest number). Here is an example of what my browser is putting out:
    Accept-Language: en-us;en;q=0.5

    The "q" represents the weighting and it only provides it once since if there are only 2 selections (en-us and en), and one of them is .5, the other must be .5 as well.

    A.N.Onym us right about the search engines though. So what I had done was allow overriding the language with a parameter in the url. Using rewrite rules, I enabled the following urls:
    foo.com/en/page1.html
    foo.com/es/page1.html
    etc

    This allowed me to select language from url, if present...otherwise, I would fall back on the accept-language header...and if a user wanted to switch languages, they'd just select the links with the overriding parameter.

  11. #11
    SitePoint Evangelist Rodney H.'s Avatar
    Join Date
    Sep 2005
    Location
    Chicago, IL
    Posts
    479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, very cool. I think I am starting to understand.

    Thanks, all.


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
  •