darksniperx Posted November 10, 2007 Share Posted November 10, 2007 I have talked to few people and they said that php 4 has a function to handle multi language support. From what I heard you define a test file for each language and php grabs the text. I have try to search the web and this form and with no luck. Would anyone be able to point me to the right direction, or link to a tutorial. thx.. Quote Link to comment Share on other sites More sharing options...
Crew-Portal Posted November 10, 2007 Share Posted November 10, 2007 Got every sentance in a variable like $lang['sentance1'] = 'Hello My Fellow People Of The World!' (In file called English.php) $lang['sentance1'] = 'Здравствуйте Уважаемые соотечественники человек в мире!'; (In file called Russian.php) Now you call the variable like echo $lang['sentance1']; and at the top of your page you have include_once('Russian.php'); For the Russian Language include_once('English.php'); For the English Language And you do sessions and cookies and stuff to determine which language file to use based on user input! Quote Link to comment Share on other sites More sharing options...
Crew-Portal Posted November 10, 2007 Share Posted November 10, 2007 Also A Bonus: PHP Фреакс является Лучшие места в Интернет для всех ваших потребностей PHP! In English Means: PHPFreaks is the place on Interweb for all PHP needs! Quote Link to comment Share on other sites More sharing options...
darksniperx Posted November 10, 2007 Author Share Posted November 10, 2007 pohoje mnogo russko govorashih na forume. If I understand correctly then the code would look something like this-> <!--index.php?lang=en --> <?php $language = $_GET['lang']; include_once 'lang_' .$language. '.php'; ?> <html> <head></head> <body> <!-- top of the webpage header --> <?php echo $lang['header']; ?> <hr /> <form method='post'> <?php echo $lang['user']; ?><input type='text' name='user_id' /><br /> <?php echo $lang['pass']; ?><input type='password name='pass_id' /><br /> <input type='button' value='<?php echo $lang['submit_button']; ?>'/> </form> </body </html> <!-- lang_en.php --> <?php $lang['header']='Welcome to my site!'; $lang['user']='Username:'; $lang['pass']='Password:'; $lang['submit_button']='Submit'; ?> if I am correct then the code should look something like this? Quote Link to comment Share on other sites More sharing options...
Crew-Portal Posted November 10, 2007 Share Posted November 10, 2007 Bingo Perfect yat thats how it would be done! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.