+ Reply to Thread
Results 1 to 1 of 1
Like Tree2Likes
  • 2 Post By espfutbol98

Thread: Help with translation system (php)

  1. #1
    espfutbol98's Avatar
    espfutbol98 is offline x10 Sophmore espfutbol98 is an unknown quantity at this point
    Join Date
    Apr 2009
    Location
    Zagreb... želim
    Posts
    200

    Question Help with translation system (php)

    I have been translating my site by echoing variables that are in included files depending on a cookie. Example:
    index.php
    PHP Code:
    <?php
    if (isset($_COOKIE['lang']) && $_COOKIE['lang'] == "hr") {
    include 
    "translation_hr.php";
    }
    else {
    include 
    "translation_en.php";
    }
    ?>
    <html>
    <head>
    </head>
    <body>
    <p><?php echo $t_welcome?></p>
    </body>
    </html>
    translation_hr.php
    PHP Code:
    <?php
    $t_welcome 
    "Dobrodošli";
    ?>
    translation_en.php
    PHP Code:
    <?php
    $t_welcome 
    "Welcome";
    ?>
    But I have noticed, like with phBB, they use arrays for this. Are they better? If so, how are they done?
    Last edited by espfutbol98; 09-02-2009 at 09:20 PM.
    dinomirt96 and karimirt47 like this.

+ Reply to Thread

Similar Threads

  1. Replies: 1
    Last Post: 03-15-2009, 10:52 PM
  2. [PHP] Variables in PHP
    By Bryon in forum Tutorials
    Replies: 15
    Last Post: 01-29-2009, 10:46 AM
  3. PHP and new accounts
    By idani in forum Free Hosting
    Replies: 1
    Last Post: 09-21-2008, 02:49 PM
  4. Problem with PHP support ticket system (Fantastico)
    By Jarryd in forum Free Hosting
    Replies: 4
    Last Post: 03-10-2008, 02:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers