Forum Moderators: coopster
Home page is created with php... so normal content of page is already created with 2 languages using php with cookie session.
ok my problem now is, that I would like to use existing mysql table (just add new columns for new language, since some data are same in all languages).
so here is my php file for existing table:
<?php
include ("classes/clsPonudbaView.php");
$listingObjPonudba = new PonudbaView();
$listingArrPonudba = $listingObjPonudba->izbranaKategorija();
?>
<?php
foreach ($listingArrPonudba as $key=>$valuePonudba) {
?>
<div class="vsebina_artikel">
<div class="vsebina_textovna">
<h3><?php echo $valuePonudba->getIme(); ?></h3>
<p class="vsebina_txt"><?php echo $valuePonudba->getOpis(); ?></p>
<p><span class="tabela_opis"><?php echo $lang['tab_al_emb']; ?></span><span class="vsebina_txt"> <?php echo $valuePonudba->getEmbalaza(); ?></span></p>
<p><span class="tabela_opis"><?php echo $lang['tab_al_alko']; ?></span><span class="vsebina_txt"> <?php echo $valuePonudba->getSt_alko(); ?> %</span></p>
</div>
<div class="vsebina_slika"><img src="images/produkti/<?php echo $valuePonudba->getSlika(); ?>.jpg" alt="gama" /></div>
</div>
<?php
}
?>
so I would like to set, for language 1 use $valuePonudba->getIme() / for language 2 use $valuePonudba->getIme_en()
thank you
Most multi-lingual classes will handle the similar processing methods without being concerned over the language. Then they separate the language-specifics into language files or some other form of configuration files. Your parent class would have a language property that is checked to determine which variation to use.