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 best php version for wordpress?
How is a session id generated?
Where is php code written?
Explain type casting and type juggling.
What does it mean when it says the csrf token is invalid?
What is difference between mysqli and mysql?
What are the encryption functions available in PHP?
How to convert numbers to strings in php?
Explain Traits in PHP?
What are the different types of PHP arrays?
What is substr() in php? And how it is used?
What is inheritance in php? How many types of inheritance supports php?
What is variable give example?
Explain the ternary conditional operator in php?
What is the difference between Split and Explode in PHP?