How can I make a script that can be bilanguage (supports
English, German)?
Answer Posted / koushikgraj
1. create different files to store different languages
eg: languages/eng.php
languages/ger.php
2. add constant variables in both the files
eg: languages/eng.php :: define('QUES','How are you');
eg: languages/ger.php :: contains define('QUES','Wie geht
es Ihnen');
3. in template page need to use the constant variable to
load the different language
eg: <div><?php echo QUES;?></div>
4. load different files according to language request
5. ofcourse we need to use characters encoding UTF-8 in HTMl
or PHP pages.
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What is the importance of "method" attribute in a html form?
What are php errors?
Is php front end or back end?
What language is php written in?
What is the meaning of xdebug?
How to get useful error messages in php?
Is php a framework?
How check variable is set or not in php?
Explain the importance of the function htmlentities.
What is default session time in php?
What type of headers have to be added in the mail function to attach a file?
How can I increase my website session?
Which function would you use to insert a record into a database in php?
How do I install php?
Explain what are psrs?