Hello, I m searching for resources provide guidance about develop site in multi languages using PHP. please post some resources or provide some guidance for the same. thanks
Automatic, you have seen some sites where you can find flag of different countries and once you click on flag language will change accordingly.
It's pretty simple. Make sure this code is available on all pages where the multi language function is needed. (Save it as an external file and include() it if you want.) <?php // Where all language files will be stored $language_path = 'languages/'; if (!isset($_GET['lang']) OR !@include("{$language_path}lang.{$_GET{['lang']}.php")) { // Default language include("{$language_path}lang.en.php"); } ?> PHP: Inside these language files create an array with the text pieces. lang.en.php: <?php $lang['welcome'] = 'Welcome to my site.'; $lang['login'] = 'Please log in'; $lang['error'] = 'An error occurred'; ?> PHP: Now in your main site, use <?php echo $lang['xxx']; ?> instead of the normal text, and it'll be replaced with the appropriate language bit. To switch the language while being on the site just add a lang variable to the URL like this: example.com/file.php?lang=en The language files need to be saved in this format: lang.xx.php, where xx is the name in the URL that you want to use.
i've done this a few times.. with a few clients.. though i would recommend translating manually.. automatically translated versions suck. anyhow i've transalted sites with babelfish.. all u have to do is create a link on your site sending to babel fish the correct language your translating from and into... something like this: http://babelfish.altavista.com/babe...t?lp=en_es&url=http://www.edirectproperty.com these are the variables u have at the end: lp=en_es (here we translate from english to spanish) url=http://www.edirectproperty.com (this is the website we want to translate)
i had tried that and i m getting this error "Temporary problem with the foreign-language section. Please try again later. Sorry for the inconvenience." any solution??
That generally means that the script is having trouble talking to the translation server, i.e. that Google or Yahoo have temporarily banned your IP.
Thanks Will Spencer! Can you introduction more with everyone about your file (lang2). I read instruction in that file but i have error as Viteb. Wait your toturial in nearest day! Thanks much!