views:

193

answers:

3

hi i'm developing a site you can check it from here: www.wikima4.com

and i want to have the multilingual integrate in the site. there is already a link at the upper right corner, for English, German and French.

My problem is if I click this one, the 3rd column is not changing it seems it is static. Any idea how can i have it change as well? I added a code below but when I check the localhost site, that column is created on the left.
you can check the picture here: http://www.freeimagehosting.net/uploads/b828dee5e3.png

     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
      <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
      {{head}}
      <body class="home">
      {{skip-links}}
     <div class="page_margins">
     <div class="page">
     {{header}}
     {{main-nav}}

    <!-- begin: main content area #main -->
    <div id="main">

    <!-- begin: #col2 second float column -->
    <div id="col2">
        <div id="col2_content" class="clearfix">
            {{mesaforte-tour-button}}
            {{news-box}}
            {{events-box}}
            {{articles-box}}
            {{success-box}}
            {{newsletter-box}}             
        </div>
    </div>
     <div id="col2">
        <div id="col2_content" class="clearfix">
             {{mesaforte-tour-button}}
             {{news-box}}
          </div>
      </div>  




    <!-- end: #col2 -->

 <!-- {{mainde-nav}}
  <div id="mainde">-->





    <!-- begin: #col3 static column -->
    <div id="col3">
        <div id="col3_content" class="clearfix">
            <div id="home">
                <div id="wikima4-home">
                    <p class="float_left"><a href="[~4~]">wikima4</a></p>
                </div>
                <div id="mesaforte-home">
                    <p class="float_right"><a href="[~5~]">mesaforte</a></p>
                </div>
            </div>
            {{teaser-box}}
    </div>


        <!-- IE column clearing -->
        <div id="ie_clearing">&nbsp;</div>
    </div>                
    <!-- end: #col3 -->
</div>
<!-- end: #main -->

   {{footer}}
   </div>
   </div>
  <!-- full skiplink functionality in webkit browsers -->
  <script src="assets/templates/wikima4/yaml/core/js/webkit-focusfix.js"    type="text/javascript"></script>
     </body>
     </html>
+1  A: 

Which technology you use? if asp.net there have Resource files, for setting and getting data. if you use database, you can get from db text to output in your website.

Also you can use XML file, and then get data by jQuery or javascript.

loviji
@loviji: i'm using cms modx. and i think php as well
tintincute
can i use the if and else statement here?
tintincute
you can use if and else statement. but I'm wonder about performance, how you are going to orginize if and else statement? for each static column or ?
loviji
what do you mean? i think i have to create a chunks for every link on this column but should be in german, just wondering what's the syntax for the if and else statement
tintincute
In this case, if you want to use the if/else (i use jquery) : if($('#lang').val()=='german') {$('#header').text()='Welcome to Germany'}
loviji
@loviji: can i just insert that in my code above?
tintincute
i tried jquery but it didn't work:-( the code display when i did that
tintincute
it's not working code, it's idea. you must follow the rules.
loviji
@loviji:what do you mean? what rules do I need to follow?
tintincute
A: 

Modx tutorial on making multilingual sites....perhaps it can help add some context: http://wiki.modxcms.com/index.php/Make_Multi_Lingual_Site

bpeterson76
+2  A: 

you should really not write your own "template engine" as php is a tempalte engine itsself.

simply change your code to not replacing strings in html but use php tags to put your dynamic data into the html code.

<?php include('/file/which/somehow/sets/my/variables.php') ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <title></title>
  </head>
  <body>
    <?php echo $head ?>
    <?php echo $skip_links ?>
    <div class="page_margins page">
      <?php echo $header ?> <?php echo $main_nav ?> <!-- begin: main content area #main -->
      <div id="main">
        <!-- begin: #col2 second float column -->
        <div id="col2">
          <div id="col2_content" class="clearfix">
            <?php echo $mesaforte_tour_button ?> <?php echo $news_box ?> <?php echo $events_box ?> <?php echo $articles_box ?> <?php echo $success_box ?>
            <?php echo $newsletter_box ?>
          </div>
        </div>
        <div id="col2">
          <div id="col2_content" class="clearfix">
            <?php echo $mesaforte_tour_button ?> <?php echo $news_box ?>
          </div>
        </div><!-- end: #col2 -->
        <!-- <?php echo $mainde_nav ?>
    <div id="mainde">-->
        <!-- begin: #col3 static column -->
        <div id="col3">
          <div id="col3_content" class="clearfix">
            <div id="home">
              <div id="wikima4-home">
                <p class="float_left">
                  <a href="[~4~]">wikima4</a>
                </p>
              </div>
              <div id="mesaforte-home">
                <p class="float_right">
                  <a href="[~5~]">mesaforte</a>
                </p>
              </div>
            </div><?php echo $teaser_box ?>
          </div><!-- IE column clearing -->
          <div id="ie_clearing">
            &nbsp;
          </div>
        </div><!-- end: #col3 -->
      </div><!-- end: #main -->
      <?php echo $footer ?>
    </div><!-- full skiplink functionality in webkit browsers -->
    <script src="assets/templates/wikima4/yaml/core/js/webkit-focusfix.js" type="text/javascript">
</script>
  </body>
</html>
zolex
+1 for pointing out that "php is a tempalte engine itsself". There are so many bad programmers duplicating PHP functionality and writing things like smarty... And the rest of the world adores them.
doc
@doc True, but look at this page and youll see why http://www.smarty.net/whyuse.php. A lot of developers like to keep their code and styling seperated.
Matt
@Matt: and who forbids you to keep two separate files for that in PHP? To be honest I am using my own template engine for something more than only separation of logic and presentation. Smarty is just terrible. It basically duplicated all the PHP core functionality with its own syntax.
doc
@doc Im now saying i use it or like. I had to use it for another piece of software at one point (thank god they re-wrote it using php templates), but there are people out there who are more web designers than developers. Those designers don't like to see code, only the styling portion of it. I don't know anyone that uses and i won't ever recommend using it just because php (like what is mentioned above) is a template engine itself.
Matt
wo what's the difference between seeing <?= $myVar ?> and {%myVar%} or whatever those performance-killers aka template engines do with their custom syntax ;)
zolex
hi guys just saw the reply will update this once it works. i'm not sure what is self engine template means? i haven't done any php and just started...so please pardon me for this
tintincute