rupam_jaiswal Posted August 28, 2008 Share Posted August 28, 2008 Hi, I have to make a language (literal) converter in php from english to hindi. i dont want the hindi translation of the word. just typing the same words in hindi if i type 'baloon' in english, it will convert as it is into hindi ( बलून ) ् I mean it only typing word 'baloon' in hindi using hindi letters rather than english. any idea???? Link to comment https://forums.phpfreaks.com/topic/121672-language-converter-in-php/ Share on other sites More sharing options...
hamza Posted August 28, 2008 Share Posted August 28, 2008 http://www.google.com/language_tools?hl=EN probably this site will help you in making convert Link to comment https://forums.phpfreaks.com/topic/121672-language-converter-in-php/#findComment-627715 Share on other sites More sharing options...
PHPTOM Posted August 28, 2008 Share Posted August 28, 2008 Couldn't you do something like this. I know it's an extremely bad way of doing it but I don't know any different. <?PHP $words = array( 'baloon' => 'बलून' ); ?> Then you could say: <?PHP echo "The translation of 'baloon' is: ".$words['baloon']; ?> Link to comment https://forums.phpfreaks.com/topic/121672-language-converter-in-php/#findComment-627935 Share on other sites More sharing options...
discomatt Posted August 28, 2008 Share Posted August 28, 2008 Yeah, you best bet is to have a list of hindi characters and a list of english characters in an array... <?php $eng = array( 'a', 'A', 'b', 'B', 'c', '... ect' ); $hin = array( 'hindi_a', 'hindi_A', '... ect' ); # then use $converted = str_replace($eng, $hin, $text); ?> I don't suggest doing this on the fly though. Do the conversion only when the data is modified, and store both versions in the db/file Link to comment https://forums.phpfreaks.com/topic/121672-language-converter-in-php/#findComment-628147 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.