This question has already been answered:
- Multilingual web page / site 3 answers
I create a rervis website for repairing houses in two languages (Azerbaijani and Russian). I don't know much about programming. I found a script suiting me and translated the whole site. And everything was fine until I started creating pages and articles, because they also need to be translated, but the translation script works on arrays, I didn’t think for a long time, I realized that you need to create tables in two languages, it’s not hard! The page id = 1 will be with the Russian text, and the page with id = 2 on Azerb. language. BUT! The translation script, when selecting a specific language, does not touch the table. Hmm, too, here already without the help of the pros can not do. Maybe somehow make id = 1_rus or rus = 1 aze = 1. I ask for your help.
I do not use CMS, I write it myself. Here is the translation script:
$LangArray = array("Russkiy", "Azerbaycan"); $DefaultLang = "Russkiy"; if(@$_SESSION['NowLang']) { if(!in_array($_SESSION['NowLang'], $LangArray)) { $_SESSION['NowLang'] = $DefaultLang; } } else {$_SESSION['NowLang'] = $DefaultLang;} $language = addslashes($_GET['language']); if($language) {if(!in_array($language, $LangArray)) { $_SESSION['NowLang'] = $DefaultLang;} else {$_SESSION['NowLang'] = $language;} } $CurentLang = addslashes($_SESSION['NowLang']); include_once (ROOT.'/languages/'.$CurentLang.'.php');