Ask about general coding issues or problems here.
Moderators: macek, egami, gesf
I want to generate an order form in diffrent language.
I want to display the order entry page ...by default in Engish but in different language (say "Hindi" having Devnagari script and fonts are available in the same)
Also the order viewing will be in Hindi as well as in English too.
Can anyone help how do I change the language
- New php-forum User
- Posts: 21
- Joined: Wed Jun 19, 2002 10:03 pm
pass a variable to the script to determine wich language you want displayed, if no variable is passed asume a language.
with that variable you can determine wich language you will have to display.
If you're using a database with product information or something like that you will have to make multiple fields for language-dependend data (like the field "description")
The best way is to install a language pack system into your site! The way this is achieved is:
First create a language folder, and then one for the language (eg Languages/English). In that folder place several files which are arrays. In the English one you'd have something like:
$lang['greetings'] = "Hello";
In the French one you'd have:
$lang['greetings'] = "Bon Jour";
Then, to display all the languages your visitors can choose from, just display the names of the language folders. On each page you'd have a variable to let you know which language they want to us, just simply include the file at the beginning. Then, when you want to place the greeting you just put $lang['greetings'] and it'll display the appropriate greeting for the selected language
Easy peasy ;)
Return to PHP coding => General
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest