Hindi Editor

Hindi Editor

In my previous article I have added a Punjabi editor. now in the continuation of the series here I am going to post the Hindi editor. This editor is also based on the same concept please go through the Punjabi Editor for the previous details the common.js can be found at Punjabi Editor which will be same for my coming editors and even this editor.



The file which will be different is the Hindi.js and here is the code for that copy the code and save the file as Hindi.js.




/* Copyright (C) 2008 Gopalakrishnan (Gopi)



This program is free software: you can redistribute it and/or modify

it under the terms of the GNU General Public License as published by

the Free Software Foundation, either version 3 of the License, or

(at your option) any later version.



This program is distributed in the hope that it will be useful,

but WITHOUT ANY WARRANTY; without even the implied warranty of

MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

GNU General Public License for more details.



You should have received a copy of the GNU General Public License

along with this program. If not, see < http://www.gnu.org/licenses/>.



Further to the terms mentioned you should leave this copyright notice

intact, stating me as the original author.

*/

var lang = "hindi";

var chnbin = "\u094D";

var ugar = "\u0941";

var uugar = "\u0942";

myimg.src = "images/"+lang+".png";



var hi = new Array();

var hitw = new Array



hitw['\\!'] = "\u090D";

hitw['\\@'] = "\u0945";

hitw['\\#'] = "\u094D\u0930";

hitw['\\$'] = "\u0930\u094D";

hitw['\\%'] = "\u091C\u094D\u091E";

hitw['\\^'] = "\u0924\u094D\u0930";

hitw['\\&'] = "\u0915\u094D\u0937";

hitw['\\*'] = "\u0936\u094D\u0930";

hitw['_'] = "\u0903";

hitw['\\+'] = "\u090B";

hitw['\\='] = "\u0943";

hitw['q'] = "\u094C";

hitw['w'] = "\u0948";

hitw['e'] = "\u093E";

hitw['r'] = "\u0940";

hitw['t'] = "\u0942";

hitw['y'] = "\u092C";

hitw['u'] = "\u0939";

hitw['i'] = "\u0917";

hitw['o'] = "\u0926";

hitw['p'] = "\u091C";

hitw['\\['] = "\u0921";

hitw['\\]'] = "\u093C";

hitw['Q'] = "\u0914";

hitw['W'] = "\u0910";

hitw['E'] = "\u0906";

hitw['R'] = "\u0908";

hitw['T'] = "\u090A";

hitw['Y'] = "\u092D";

hitw['U'] = "\u0919";

hitw['I'] = "\u0918";

hitw['O'] = "\u0927";

hitw['P'] = "\u091D";

hitw['\\{'] = "\u0922";

hitw['\\}'] = "\u091E";



hitw['a'] = "\u094B";

hitw['s'] = "\u0947";

hitw['d'] = "\u094D";

hitw['f'] = "\u093F";

hitw['g'] = "\u0941";

hitw['h'] = "\u092A";

hitw['j'] = "\u0930";

hitw['k'] = "\u0915";

hitw['l'] = "\u0924";

hitw[';'] = "\u091A";

hitw['\\\''] = "\u091F";

hitw['\\\\'] = "\u0949";

hitw['A'] = "\u0913";

hitw['S'] = "\u090F";

hitw['D'] = "\u0905";

hitw['F'] = "\u0907";

hitw['G'] = "\u0909";

hitw['H'] = "\u092B";

hitw['J'] = "\u0931";

hitw['K'] = "\u0916";

hitw['L'] = "\u0925";

hitw[':'] = "\u091B";

hitw['"'] = "\u0920";

hitw['\\|'] = "\u0911";



hitw['z'] = "";

hitw['x'] = "\u0902";

hitw['c'] = "\u092E";

hitw['v'] = "\u0928";

hitw['b'] = "\u0935";

hitw['n'] = "\u0932";

hitw['m'] = "\u0938";

hitw['/'] = "\u092F";

hitw['Z'] = "";

hitw['X'] = "\u0901";

hitw['C'] = "\u0923";

hitw['V'] = "";

hitw['B'] = "";

hitw['N'] = "\u0933";

hitw['M'] = "\u0936";

hitw['<'] = "\u0937";

hitw['>'] = "\u0964";

hitw['\\?'] = "\u095F";



//Phonetic

hi['B'] = "b";

hi['C'] = "c";

hi['F'] = "ph";

hi['f'] = "ph";

hi['G'] = "g";

hi['J'] = "j";

hi['K'] = "k";

hi['M'] = "m";

hi['P'] = "p";

hi['Q'] = "q";

