#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2002
    Location
    San Francisco, CA
    Posts
    272
    Rep Power
    13

    Multi-language design


    I have a huge website I want to translate into other languages. I use PHP for the entire site. Is it better to have all the other languages as a subdomain

    language.mysite.com

    Or to just make it a dir

    www.mysite.com/lang/

    What do you suggest? Any advantages of one over the other?
  2. #2
  3. Senior Polecat
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Jersey (the original version)
    Posts
    210
    Rep Power
    12
    depends on the way the site is written. A sub domain means that if you have used site root relative links ( ie /page.php ) you don't need to change them. A sub folder is easier to maintain and doesn't cost any more to setup.
    Quidquid latine dictum sit, altum viditur.

    http://www.XSet.co.uk
  4. #3
  5. sardonyx quinx
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    156
    Rep Power
    11
    There are many ways to set up your site into different languages.

    You can use a single file that contains different variables and values for the language that you want to translate.

    But I think your previous suggestion will work together with the reply of icy_polecat.

    but I have a question, are you going to use a database that will hold the information for your multi-language or are you going to put them in a separate php files or folders?
  6. #4
  7. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    Apache has the ability to deliver different files to the browser based on the browser's locale. So index.html.en would go to english users, and index.html.fr would go to french users. Not sure if this would work with php, but it might be work looking into.
  8. #5
  9. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2002
    Location
    San Francisco, CA
    Posts
    272
    Rep Power
    13
    Thanks for all the replys. At the moment the different text for languages wouldn't be stored in a database but called from different files or folders.
  10. #6
  11. sardonyx quinx
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    156
    Rep Power
    11
    will it be ok guys if enzo's going to do that kind of strategy? i think it would be very stressful for him. ^_^ just asking coz im planning to do the same thing too. but now for now. ^^
  12. #7
  13. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    Well, my recommendation would be to keep your translated text together in one form (db or files), your layouts together in one form (db or files), and your other, dynamic data in the database. You can then either combine the translations and layouts when you publish them, or let php combine them dynamically for each request.
  14. #8
  15. sardonyx quinx
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    156
    Rep Power
    11
    that was a good idea bricker42. i can see what you mean about your post.
  16. #9
  17. Retired
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2002
    Location
    Finland
    Posts
    9,143
    Rep Power
    2493
    Hi,

    I go this suggestion from one of the guys on the forums. I had never thopught of it before, but check out this thread for more.

    It essentially expands on what bricker42 said. I am currently implementing and it seems faily straight forward enough.

    I am using files (ini) for translatable files and then extracting the variables dependant on where the user is on the site.

    Please excuse the typos / Friday -> 12:25 -> Beer -> Gabriel Crowe (check this out if you like trance -> I don't but I have been listening to this for hours and hours....

    regards

    Jamie

    Cheers,
    Jamie

    >_ skiFFie ? | Twitter

    __________________

    Let the might of your compassion arise to bring a quick end
    to the flowing stream of the blood and tears .....
    Please hear my anguished words of truth.

    __________________
  18. #10
  19. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    jabba, that's a really cool idea.

    As a side note, if you're working in Java, use ResourceBundles for this. That's what they're designed for. The functionality is very similar the .ini idea.

IMN logo majestic logo threadwatch logo seochat tools logo