Page 1 of 1
Hindi Website
Posted: Sat Nov 14, 2009 5:20 am
by rajoo.sharma
Hello,
I'm wondering how can I accept input in Hindi from my website's users?
All I know about is:
1. UTF-8 is the solution
2. add the following to the HTML Page:
<meta http-equiv="Content-Language" content="hi">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
3. MySQL database connection collation must be utf8_unicode_ci
If I paste anything from a hindi website like webduniya.com in my page's textbox it displays it correctly.
But I do not know how to get it by typing?
Do I need to use some javascript library?
Kindly suggest to achieve the same.
Regards
Re: Hindi Website
Posted: Sat Nov 14, 2009 5:39 am
by Apollo
rajoo.sharma wrote:But I do not know how to get it by typing?
What do you mean, if you visit your own site you can't manually enter text in Hindi?
Can you do it on other (Hindi) sites?
Re: Hindi Website
Posted: Sat Nov 14, 2009 5:56 am
by rajoo.sharma
yes, thats correct, I do not know how to get the input in Hindi, its basically transliteration I guess. Please check the following website:
http://www.webduniya.com/
and enter something in the search box, u'll see transliteration taking place. This has to be done using some javascript code, it can not be done by default just by specifying the UTF-8 charset.
Please correct me if I am wrong.
Regards
Re: Hindi Website
Posted: Sat Nov 14, 2009 6:03 am
by rajoo.sharma
Just check this website and it will open fine on your PC too. Type something in Search box and u'll see transliteration taking place:
http://www.webduniya.com
They are not using google API:
http://code.google.com/apis/ajaxlanguag ... on/#Single
They are using something else, although using google API could be best, I want to understand the implementation basics first.
Re: Hindi Website
Posted: Sat Nov 14, 2009 6:42 am
by Apollo
Hmm interesting, I've never seen anything like that before
Then again, I don't know squat about writing or translating Hindi, how do you 'normally' type text in Hindi? Do you need a special keyboard? (it is an alphabetical language, right?)
Re: Hindi Website
Posted: Sat Nov 14, 2009 8:39 am
by rajoo.sharma
Generally for this we install hindi font(s), in the word processor select the font and start typing, no need to install anything else.
But UTF-8 is something different, this encoding is supported by almost all the latest browsers including IE6. So the advantage is that there is no need to install additional fonts on client's browser.
Regards
Re: Hindi Website
Posted: Sat Nov 14, 2009 9:23 am
by Apollo
rajoo.sharma wrote:Generally for this we install hindi font(s), in the word processor select the font and start typing, no need to install anything else.
Exactly how do you type? I mean, what keys or letters do you press? (and on what kind of keyboard?)
Do you just press A, B, C etc on an English keyboard, and then in the word processor, अ ब क etc appears?
But UTF-8 is something different, this encoding is supported by almost all the latest browsers including IE6. So the advantage is that there is no need to install additional fonts on client's browser.
I don't think so.. UTF-8 is merely the encoding, which specifies how the characters are stored. No Hindi font = no displaying Hindi characters, regardless of whether how they are stored.
Re: Hindi Website
Posted: Sat Nov 14, 2009 9:42 am
by rajoo.sharma
yes, u said right, but for browsers, it is a javascript toolkit will do this tranliteration like this google API:
http://code.google.com/apis/ajaxlanguag ... on/#Single
Re: Hindi Website
Posted: Sat Nov 14, 2009 7:40 pm
by Vegan
If you are using the code as above, it should be OK on modern browsers. Make sure the entire site is tagged properly so that any language will display properly.
I have make many documents in many languages other than English and all work fine for me.
Re: Hindi Website
Posted: Sat Nov 28, 2009 12:55 am
by rajoo.sharma
I finally used Google transliteration API, I think there is no other solution. Or if somebody is interested, he can develop his own transliteration API.
An implementation can be seen on
http://www.greyboxtechnologies.com/dreamland
type something in the search box and when u press spacebar, it will be transliterated. I've used the same thing in the admin panel to enter the data, and it gets stored properly in my MySQL DB. This can be displayed on all modern browsers, no need to download any font, it can also be searched in the database, Zen-Cart's (The open source I used here) default search works fine on it.
I'll be more than happy to help anybody looking for similar implementation.
Regards.
Re: Hindi Website
Posted: Thu Sep 30, 2010 8:54 pm
by Vegan
I put the word chess on my
chess site in a huge basket of languages. I also carefully used HTML lang tags on each so that it would be recognized correctly by a search engine.
I have seen many of the words used on Google Analytics which told me my effort was worth it.
So I believe in the usefulness of correct language designations of all web pages.
And yes I even used Hindi for the great nation of India who I am sure still likes chess.