Results 1 to 8 of 8

Thread: change image or flash based on Language

  1. #1
    Join Date
    May 2006
    Posts
    266
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default change image or flash based on Language

    Hi i am using Google.com Language Translation to let people that don't read English to read my site in there Language. Is there a way i can make it when they view my page in chines they get the chines image instead of the English text.

    Thanks
    The web in one word.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Not when using automatic translation, no. You have to translate the images manually, and you'd then have to set up manually-translated versions of the pages, too.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    I can see this being easily done with PHP:

    Write this to your URL once you convert to chinese:
    yourPage.php?lang=chinese

    Use this php script on every page you need to replacing the <img> tag:
    PHP Code:
    <?php
    $lang 
    $_GET["lang"];
    if (
    $lang == "chinese") {
        echo 
    "<img src=\"chinese replacement\">";
        }
    else {
        echo 
    "<img src=\"original image\">";
        }
    ?>
    - Mike

  4. #4
    Join Date
    May 2006
    Posts
    266
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    any way to do this in html
    The web in one word.

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    No. You can use Apache's content negotiation to serve up appropriate versions, but again you'd have to manually translate all your pages.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I have a theory. Might not work. And somewhat complex.

    Impliment javascript on the page to get the current URI. When google translates a page, it has, as a get variable (like page.php?lang=EN, etc) the language code. You could dynamically change the source of the image based on this, to, for example, EN.jpg

    However, I see problems that could happen from it as well.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Yeah, starting with:
    Impliment javascript on the page to get the current URI.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    May 2006
    Posts
    266
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    kool i will have to think about all this it may be easyer to translate each page one by one and do it myself. like let google translate the page but if some one is from china they see the chinese images. they would have to click on there flag or something.
    The web in one word.

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
  •