Multilanguage Webseite - Include Text

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bettina@coaster.ch

    Multilanguage Webseite - Include Text

    I want to include a block of text in my homepage, which will be in the
    corresponding language depending of the chosen language. I would like
    to use something like the files.propertie s that I have seen in Java. Is
    there something similar in PHP?
    Any idea will be welcome!
    Thanks.
    Bettina

    Bierdeckel, beer coaster, posavasos, bolachas de chopp, birdekel, sottobicchieri, alatetek, pivní tacky, podlozky, bierviltjes


  • Mike Willbanks

    #2
    Re: Multilanguage Webseite - Include Text

    There is multi-language extensions in PEAR but there is also a pretty
    easy way to do it yourself...

    Create all text into an array that uses a certain language. Create a
    file for each language to keep the variable space down etc...

    Mike[color=blue]
    > I want to include a block of text in my homepage, which will be in the
    > corresponding language depending of the chosen language. I would like
    > to use something like the files.propertie s that I have seen in Java. Is
    > there something similar in PHP?
    > Any idea will be welcome!
    > Thanks.
    > Bettina
    >
    > www.coaster.ch
    >[/color]

    Comment

    • bettina@coaster.ch

      #3
      Re: Multilanguage Webseite - Include Text

      I don't understand exactly what do you mean. In the array I would have
      the texts in the different languages? Do you mean with files, php files
      or inc files. What would I store in these files?

      Comment

      • Mike Willbanks

        #4
        Re: Multilanguage Webseite - Include Text

        bettina@coaster .ch wrote:[color=blue]
        > I don't understand exactly what do you mean. In the array I would have
        > the texts in the different languages? Do you mean with files, php files
        > or inc files. What would I store in these files?[/color]

        Here is a plain example....

        create files with whatever extension you like...

        en-us.php for example:

        $lang['name_you_want_ to_reference_by '] = 'This is what I want to
        reference by!';


        then you can just put all of the languages in variables like that and
        only include the file you need for your languages.

        Mike

        Comment

        • petermichaux@yahoo.com

          #5
          Re: Multilanguage Webseite - Include Text

          What about using a big list of defines instead of an array. That is how
          it is done in Mambo and a bunch of other php programs. What are the
          preformance tradeoffs?

          Thanks,
          Peter

          Comment

          Working...