Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Oct 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    multilingual site

    Hello, I'm a bit of a novice when it comes to html & css but I can build sites that validate.

    I am currently building a site in html & css with a bit of flash thrown in.

    My client requires the site to be in English, Italian & Chinese.

    I have built the site in English first and I have the text.doc for the Italian and Chinese content.

    I think I have to use index1 (eng), index2 (ita) and index3 (chin) and need to get it to automatically load reading the users geographical location.

    Does anyone have this code or can steer me in the right direction I would be extremely grateful!

    All the best

    Elliott

  • #2
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Do you know how to use PHP or are already implementing this or another server-side programming language?

  • #3
    New to the CF scene
    Join Date
    Oct 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm using .php for my contact form but I get my brother to help me with it.
    I did ask him about my problem but he doesn't know!

  • #4
    The Apostate Apostropartheid's Avatar
    Join Date
    Oct 2007
    Posts
    3,215
    Thanks
    16
    Thanked 265 Times in 263 Posts
    Basically what you'd do is one file called index.php, let's say.

    You'd pass a variable to it to signify the language in the URL, like index.php?lang=en, index.php?lang=it and index.php?lang=cn.

    At the top of your index.php file, you'd have this little snippet:
    PHP Code:
    <?php
      $lang 
    $_GET['lang'];
      if(
    $lang) {
    ?>
    ...
    <!doctype html>
    ...
    And whenever you have text, you'd do this:

    PHP Code:
    <p><?php if($lang == "en") { ?>I speak English!<?php } elseif($lang == "it") { ?>Io parlo italiano!<?php } else { ?>I really don't speak Chinese!<?php ?></p>
    If this is a simple site, that is. If it were larger, we'd have to use something more robust.

    You then end the file with this:
    PHP Code:
      } else {
        echo 
    "No language specified!";
      }
    ?> 
    Last edited by Apostropartheid; 10-19-2009 at 11:17 PM.

  • #5
    New to the CF scene
    Join Date
    Oct 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey

    Thanks for your help, I'll have a look at that with my bro.

    All the best

    Elliott

  • #6
    Regular Coder
    Join Date
    May 2008
    Location
    Michigan
    Posts
    216
    Thanks
    10
    Thanked 1 Time in 1 Post
    Interesting... I've always wanted to translate my website into German for some odd reason lol (I love the language).

  • #7
    Master Coder
    Join Date
    Apr 2003
    Location
    in my house
    Posts
    5,211
    Thanks
    39
    Thanked 201 Times in 197 Posts
    lol. I can do the scripting bit. Its the content I am falling down on since I am only bi-lingual - at a considerable stretch.
    bazz
    "The day you stop learning is the day you become obsolete"! - my late Dad.

    Why do some people say "I don't know for sure"? If they don't know for sure then, they don't know!
    Useful MySQL resource
    Useful MySQL link


  •  

    Tags for this Thread

    Posting Permissions

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