hi['V'] = "v";

hi['W'] = "v";

hi['w'] = "v";

hi['X'] = "x";

hi['Y'] = "y";

hi['Z'] = "z";

//Cons

hi['k'] = "\u0915\u094D";

hi['c'] = "\u091A\u094D";

hi['T'] = "\u091F\u094D";

hi['D'] = "\u0921\u094D";

hi['N'] = "\u0923\u094D";

hi['t'] = "\u0924\u094D";

hi['d'] = "\u0926\u094D";

hi['p'] = "\u092A\u094D";

hi['b'] = "\u092C\u094D";





hi['y'] = "\u092F\u094D";

hi['R'] = "\u0931\u094D";

hi['L'] = "\u0933\u094D";

hi['v'] = "\u0935\u094D";

hi['s'] = "\u0938\u094D";

hi['S'] = "\u0937\u094D";

hi['H'] = "\u0939\u094D";

hi['x'] = "\u0915\u094D\u0936\u094D";



hi['\u200Dn'] = "\u0901";

hi['\u200Dm'] = "\u0902";

hi['m'] = "\u092E\u094D";

hi['n'] = "\u0928\u094D";

hi[':h'] = "\u0903";



hi['\u0928\u094D\\.'] = "\u0929\u094D";

hi['\u0930\u094D\\.'] = "\u0931\u094D";

hi['q'] = "\u0958\u094D";

hi['\u0915\u094D\\.'] = "\u0958\u094D";

hi['\u0916\u094D\\.'] = "\u0959\u094D";

hi['\u0917\u094D\\.'] = "\u095A\u094D";

hi['z'] = "\u095B\u094D";

hi['\u0921\u094D\\.'] = "\u095C\u094D";

hi['\u0922\u094D\\.'] = "\u095D\u094D";

hi['\u092B\u094D\\.'] = "\u095E\u094D";

hi['\u092F\u094D\\.'] = "\u095F\u094D";



hi['\u0915\u094Dh'] = "\u0916\u094D";

hi['\u0917\u094Dh'] = "\u0918\u094D";

hi['\u0928\u094Dg'] = "\u0919\u094D";

hi['\u091A\u094Dh'] = "\u091B\u094D";

hi['\u091C\u094Dh'] = "\u091D\u094D";

hi['\u0928\u094Dj'] = "\u091E\u094D";

hi['\u091F\u094Dh'] = "\u0920\u094D";

hi['\u0921\u094Dh'] = "\u0922\u094D";

hi['\u0924\u094Dh'] = "\u0925\u094D";

hi['\u0926\u094Dh'] = "\u0927\u094D";

hi['\u092A\u094Dh'] = "\u092B\u094D";

hi['\u092C\u094Dh'] = "\u092D\u094D";

hi['\u0938\u094Dh'] = "\u0936\u094D";

hi['\u0931\u094Dr'] = "\u090B";

hi['\u0933\u094Dl'] = "\u090C";

hi['\u094D\u090B'] = "\u0943";

hi['\u0913\u092E\u094D'] = "\u0950";

hi['r'] = "\u0930\u094D";

hi['l'] = "\u0932\u094D";

hi['h'] = "\u0939\u094D";

hi['g'] = "\u0917\u094D";

hi['j'] = "\u091C\u094D";

//VowSml

hi['\u094Da'] = "\u200C";

hi['\u094Di'] = "\u093F";

hi['\u094Du'] = "\u0941";

hi['\u094De'] = "\u0946";

hi['\u094Do'] = "\u094A";

hi['\u200Ci'] = "\u0948";

hi['\u200Cu'] = "\u094C";

hi['\u200C-'] = "\u200D";

hi['\u200C:'] = ":";

hi['-'] = "\u200D";

//VowBig

hi['\u200Ca'] = "\u093E";

hi['\u093Fi'] = "\u0940";

hi['\u0941u'] = "\u0942";

hi['\u0946e'] = "\u0947";

hi['\u094Ao'] = "\u094B";

hi['\u094DA'] = "\u093E";

hi['\u094DI'] = "\u0940";

hi['\u094DU'] = "\u0942";

hi['\u094DE'] = "\u0947";

hi['\u094DO'] = "\u094B";

//Vows

hi['\u0905i'] = "\u0910";

hi['\u0905u'] = "\u0914";

hi['\u0905a'] = "\u0906";

hi['\u0907i'] = "\u0908";

hi['\u0909u'] = "\u090A";

hi['\u090Ee'] = "\u090F";

hi['\u0912o'] = "\u0913";

