简体   繁体   中英

how to change textbox input language gujarati as type in?

I am trying to convert Gujarati language when i input any text into text box.

I want to convert text into Gujarati before i enter text into text box.

when i click on button on Gujarati or select language from drop down list all data convert into Gujarati language before i insert any text into text box.

After i write any text it will written into Gujarati language.

i am trying with this code but i can't convert it into Gujarati Language.

protected void Page_Load(object sender, EventArgs e)
    {
            Thread.CurrentThread.CurrentCulture = new CultureInfo("gu-IN");
                rm = new ResourceManager("Resources.Strings", System.Reflection.Assembly.Load("App_GlobalResources"));
                ci = Thread.CurrentThread.CurrentCulture;
                LoadString(ci);
    }



protected void Button1_Click(object sender, EventArgs e)
    {
        Thread.CurrentThread.CurrentCulture = new CultureInfo("gu-IN");
        LoadString(Thread.CurrentThread.CurrentCulture);
    }

Thank You.

   Here's a sample method working for the seven letters of "tajmhal" (it may need some tweaking if groups of latin letters must be replaced by one Gujarati character):

public static string Transliterate(string latinCharacters)
{
        StringBuilder gujarati = new StringBuilder(latinCharacters.Length);
        for (int i = 0; i < latinCharacters.Length; i ++)
        {
                switch (char.ToLower(latinCharacters[i]))
                {
                        case 'a':
                                gujarati.Append('\u0abe');
                                break;
                        case 'h':
                                gujarati.Append('\u0ab9');
                                break;
                        case 'j':
                                gujarati.Append('\u0a9c');
                                break;
                        case 'l':
                                gujarati.Append('\u0ab2');
                                break;
                        case 'm':
                                gujarati.Append('\u0aae');
                                break;
                        case 't':
                                gujarati.Append('\u0aa4');
                                break;
                }
        }
        return gujarati.ToString();
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM