This is gonna be tough to explain, so bare with me cause my gramar kinda sucks...

Ok, I have a multilinugal yachting site with 2 languages, English and French. I created a page for yachts (images, specifications) and as you may know not all yachts have the same specifications.

So in the administration part of the site I created a section filled with check boxes so the admin will check the ones that correpsond to each yacht and after that insert the constant into the database. Every check box is like this (has a value of the text to be translated when the users sees the yacht page):

<input name="gps-plotter" type="checkbox" id="gps-plotter" value="_GPS_PLOTTER" />

In each language I have defined all the available options in en.php & fr.php file:
English:

define('_GPS_PLOTTER','GPS-Plotter');

French:

define('_GPS_PLOTTER','GPS & Plotter');

But if I go to the user page to see the yacht, instead of showing me in English or French GPS & Plotter it shows me _GPS_PLOTTER

Anyone knows a way to display it correctly?

Here are some images to understand what I mean:

Admin Page with checkboxes:

What the user sees:

    Try:

    <input name="gps-plotter" type="checkbox" id="gps-plotter" value="<? echo _GPS_PLOTTER?>" />

      Yeah but this way the script will add the english constant if we are at the admin area using the english version, so at the french version the user will see the english translation not the french and vise versa.

        Could you give us the admin code? It's kind of difficult to see what you mean.

          Ok here's a chunk of the admin code:

          $sql = "INSERT INTO $boats VALUES(
          			'', 
          			'".$_POST['main_cat']."', 
          			'".$_POST['sub_cat']."', 
          			'".$_POST['company']."', 
          			'".$_POST['boat_name']."', 
          			'".$_POST['small_desc']."', 
          			'".$_POST['year_built']."', 
          			'".$_POST['loa']."', 
          			'".$_POST['beam']."', 
          			'".$_POST['draft']."', 
          			'".$_POST['engine']."', 
          			'".$_POST['consumption']."', 
          			'".$_POST['fuel']."', 
          			'".$_POST['water']."', 
          			'".$_POST['cabins']."', 
          			'".$_POST['berths']."', 
          			'".$_POST['wc']."', 
          			'".$_POST['showers']."', 
          			'".$_POST['speed']."', 
          			'".$_POST['crew']."'";
          			(!empty($_POST['teak_deck'])) ? $sql .= ", '".$_POST['teak_deck']."'" : $sql .= '';
          
          

          where the $_POST['teak_deck'] is a value posted from a check box.

          Then at the user page it just echos from the database

          $boat_id = (int)$_GET['id'];
          
          $sql = "SELECT * FROM $boats WHERE b_id = '".mysql_real_escape_string($boat_id)."'";
          $result = mysql_query($sql);
          
          while($row = mysql_fetch_array($result))
          {
                 echo $row['teak_deck'];
          }

            I just can't seem to wrap my head around what you're doing? Where are you defining these constants? How does your script determine which language to use?

              Well I'm using Postnuke CMS. If you know this cms it has a module system where it defines all the languages installed in your site. It just looks for any file named global.php at the folder languages/eng, or languages/fra and includes it automatically.

              So what I did was to create a module and then add the extra constants to the files stated above.

              Sorry for not mentioning that I use this CMS at the first post.

                I'm not familar with that script. Anybody else?
                Does Postnuke have a support forum?

                  Never mind... I thought of another way to accomplish what I want. I just needed food for the mind I guess! I'll create an enum table ('0', '1') and store each option in it's own column. Then when the user sees the page the script will show only the ones with number 1. Thank you very much for your effort!!!

                    Write a Reply...