hi['\u0913m'] = "\u0950";



hi['a'] = "\u0905";

hi['A'] = "\u0906";

hi['i'] = "\u0907";

hi['I'] = "\u0908";

hi['u'] = "\u0909";

hi['U'] = "\u090A";

hi['e'] = "\u090E";

hi['E'] = "\u090F";

hi['o'] = "\u0912";

hi['O'] = "\u0913";

//Nums

hi['\u200D1'] = "\u0967";

hi['\u200D2'] = "\u0968";

hi['\u200D3'] = "\u0969";

hi['\u200D4'] = "\u096A";

hi['\u200D5'] = "\u096B";

hi['\u200D6'] = "\u096C";

hi['\u200D7'] = "\u096D";

hi['\u200D8'] = "\u096E";

hi['\u200D9'] = "\u096F";

hi['\u200D0'] = "\u0966";

hi['(.+)\u200C(.+)'] = "$1$2";




and the aspx ot html will look like



< !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" >

< HTML >



< HEAD >

< META http-equiv="Content-Type" content="text/html; charset=utf-8" >

< META content="hindi,iscii,unicode,converter,hindiunicode,unicodehindi,hindi,hindiblog,unicodehindifont,tools,utilitieshindisoftware,font,software,web,net,convert,english,online,phonetic,typing" name=keywords >

< SCRIPT language=JavaScript src="script/common.js" > < /SCRIPT >

< SCRIPT language=JavaScript src="script/hindi.js" > < /SCRIPT >

< SCRIPT language=JavaScript > incfont("Code2000","CODEHindi")< /SCRIPT >

< LINK rel="stylesheet" href="style/higopi.css" type="text/css" >

< /HEAD >

< BODY >

< h2 class=converters > Kamaraj कामराज 3.0< sup > ©< /sup > < /h2 >

< form name="post" method="post" >

< b > Type in English and get it converted to Unicode Hindi< /B > . Use < b > F12< /b > to toggle between English & Hindi

< br >

< textarea class=converters name=comment charset="utf-8" onKeyPress="javascript:convertThis(event)"

onKeyDown="toggleKBMode(event)" > < /textarea >

< br >

< /BODY >

< /HTML >




Comments

Author: Pradeep Iyer22 Apr 2009 Member Level: Gold   Points : 1

Hi,

Good one..

Keep posting more such codes..

Useful indeed..

Regards,
Pradeep

Author: Vishal12 May 2009 Member Level: Gold   Points : 1

Hi

really nice !
I dont know anything about coding but through coding i never seen such translation

keep posting differently

Regards,
Sheetal.

Author: Vicky Solanki11 Feb 2010 Member Level: Bronze   Points : 1

its not working in aspx page i tried it
please reply
i have to make a hindi registration form.

Author: Reets12 Feb 2010 Member Level: Gold   Points : 1

Hi Meenu,

The code snippet is clear and good to understand but still carry some execution problem.Please re-check if the posting made is all correct coz i tried a lot still not working

Regards
Reet

Author: Jayendra Kumar12 Feb 2010 Member Level: Gold   Points : 1

Thanks to post such a nice code. It will help other member to learn new things.


Thanks A lot

Author: Bhasker Reddy02 Nov 2010 Member Level: Bronze   Points : 1

Hi Meetu,
just here i am not able to find the complete code to run the Hindi editor could you please send me the required js(Hindi.js,common.js) files and corresponding aspx page.
it is very high priority task.

kindly send me the required code for Hindi Editor

Regards,
Bhasker Reddy
9920594877

Author: srikanth03 Nov 2010 Member Level: Gold   Points : 0

nice miss mitu...........keep going

Author: Jai Kumar Bhagwani15 Feb 2011 Member Level: Bronze   Points : 1

Hi miss Meetu ,

I tried it Very Much but it's not working Please help , i need it very much , i am sending attachment File (Link Available Below) what i tried Please Check it out and send me solution , Thank You very much.

Jai Bhagwani ,

Mob:-7737183354

Email Id:- jaikumar.bhagwani@yahoo.com

Author: swajis17 Feb 2011 Member Level: Silver   Points : 1

hi miss meetu,

i have tried it but some problem is occuring while execution


Email:id 4swajis@gmail.com

Author: Er. Ram Singh20 Feb 2011 Member Level: Gold   Points : 0

Guest Author: navi12 Feb 2014

Hello Please Help me
I am Developing Online test application
Client need to post Question in English as well in Hindi language i used many codes but not getting proper answer
like xs + s not written correctly and maths symbols not reflected properly
Please Help me



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: