how to change language on website

Discussion in 'Web Design and Development' started by Vitalyk, Aug 31, 2012.

  1. macrumors newbie

    Joined:
    Aug 30, 2012
    Messages:
    3
    #1
    Please help to find out how to make changing languages correctly on my website: http://www.krasota-gor.ru so that three languages may be on one page (index.html). At this time I use only that method (3 different pages for each language - index, nindex, bahindex.html). Tell please what script can I take and if possible where can I find an example of that.:confused:
     
  2. macrumors 6502a

    Hexiii

    Joined:
    Jun 30, 2011
    Messages:
    972
    Location:
    Prague, Czech Republic
    #2
    What's wrong with this? I think this is the better solution.

    Or even better, you can make a new folder and make index.html and /bah/index.html.
     
  3. macrumors member

    Joined:
    Aug 9, 2008
    Messages:
    39
    #3
    I agree with Hexiii in that I don't see anything wrong with how you do it now...but I, too, would put each language in a separate subdirectory rather than scattering various versions around your main directory.

    If you load each language on one page, you're going to force your visitors to download languages they don't need, plus the JavaScript files to hide/show the proper language...you're looking at adding a lot of overhead to the file. Some CMS systems handle multiple languages very well, by the way; something else to think about.

    If you're really set on doing it your way, I'd set it up so each language has a subdirectory, translate only the text on the page, use server-side includes to include each translation in your main page, then write some JavaScript to hide/display the proper sections.
     
  4. macrumors member

    Joined:
    Apr 20, 2011
    Messages:
    73
    #4
    Hexiii's method is pretty decent and will work fine on a site of this size.

    If you are a feeling more adventurous you could try storing your content in a number of database tables (one for each language) and loading the appropriate text in depending on the page of the site.
     
  5. macrumors 6502a

    Hexiii

    Joined:
    Jun 30, 2011
    Messages:
    972
    Location:
    Prague, Czech Republic
    #5
    And the JS is not really good choice if you want link somebody to your site in his language.
     
  6. macrumors newbie

    Joined:
    Aug 30, 2012
    Messages:
    3
    #6
    Thank you. But it seems to me that there is another problem. I cannot see all of my pages in search engines, only can see the main page. For example, if I want to see in search engine my page "Elbrus" in Russian language, or my page "Alpine flowers" in Indonesian language, I cannot. Tell please, what reasons can be? Can it be because of my inappropriate JavaScript or there is another reason?
     
  7. macrumors 65816

    Joined:
    Apr 17, 2012
    Messages:
    1,008
    Location:
    Destin, FL
    #7
    +1 for -pete-

    Load language into database files. Pull content via php based on the base language, if base language not found use default language to fill content.

    just us
     
  8. macrumors newbie

    Joined:
    Aug 30, 2012
    Messages:
    3
    #8
    Thank all of you for these suggestions, but now I don't understand the present situation: why my website is not detected by searching engines, even though I registered my website in many search engines?
     
  9. macrumors newbie

    Joined:
    Jan 11, 2013
    Messages:
    2
    #9
    I think Hexii's method is nice one.. I am agreeing with him .. If you are adventurous than I suggest you to make different tables in Database. One for each language..
     

Share This Page