SitePoint Sponsor

User Tag List

Results 1 to 17 of 17
  1. #1
    SitePoint Enthusiast CreativeConcepts's Avatar
    Join Date
    Sep 2012
    Location
    Amsterdam
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question How do I implement multiple languages for one website?

    Hello,

    hopefully this post is in the right place, I am a bit new to forums.
    I am also new to webdesign so I have a noob question, like the title says.

    How do I implement multiple languages for one website?

    I would like to have a nice looking menu somewhere on my website where you can choose the language of your preference.
    Before posting, I searched for other threads on this but I didn't find andthing, like this question unfortunately.

    Thank you,
    Milan

  2. #2
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Kent
    Posts
    1,921
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Make duplicate pages in the other languages, save them in folders with an abbreviated code for the language - eg /en/index.htm for English, /fr/index.htm for French, etc, and link to the alternative language versions at top right or top left of each page. - it seems to be common to have these links as flags or same abbreviation as used for the folders . It's not exactly a difficult problem to solve, is it?

  3. #3
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,177
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Off Topic:

    These days, using Chrome, if I come across a site that's not in my native language, I'm asked if I want it translated—meaning I can read it in my own language in an instant. Probably not ideal, but signs of a brave new world, indeed.

  4. #4
    Mazel tov! bronze trophy kohoutek's Avatar
    Join Date
    Aug 2004
    Location
    Hamburg, Germany
    Posts
    4,248
    Mentioned
    30 Post(s)
    Tagged
    0 Thread(s)
    Are you currently learning a programming language? If you don't intend to, then I recommend that you use a CMS that has good multi-lingual support, either directly built-in (can't think of one) or via an add-on or plugin. Most of the popular CMSes have a few third-party solutions.
    Maleika E. A. | Rockatee | Twitter | Dribbble



  5. #5
    SitePoint Enthusiast CreativeConcepts's Avatar
    Join Date
    Sep 2012
    Location
    Amsterdam
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    All three answers were super helpful. For now I will do more research about the brave future and cms of course. But first attend to more pressing matters with the website like writing more content.

    Thank you!

  6. #6
    SitePoint Zealot
    Join Date
    Oct 2012
    Posts
    137
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    The logical way would be to have a website divided into equal sized chunks - one chunk for each language. The navigation structure and the formatting (the CSS) could be the same for all the chunks. You would just need to create translated pages named in the proper language (for search engine optimization). At least you do not need to worry about dulicate content

    Do remember to change the language meta-tag in the head of each page.

  7. #7
    SitePoint Enthusiast CreativeConcepts's Avatar
    Join Date
    Sep 2012
    Location
    Amsterdam
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Greg Baka View Post
    The logical way would be to have a website divided into equal sized chunks - one chunk for each language. The navigation structure and the formatting (the CSS) could be the same for all the chunks. You would just need to create translated pages named in the proper language (for search engine optimization). At least you do not need to worry about dulicate content

    Do remember to change the language meta-tag in the head of each page.
    I understand everything you advised and I think that is a very practical way of doing it.
    Unfortunately at this point I lack the skills needed, so I will learn more about the details of it all first.
    No fun for me if it isn't perfect lol oh and thank you!

  8. #8
    SitePoint Wizard bronze trophy conradical's Avatar
    Join Date
    Jan 2005
    Location
    Atlanta
    Posts
    2,354
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Instead of typing it all up again, here are my thoughts and experience from the first time I did a multilingual site. Not perfect, but it was the first and a great learning experience.

    http://www.sitepoint.com/forums/show...=1#post5206014

  9. #9
    SitePoint Enthusiast CreativeConcepts's Avatar
    Join Date
    Sep 2012
    Location
    Amsterdam
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you, that's very helpful!

  10. #10
    SitePoint Enthusiast zakelijk's Avatar
    Join Date
    Oct 2012
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Since the rising of Google chrome, i don't think it's still necessary to make a translation of your page

  11. #11
    Life is not a malfunction gold trophysilver trophybronze trophy
    TechnoBear's Avatar
    Join Date
    Jun 2011
    Location
    Argyll, Scotland
    Posts
    6,177
    Mentioned
    264 Post(s)
    Tagged
    5 Thread(s)
    Quote Originally Posted by zakelijk View Post
    Since the rising of Google chrome, i don't think it's still necessary to make a translation of your page
    You are joking, aren't you? Chrome has something under 30% of the browser market share, so you're willing to discount 70% of your visitors?

  12. #12
    SitePoint Member
    Join Date
    Dec 2011
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    very interesting to read abut such a frequently queried question...personally I would tackle this slightly different from a sheer Google point of view...it is important that websites are easily understood by Google, it does not like dynamic content for one... so to do it properly i would create a variety of HTML pages (variant of the main homepage) and store this on a sub-directory so: www.xyz.com/de. Then submit a sitemap in webmaster tools suggesting this change...
    Last edited by TechnoBear; Nov 6, 2012 at 11:21. Reason: Example URL delinked
    Ensure you use a professional translation service for all your
    needs. | PC specialist

  13. #13
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,656
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)

  14. #14
    SitePoint Enthusiast zakelijk's Avatar
    Join Date
    Oct 2012
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by TechnoBear View Post
    You are joking, aren't you? Chrome has something under 30% of the browser market share, so you're willing to discount 70% of your visitors?
    Chrome is growing, and i'm sure other browser will get the same function

  15. #15
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    24,177
    Mentioned
    454 Post(s)
    Tagged
    8 Thread(s)
    Quote Originally Posted by zakelijk View Post
    Chrome is growing, and i'm sure other browser will get the same function
    Not necessarily, as I assume it's a Google trick that perhaps will be kept for Chrome alone.

  16. #16
    SitePoint Member
    Join Date
    Sep 2012
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The easiest way is to install wordpress and add "The WordPress Multilingual Plugin" available at wpml[dot]org

  17. #17
    SitePoint Evangelist Tapan's Avatar
    Join Date
    May 2005
    Location
    India
    Posts
    563
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    You can use language files also.

    Create english.php, hindi.php and spanish.php
    And define words and phrases in that file and use them in your php scripts accordingly.
    You just have to load the language file that the user has selected.

    Example:

    In english.php:
    Code:
    $language["hi"] = "hi";
    $language["howareyou"] = "how are you ?";
    In hindi.php:
    Code:
    $language["hi"] = "namaste";
    $language["howareyou"] = "kaise hain aap ?";
    In spanish.php:
    Code:
    $language["hi"] = "hola";
    $language["howareyou"] = "como es usta ?";
    When a user comes to your site the default lang. file in english.php

    Your php file should have something like that in it:

    Code:
    <?php
    if (empty($_SESSION["langfile"])) { $_SESSION["langfile"] = "english.php"; }
    require_once ($_SESSION["langfile"]);
    echo $language["hi"];
    ?>
    So they see: hi
    But if they select Hindi or Spanish then you load content from the respective language file and if its Hindi then it will show: namaste and if its spanish it will show hola

    Links can be like this:

    HTML Code:
    <a href="language.php?l=english">En</a>
    <a href="language.php?l=hindi">Hi</a>
    <a href="language.php?l=spanish">Sp</a>
    language.php
    PHP Code:
    if (!empty($_GET["l"]))
    {
    $_SESSION["langfile"] = $_GET["l"] . ".php"
    header ("location: index.php"); exit();
    }
    ?> 
    This is a very basic example, you can make it more complex and more secure.

    Hope this helps.

    Thanks.


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
  •