create web page in multiple language

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • vishal

    create web page in multiple language

    hello

    vishal here

    i want to craete site which shows the contents as per the langauge i
    choose. so can anyone give me idea that how this is possible. i know
    tha problem but i don't have any idea about soultion. so pls reply me
    if u know

    thxs in advance........ ...

  • JaNE

    #2
    Re: create web page in multiple language

    vishal <vishal_panjabi @yahoo.co.in> wrote:
    [color=blue]
    > i want to craete site which shows the contents as per the langauge i
    > choose. so can anyone give me idea that how this is possible. i know
    > tha problem but i don't have any idea about soultion. so pls reply me
    > if u know
    >[/color]

    I have this solotion for my site:
    files:
    lang.hr.php
    lang.en.php
    lang.de.php
    with langugae variables in files:
    (hr)
    $welcome = "Dobrodosli ";
    (en)
    $welcome = "Welcome";
    (de)
    $welcome = "Willcomen" ;
    and so on...

    Then, I give my visitors cookie $_COOKIE['lang'], as my site is primary
    for croatian vistors, I just look if visitor have choosen other language
    on his visit before (that was *my-clumsy-english*...sorr y):

    //"gui" part
    if(isset($_COOK IE['lang'])) {
    $lang = "$_COOKIE[lang]";
    } else {
    $lang = "hr";
    }
    include("lang/lang.$lang.php" );

    //site content
    mysql_query("SE LECT * FROM table WHERE (somthing='$wan ted_content' AND
    lang = '$lang')";

    //in case of some old not yet converted static data:
    include("data/$lang/$linked_file");

    .... that wasn't "copy-paste" method, so some "typing errors" are
    possible...

    --
    Jan ko?
    fotografija = zapisano svjetlom | fotozine = foto-e-zin

    --

    Comment

    • Dave Patton

      #3
      Re: create web page in multiple language

      "vishal" <vishal_panjabi @yahoo.co.in> wrote in
      news:1110100118 .085418.202270@ o13g2000cwo.goo glegroups.com:
      [color=blue]
      > hello
      >
      > vishal here
      >
      > i want to craete site which shows the contents as per the langauge i
      > choose. so can anyone give me idea that how this is possible. i know
      > tha problem but i don't have any idea about soultion.[/color]

      One method, that is suitable in some circumstances
      (but not all) is to use gettext


      Another approach would be to use the PEAR
      Translation2 class:
      <http://pear.php.net/manual/en/packag...ranslation2.ph
      p>

      --
      Dave Patton
      Canadian Coordinator, Degree Confluence Project

      My website: http://members.shaw.ca/davepatton/

      Comment

      • Chung Leong

        #4
        Re: create web page in multiple language

        "vishal" <vishal_panjabi @yahoo.co.in> wrote in message
        news:1110100118 .085418.202270@ o13g2000cwo.goo glegroups.com.. .[color=blue]
        > hello
        >
        > vishal here
        >
        > i want to craete site which shows the contents as per the langauge i
        > choose. so can anyone give me idea that how this is possible. i know
        > tha problem but i don't have any idea about soultion. so pls reply me
        > if u know
        >
        > thxs in advance........ ...[/color]

        That depends on what the languages are. The solution for handling English,
        French, and German is quite different from handling English, Chinese, and
        Arabic.


        Comment

        Working...